1
- import Box from "@mui/material/Box" ;
2
1
import Checkbox from "@mui/material/Checkbox" ;
3
2
import TextField from "@mui/material/TextField" ;
4
- import Typography from "@mui/material/Typography" ;
5
3
import { SignInLayout } from "components/SignInLayout/SignInLayout" ;
6
- import { Stack } from "components/Stack/Stack" ;
7
- import { Welcome } from "components/Welcome/Welcome" ;
8
4
import { type FormikContextType , useFormik } from "formik" ;
9
5
import {
10
6
getFormHelpers ,
@@ -14,6 +10,10 @@ import {
14
10
import * as Yup from "yup" ;
15
11
import type * as TypesGen from "api/typesGenerated" ;
16
12
import LoadingButton from "@mui/lab/LoadingButton" ;
13
+ import { FormFields , VerticalForm } from "components/Form/Form" ;
14
+ import { CoderIcon } from "components/Icons/CoderIcon" ;
15
+ import Link from "@mui/material/Link" ;
16
+ import { docs } from "utils/docs" ;
17
17
18
18
export const Language = {
19
19
emailLabel : "Email" ,
@@ -64,10 +64,40 @@ export const SetupPageView: React.FC<SetupPageViewProps> = ({
64
64
65
65
return (
66
66
< SignInLayout >
67
- < Welcome message = { Language . welcomeMessage } />
68
- < form onSubmit = { form . handleSubmit } >
69
- < Stack >
67
+ < header
68
+ css = { ( theme ) => ( {
69
+ textAlign : "center" ,
70
+ marginBottom : theme . spacing ( 4 ) ,
71
+ } ) }
72
+ >
73
+ < CoderIcon
74
+ css = { ( theme ) => ( {
75
+ color : theme . palette . text . primary ,
76
+ fontSize : theme . spacing ( 8 ) ,
77
+ } ) }
78
+ />
79
+ < h1
80
+ css = { ( theme ) => ( {
81
+ fontWeight : 400 ,
82
+ margin : 0 ,
83
+ marginTop : theme . spacing ( 2 ) ,
84
+ } ) }
85
+ >
86
+ Welcome to < strong > Coder</ strong >
87
+ </ h1 >
88
+ < div
89
+ css = { ( theme ) => ( {
90
+ marginTop : theme . spacing ( 1.5 ) ,
91
+ color : theme . palette . text . secondary ,
92
+ } ) }
93
+ >
94
+ Let‘s create your first admin user account
95
+ </ div >
96
+ </ header >
97
+ < VerticalForm onSubmit = { form . handleSubmit } >
98
+ < FormFields >
70
99
< TextField
100
+ autoFocus
71
101
{ ...getFieldHelpers ( "username" ) }
72
102
onChange = { onChangeTrimmed ( form ) }
73
103
autoComplete = "username"
@@ -89,40 +119,65 @@ export const SetupPageView: React.FC<SetupPageViewProps> = ({
89
119
label = { Language . passwordLabel }
90
120
type = "password"
91
121
/>
92
- < div css = { { borderRadius : 16 } } >
93
- < Box display = "flex" >
94
- < div >
95
- < Checkbox
96
- id = "trial"
97
- name = "trial"
98
- defaultChecked
99
- value = { form . values . trial }
100
- onChange = { form . handleChange }
101
- data-testid = "trial"
102
- />
103
- </ div >
104
122
105
- < Box >
106
- < Typography variant = "h6" style = { { fontSize : 14 } } >
107
- Start a 30-day free trial of Enterprise
108
- </ Typography >
109
- < Typography variant = "caption" color = "textSecondary" >
110
- Get access to high availability, template RBAC, audit logging,
111
- quotas, and more.
112
- </ Typography >
113
- </ Box >
114
- </ Box >
115
- </ div >
123
+ < label
124
+ htmlFor = "trial"
125
+ css = { {
126
+ display : "flex" ,
127
+ cursor : "pointer" ,
128
+ alignItems : "flex-start" ,
129
+ gap : 4 ,
130
+ marginTop : - 4 ,
131
+ marginBottom : 8 ,
132
+ } }
133
+ >
134
+ < Checkbox
135
+ id = "trial"
136
+ name = "trial"
137
+ value = { form . values . trial }
138
+ onChange = { form . handleChange }
139
+ data-testid = "trial"
140
+ size = "small"
141
+ />
142
+
143
+ < div css = { { fontSize : 14 , paddingTop : 4 } } >
144
+ < span css = { { display : "block" , fontWeight : 600 } } >
145
+ Start a 30-day free trial of Enterprise
146
+ </ span >
147
+ < span
148
+ css = { ( theme ) => ( {
149
+ display : "block" ,
150
+ fontSize : 13 ,
151
+ color : theme . palette . text . secondary ,
152
+ lineHeight : "1.6" ,
153
+ } ) }
154
+ >
155
+ Get access to high availability, template RBAC, audit logging,
156
+ quotas, and more.
157
+ </ span >
158
+ < Link
159
+ href = { docs ( "/enterprise" ) }
160
+ target = "_blank"
161
+ css = { { marginTop : 4 , display : "inline-block" , fontSize : 13 } }
162
+ >
163
+ Read more
164
+ </ Link >
165
+ </ div >
166
+ </ label >
167
+
116
168
< LoadingButton
117
169
fullWidth
118
170
loading = { isLoading }
119
171
type = "submit"
120
172
data-testid = "create"
173
+ size = "large"
174
+ variant = "contained"
175
+ color = "primary"
121
176
>
122
177
{ Language . create }
123
178
</ LoadingButton >
124
- </ Stack >
125
- </ form >
179
+ </ FormFields >
180
+ </ VerticalForm >
126
181
</ SignInLayout >
127
182
) ;
128
183
} ;
0 commit comments