@@ -4,6 +4,7 @@ import { Field, Form, Formik, FormikProps } from "formik";
44import { useEffect , useRef , useState } from "react" ;
55import * as Yup from "yup" ;
66import CheckBox from "../components/general/CheckBox" ;
7+ import Indicator from "../components/general/Indicator" ;
78import InputField from "../components/general/InputField" ;
89import Toast from "../components/general/Toast" ;
910import useMyAccount from "../hooks/useMyAccount" ;
@@ -51,11 +52,36 @@ const SettingsPage = () => {
5152 < div className = "flex flex-col gap-y-2" >
5253 < Field type = "text" name = "redmineURL" title = "Redmine URL" placeholder = "Redmine URL" required as = { InputField } error = { touched . redmineURL && errors . redmineURL } />
5354 < Field type = "password" name = "redmineApiKey" title = "Redmine API-Key" placeholder = "Redmine API-Key" required as = { InputField } error = { touched . redmineApiKey && errors . redmineApiKey } />
54- { myAccount . data && (
55- < p >
56- User: { myAccount . data . firstname } { myAccount . data . lastname } ({ myAccount . data . login } )
57- </ p >
58- ) }
55+
56+ < div className = "flex items-center gap-x-2" >
57+ { myAccount . isLoading && (
58+ < >
59+ < Indicator variant = "primary" />
60+ < p > Connecting...</ p >
61+ </ >
62+ ) }
63+ { myAccount . isError && (
64+ < >
65+ < Indicator variant = "danger" />
66+ < p > Connection failed</ p >
67+ </ >
68+ ) }
69+ { ! myAccount . isLoading && ! myAccount . isError && myAccount . data && (
70+ < >
71+ < Indicator variant = "success" />
72+ < div >
73+ < p > Connection successful!</ p >
74+ < p >
75+ Hello{ " " }
76+ < strong >
77+ { myAccount . data . firstname } { myAccount . data . lastname }
78+ </ strong > { " " }
79+ ({ myAccount . data . login } )
80+ </ p >
81+ </ div >
82+ </ >
83+ ) }
84+ </ div >
5985 </ div >
6086 </ fieldset >
6187 < fieldset className = "p-1.5 rounded-lg border border-gray-300 dark:border-gray-600" >
@@ -83,7 +109,9 @@ const SettingsPage = () => {
83109 ) }
84110 </ Formik >
85111 < div className = "w-full flex flex-col items-center p-2 mt-3" >
86- < g > { chrome . runtime . getManifest ( ) . name } </ g >
112+ < a href = "https://chrome.google.com/webstore/detail/redmine-time-tracking/ldcanhhkffokndenejhafhlkapflgcjg" target = "_blank" tabIndex = { - 1 } className = "hover:underline" >
113+ { chrome . runtime . getManifest ( ) . name }
114+ </ a >
87115 < p > Version: { chrome . runtime . getManifest ( ) . version } </ p >
88116 </ div >
89117 { saved && < Toast type = "success" message = "Settings saved!" onClose = { ( ) => setSaved ( false ) } /> }
0 commit comments