@@ -10,7 +10,9 @@ import { Button, Input, Spinner } from "@plane/ui";
1010// components
1111import { Banner } from "@/components/common/banner" ;
1212// local components
13+ import { FormHeader } from "../../../core/components/instance/form-header" ;
1314import { AuthBanner } from "./auth-banner" ;
15+ import { AuthHeader } from "./auth-header" ;
1416import { authErrorHandler } from "./auth-helpers" ;
1517
1618// service initialization
@@ -101,78 +103,91 @@ export const InstanceSignInForm: FC = () => {
101103 } , [ errorCode ] ) ;
102104
103105 return (
104- < form
105- className = "space-y-4"
106- method = "POST"
107- action = { `${ API_BASE_URL } /api/instances/admins/sign-in/` }
108- onSubmit = { ( ) => setIsSubmitting ( true ) }
109- onError = { ( ) => setIsSubmitting ( false ) }
110- >
111- { errorData . type && errorData ?. message ? (
112- < Banner type = "error" message = { errorData ?. message } />
113- ) : (
114- < > { errorInfo && < AuthBanner bannerData = { errorInfo } handleBannerData = { ( value ) => setErrorInfo ( value ) } /> } </ >
115- ) }
116- < input type = "hidden" name = "csrfmiddlewaretoken" value = { csrfToken } />
117-
118- < div className = "w-full space-y-1" >
119- < label className = "text-sm text-onboarding-text-300 font-medium" htmlFor = "email" >
120- Email < span className = "text-red-500" > *</ span >
121- </ label >
122- < Input
123- className = "w-full border border-onboarding-border-100 !bg-onboarding-background-200 placeholder:text-onboarding-text-400"
124- id = "email"
125- name = "email"
126- type = "email"
127- inputSize = "md"
128- 129- value = { formData . email }
130- onChange = { ( e ) => handleFormChange ( "email" , e . target . value ) }
131- autoComplete = "on"
132- autoFocus
133- />
134- </ div >
135-
136- < div className = "w-full space-y-1" >
137- < label className = "text-sm text-onboarding-text-300 font-medium" htmlFor = "password" >
138- Password < span className = "text-red-500" > *</ span >
139- </ label >
140- < div className = "relative" >
141- < Input
142- className = "w-full border border-onboarding-border-100 !bg-onboarding-background-200 placeholder:text-onboarding-text-400"
143- id = "password"
144- name = "password"
145- type = { showPassword ? "text" : "password" }
146- inputSize = "md"
147- placeholder = "Enter your password"
148- value = { formData . password }
149- onChange = { ( e ) => handleFormChange ( "password" , e . target . value ) }
150- autoComplete = "on"
106+ < >
107+ < AuthHeader />
108+ < div className = "flex flex-col justify-center items-center flex-grow w-full py-6 mt-10" >
109+ < div className = "relative flex flex-col gap-6 max-w-[22.5rem] w-full" >
110+ < FormHeader
111+ heading = "Manage your Plane instance"
112+ subHeading = "Configure instance-wide settings to secure your instance"
151113 />
152- { showPassword ? (
153- < button
154- type = "button"
155- className = "absolute right-3 top-3.5 flex items-center justify-center text-custom-text-400"
156- onClick = { ( ) => setShowPassword ( false ) }
157- >
158- < EyeOff className = "h-4 w-4" />
159- </ button >
160- ) : (
161- < button
162- type = "button"
163- className = "absolute right-3 top-3.5 flex items-center justify-center text-custom-text-400"
164- onClick = { ( ) => setShowPassword ( true ) }
165- >
166- < Eye className = "h-4 w-4" />
167- </ button >
168- ) }
114+ < form
115+ className = "space-y-4"
116+ method = "POST"
117+ action = { `${ API_BASE_URL } /api/instances/admins/sign-in/` }
118+ onSubmit = { ( ) => setIsSubmitting ( true ) }
119+ onError = { ( ) => setIsSubmitting ( false ) }
120+ >
121+ { errorData . type && errorData ?. message ? (
122+ < Banner type = "error" message = { errorData ?. message } />
123+ ) : (
124+ < >
125+ { errorInfo && < AuthBanner bannerData = { errorInfo } handleBannerData = { ( value ) => setErrorInfo ( value ) } /> }
126+ </ >
127+ ) }
128+ < input type = "hidden" name = "csrfmiddlewaretoken" value = { csrfToken } />
129+
130+ < div className = "w-full space-y-1" >
131+ < label className = "text-sm text-custom-text-300 font-medium" htmlFor = "email" >
132+ Email < span className = "text-red-500" > *</ span >
133+ </ label >
134+ < Input
135+ className = "w-full border border-custom-border-100 !bg-custom-background-100 placeholder:text-custom-text-400"
136+ id = "email"
137+ name = "email"
138+ type = "email"
139+ inputSize = "md"
140+ 141+ value = { formData . email }
142+ onChange = { ( e ) => handleFormChange ( "email" , e . target . value ) }
143+ autoComplete = "on"
144+ autoFocus
145+ />
146+ </ div >
147+
148+ < div className = "w-full space-y-1" >
149+ < label className = "text-sm text-custom-text-300 font-medium" htmlFor = "password" >
150+ Password < span className = "text-red-500" > *</ span >
151+ </ label >
152+ < div className = "relative" >
153+ < Input
154+ className = "w-full border border-custom-border-100 !bg-custom-background-100 placeholder:text-custom-text-400"
155+ id = "password"
156+ name = "password"
157+ type = { showPassword ? "text" : "password" }
158+ inputSize = "md"
159+ placeholder = "Enter your password"
160+ value = { formData . password }
161+ onChange = { ( e ) => handleFormChange ( "password" , e . target . value ) }
162+ autoComplete = "on"
163+ />
164+ { showPassword ? (
165+ < button
166+ type = "button"
167+ className = "absolute right-3 top-3.5 flex items-center justify-center text-custom-text-400"
168+ onClick = { ( ) => setShowPassword ( false ) }
169+ >
170+ < EyeOff className = "h-4 w-4" />
171+ </ button >
172+ ) : (
173+ < button
174+ type = "button"
175+ className = "absolute right-3 top-3.5 flex items-center justify-center text-custom-text-400"
176+ onClick = { ( ) => setShowPassword ( true ) }
177+ >
178+ < Eye className = "h-4 w-4" />
179+ </ button >
180+ ) }
181+ </ div >
182+ </ div >
183+ < div className = "py-2" >
184+ < Button type = "submit" size = "lg" className = "w-full" disabled = { isButtonDisabled } >
185+ { isSubmitting ? < Spinner height = "20px" width = "20px" /> : "Sign in" }
186+ </ Button >
187+ </ div >
188+ </ form >
169189 </ div >
170190 </ div >
171- < div className = "py-2" >
172- < Button type = "submit" size = "lg" className = "w-full" disabled = { isButtonDisabled } >
173- { isSubmitting ? < Spinner height = "20px" width = "20px" /> : "Sign in" }
174- </ Button >
175- </ div >
176- </ form >
191+ </ >
177192 ) ;
178193} ;
0 commit comments