1
1
import { makeStyles } from "@material-ui/core/styles"
2
- import { Logo } from "components/Icons/Logo"
3
2
import { FullScreenLoader } from "components/Loader/FullScreenLoader"
4
3
import { FC } from "react"
5
4
import { useLocation } from "react-router-dom"
6
5
import { AuthContext } from "xServices/auth/authXService"
7
6
import { LoginErrors , SignInForm } from "components/SignInForm/SignInForm"
8
7
import { retrieveRedirect } from "util/redirect"
9
- import { Pill } from "components/Pill/Pill"
10
- import { useTranslation } from "react-i18next"
11
- import IdeaIcon from "@material-ui/icons/EmojiObjects"
12
- import { colors } from "theme/colors"
8
+ import { CoderIcon } from "components/Icons/CoderIcon"
13
9
14
10
interface LocationState {
15
11
isRedirect : boolean
@@ -35,163 +31,59 @@ export const LoginPageView: FC<LoginPageViewProps> = ({
35
31
const { authError, getUserError, checkPermissionsError, getMethodsError } =
36
32
context
37
33
const styles = useStyles ( )
38
- const { t } = useTranslation ( "loginPage" )
39
34
40
35
return isLoading ? (
41
36
< FullScreenLoader />
42
37
) : (
43
- < div className = { styles . container } >
44
- < div className = { styles . left } >
45
- < Logo fill = "white" opacity = { 1 } width = { 110 } />
46
-
47
- < div className = { styles . formSection } >
48
- < SignInForm
49
- authMethods = { context . methods }
50
- redirectTo = { redirectTo }
51
- isLoading = { isLoading }
52
- loginErrors = { {
53
- [ LoginErrors . AUTH_ERROR ] : authError ,
54
- [ LoginErrors . GET_USER_ERROR ] : isRedirected ? getUserError : null ,
55
- [ LoginErrors . CHECK_PERMISSIONS_ERROR ] : checkPermissionsError ,
56
- [ LoginErrors . GET_METHODS_ERROR ] : getMethodsError ,
57
- } }
58
- onSubmit = { onSignIn }
59
- />
60
- </ div >
61
-
38
+ < div className = { styles . root } >
39
+ < div className = { styles . container } >
40
+ < CoderIcon fill = "white" opacity = { 1 } className = { styles . icon } />
41
+ < SignInForm
42
+ authMethods = { context . methods }
43
+ redirectTo = { redirectTo }
44
+ isLoading = { isLoading }
45
+ loginErrors = { {
46
+ [ LoginErrors . AUTH_ERROR ] : authError ,
47
+ [ LoginErrors . GET_USER_ERROR ] : isRedirected ? getUserError : null ,
48
+ [ LoginErrors . CHECK_PERMISSIONS_ERROR ] : checkPermissionsError ,
49
+ [ LoginErrors . GET_METHODS_ERROR ] : getMethodsError ,
50
+ } }
51
+ onSubmit = { onSignIn }
52
+ />
62
53
< footer className = { styles . footer } >
63
54
Copyright © 2022 Coder Technologies, Inc.
64
55
</ footer >
65
56
</ div >
66
-
67
- < div className = { styles . right } >
68
- < div className = { styles . tipWrapper } >
69
- < Pill
70
- icon = { < IdeaIcon className = { styles . pillIcon } /> }
71
- text = { t ( "tipCaption" ) }
72
- className = { styles . pill }
73
- type = "secondary"
74
- />
75
- < div className = { styles . tipContent } >
76
- < h2 className = { styles . tipTitle } > Scheduling</ h2 >
77
- < p >
78
- Coder automates your cloud cost control by ensuring developer
79
- resources are only online while used.
80
- </ p >
81
- < img
82
- src = "/featured/scheduling.webp"
83
- alt = ""
84
- className = { styles . tipImage }
85
- />
86
- </ div >
87
- </ div >
88
- </ div >
89
57
</ div >
90
58
)
91
59
}
92
60
93
61
const useStyles = makeStyles ( ( theme ) => ( {
94
- container : {
95
- padding : theme . spacing ( 5 ) ,
96
- margin : "auto" ,
97
- display : "flex" ,
98
- height : "100vh" ,
99
-
100
- [ theme . breakpoints . down ( "md" ) ] : {
101
- height : "auto" ,
102
- minHeight : "100vh" ,
103
- } ,
104
-
105
- [ theme . breakpoints . down ( "sm" ) ] : {
106
- padding : theme . spacing ( 4 ) ,
107
- } ,
108
- } ,
109
-
110
- left : {
111
- flex : 1 ,
112
- display : "flex" ,
113
- flexDirection : "column" ,
114
- gap : theme . spacing ( 4 ) ,
115
- } ,
116
-
117
- right : {
118
- flex : 1 ,
119
-
120
- [ theme . breakpoints . down ( "md" ) ] : {
121
- display : "none" ,
122
- } ,
123
- } ,
124
-
125
- formSection : {
126
- flex : 1 ,
62
+ root : {
63
+ padding : theme . spacing ( 3 ) ,
127
64
display : "flex" ,
128
65
alignItems : "center" ,
129
66
justifyContent : "center" ,
67
+ minHeight : "100vh" ,
68
+ textAlign : "center" ,
130
69
} ,
131
70
132
- footer : {
133
- fontSize : 12 ,
134
- color : theme . palette . text . secondary ,
135
- } ,
136
-
137
- tipWrapper : {
71
+ container : {
138
72
width : "100%" ,
139
- height : "100%" ,
140
- borderRadius : theme . shape . borderRadius ,
141
- background : theme . palette . background . paper ,
142
- padding : theme . spacing ( 5 ) ,
73
+ maxWidth : 385 ,
143
74
display : "flex" ,
144
- justifyContent : "center " ,
75
+ flexDirection : "column " ,
145
76
alignItems : "center" ,
146
- position : "relative" ,
147
- } ,
148
-
149
- pill : {
150
- position : "absolute" ,
151
- top : theme . spacing ( 3 ) ,
152
- right : theme . spacing ( 3 ) ,
153
- fontWeight : 600 ,
154
- fontSize : 10 ,
155
- letterSpacing : "0.1em" ,
156
- textTransform : "uppercase" ,
157
- background : theme . palette . divider ,
158
- border : 0 ,
159
- padding : theme . spacing ( 0 , 1.5 ) ,
160
- height : theme . spacing ( 3.5 ) ,
77
+ gap : theme . spacing ( 2 ) ,
161
78
} ,
162
79
163
- pillIcon : {
164
- color : colors . yellow [ 5 ] ,
80
+ icon : {
81
+ fontSize : theme . spacing ( 8 ) ,
165
82
} ,
166
83
167
- tipContent : {
168
- maxWidth : 570 ,
169
- textAlign : "center" ,
170
- fontSize : 16 ,
84
+ footer : {
85
+ fontSize : 12 ,
171
86
color : theme . palette . text . secondary ,
172
- lineHeight : "160%" ,
173
-
174
- "& p" : {
175
- maxWidth : 440 ,
176
- margin : "auto" ,
177
- } ,
178
-
179
- "& strong" : {
180
- color : theme . palette . text . primary ,
181
- } ,
182
- } ,
183
-
184
- tipTitle : {
185
- fontWeight : 400 ,
186
- fontSize : 24 ,
187
- margin : 0 ,
188
- lineHeight : 1 ,
189
- marginBottom : theme . spacing ( 2 ) ,
190
- color : theme . palette . text . primary ,
191
- } ,
192
-
193
- tipImage : {
194
- maxWidth : 570 ,
195
- marginTop : theme . spacing ( 4 ) ,
87
+ marginTop : theme . spacing ( 3 ) ,
196
88
} ,
197
89
} ) )
0 commit comments