MCPcopy Create free account
hub / github.com/coder/coder / SetupPageView

Function SetupPageView

site/src/pages/SetupPage/SetupPageView.tsx:153–442  ·  view source on GitHub ↗
({
	onSubmit,
	error,
	isLoading,
	authMethods,
})

Source from the content-addressed store, hash-verified

151}
152
153export const SetupPageView: FC<SetupPageViewProps> = ({
154 onSubmit,
155 error,
156 isLoading,
157 authMethods,
158}) => {
159 const form: FormikContextType<TypesGen.CreateFirstUserRequest> =
160 useFormik<TypesGen.CreateFirstUserRequest>({
161 initialValues: {
162 email: "",
163 password: "",
164 username: "",
165 name: "",
166 trial: false,
167 trial_info: {
168 first_name: "",
169 last_name: "",
170 phone_number: "",
171 job_title: "",
172 company_name: "",
173 country: "",
174 developers: "",
175 },
176 onboarding_info: {
177 newsletter_marketing: false,
178 newsletter_releases: false,
179 },
180 },
181 validationSchema,
182 onSubmit,
183 validateOnBlur: false,
184 validateOnMount: true,
185 });
186 const getFieldHelpers = getFormHelpers<TypesGen.CreateFirstUserRequest>(
187 form,
188 error,
189 );
190
191 return (
192 <div className="grow basis-0 min-h-screen flex justify-center items-center py-12">
193 <div className="flex flex-col w-full max-w-[500px] px-4">
194 <header className="mb-8">
195 <ProductLogo />
196 <h1 className="text-2xl font-normal mt-4 mb-0">
197 Welcome to <strong>Coder</strong>
198 </h1>
199 <p className="mt-3 mb-0 text-sm text-content-secondary font-normal">
200 Set up your admin account and start building secure, reproducible
201 dev environments.
202 </p>
203 </header>
204
205 <form onSubmit={form.handleSubmit} className="flex flex-col gap-6">
206 {authMethods?.github.enabled && (
207 <>
208 <Button className="w-full" asChild type="submit" size="lg">
209 <a href="/api/v2/users/oauth2/github/callback">
210 <ExternalImage src="/icon/github.svg?blackWithColor" />

Callers

nothing calls this directly

Calls 3

getFormHelpersFunction · 0.90
onChangeTrimmedFunction · 0.90
usernameFromEmailFunction · 0.85

Tested by

no test coverage detected