16
16
17
17
import React , { Fragment , useEffect } from "react" ;
18
18
import { useNavigate } from "react-router-dom" ;
19
- import { Button , Loader , LoginWrapper , RefreshIcon } from "mds" ;
20
- import { Theme } from "@mui/material/styles" ;
21
- import createStyles from "@mui/styles/createStyles" ;
22
- import makeStyles from "@mui/styles/makeStyles" ;
19
+ import { Box , Button , Loader , LoginWrapper , RefreshIcon } from "mds" ;
23
20
import { loginStrategyType , redirectRule } from "./types" ;
24
21
import MainError from "../Console/Common/MainError/MainError" ;
25
- import { spacingUtils } from "../Console/Common/FormComponents/common/styleLibrary" ;
26
22
import { AppState , useAppDispatch } from "../../store" ;
27
23
import { useSelector } from "react-redux" ;
28
24
import { getFetchConfigurationAsync , getVersionAsync } from "./loginThunks" ;
@@ -31,205 +27,6 @@ import StrategyForm from "./StrategyForm";
31
27
import { redirectRules } from "../../utils/sortFunctions" ;
32
28
import { getLogoVar } from "../../config" ;
33
29
34
- const useStyles = makeStyles ( ( theme : Theme ) =>
35
- createStyles ( {
36
- root : {
37
- position : "absolute" ,
38
- top : 0 ,
39
- left : 0 ,
40
- width : "100%" ,
41
- height : "100%" ,
42
- overflow : "auto" ,
43
- } ,
44
- form : {
45
- width : "100%" , // Fix IE 11 issue.
46
- } ,
47
- submit : {
48
- margin : "30px 0px 8px" ,
49
- height : 40 ,
50
- width : "100%" ,
51
- boxShadow : "none" ,
52
- padding : "16px 30px" ,
53
- } ,
54
- loginSsoText : {
55
- fontWeight : "700" ,
56
- marginBottom : "15px" ,
57
- } ,
58
- ssoSelect : {
59
- width : "100%" ,
60
- fontSize : "13px" ,
61
- fontWeight : "700" ,
62
- color : "grey" ,
63
- } ,
64
- ssoMenuItem : {
65
- fontSize : "15px" ,
66
- fontWeight : "700" ,
67
- color : theme . palette . primary . light ,
68
- "&.MuiMenuItem-divider:last-of-type" : {
69
- borderBottom : "none" ,
70
- } ,
71
- "&.Mui-focusVisible" : {
72
- backgroundColor : theme . palette . grey [ "100" ] ,
73
- } ,
74
- } ,
75
- ssoLoginIcon : {
76
- height : "13px" ,
77
- marginRight : "25px" ,
78
- } ,
79
- ssoSubmit : {
80
- marginTop : "15px" ,
81
- "&:first-of-type" : {
82
- marginTop : 0 ,
83
- } ,
84
- } ,
85
- separator : {
86
- marginLeft : 4 ,
87
- marginRight : 4 ,
88
- } ,
89
- linkHolder : {
90
- marginTop : 20 ,
91
- font : "normal normal normal 14px/16px Inter" ,
92
- } ,
93
- miniLinks : {
94
- margin : "auto" ,
95
- textAlign : "center" ,
96
- color : "#B2DEF5" ,
97
- "& a" : {
98
- color : "#B2DEF5" ,
99
- textDecoration : "none" ,
100
- } ,
101
- "& .min-icon" : {
102
- width : 10 ,
103
- color : "#B2DEF5" ,
104
- } ,
105
- } ,
106
- miniLogo : {
107
- marginTop : 8 ,
108
- "& .min-icon" : {
109
- height : 12 ,
110
- paddingTop : 2 ,
111
- marginRight : 2 ,
112
- } ,
113
- } ,
114
- loginPage : {
115
- height : "100%" ,
116
- margin : "auto" ,
117
- } ,
118
- buttonRetry : {
119
- display : "flex" ,
120
- justifyContent : "center" ,
121
- } ,
122
- loginContainer : {
123
- flexDirection : "column" ,
124
- maxWidth : 400 ,
125
- margin : "auto" ,
126
- "& .right-items" : {
127
- backgroundColor : "white" ,
128
- padding : 40 ,
129
- } ,
130
- "& .consoleTextBanner" : {
131
- fontWeight : 300 ,
132
- fontSize : "calc(3vw + 3vh + 1.5vmin)" ,
133
- lineHeight : 1.15 ,
134
- color : theme . palette . primary . main ,
135
- flex : 1 ,
136
- height : "100%" ,
137
- display : "flex" ,
138
- justifyContent : "flex-start" ,
139
- margin : "auto" ,
140
-
141
- "& .logoLine" : {
142
- display : "flex" ,
143
- alignItems : "center" ,
144
- fontSize : 18 ,
145
- } ,
146
- "& .left-items" : {
147
- marginTop : 100 ,
148
- background :
149
- "transparent linear-gradient(180deg, #FBFAFA 0%, #E4E4E4 100%) 0% 0% no-repeat padding-box" ,
150
- padding : 40 ,
151
- } ,
152
- "& .left-logo" : {
153
- "& .min-icon" : {
154
- color : theme . palette . primary . main ,
155
- width : 108 ,
156
- } ,
157
- marginBottom : 10 ,
158
- } ,
159
- "& .text-line1" : {
160
- font : " 100 44px 'Inter'" ,
161
- } ,
162
- "& .text-line2" : {
163
- fontSize : 80 ,
164
- fontWeight : 100 ,
165
- textTransform : "uppercase" ,
166
- } ,
167
- "& .text-line3" : {
168
- fontSize : 14 ,
169
- fontWeight : "bold" ,
170
- } ,
171
- "& .logo-console" : {
172
- display : "flex" ,
173
- alignItems : "center" ,
174
-
175
- "@media (max-width: 900px)" : {
176
- marginTop : 20 ,
177
- flexFlow : "column" ,
178
-
179
- "& svg" : {
180
- width : "50%" ,
181
- } ,
182
- } ,
183
- } ,
184
- } ,
185
- } ,
186
- "@media (max-width: 900px)" : {
187
- loginContainer : {
188
- display : "flex" ,
189
- flexFlow : "column" ,
190
-
191
- "& .consoleTextBanner" : {
192
- margin : 0 ,
193
- flex : 2 ,
194
-
195
- "& .left-items" : {
196
- alignItems : "center" ,
197
- textAlign : "center" ,
198
- } ,
199
-
200
- "& .logoLine" : {
201
- justifyContent : "center" ,
202
- } ,
203
- } ,
204
- } ,
205
- } ,
206
- loginStrategyMessage : {
207
- textAlign : "center" ,
208
- } ,
209
- loadingLoginStrategy : {
210
- textAlign : "center" ,
211
- width : 40 ,
212
- height : 40 ,
213
- } ,
214
- submitContainer : {
215
- textAlign : "right" ,
216
- marginTop : 30 ,
217
- } ,
218
- linearPredef : {
219
- height : 10 ,
220
- } ,
221
- retryButton : {
222
- alignSelf : "flex-end" ,
223
- } ,
224
- iconLogo : {
225
- "& .min-icon" : {
226
- width : "100%" ,
227
- } ,
228
- } ,
229
- ...spacingUtils ,
230
- } )
231
- ) ;
232
-
233
30
export interface LoginStrategyPayload {
234
31
accessKey : string ;
235
32
secretKey : string ;
@@ -251,7 +48,6 @@ export const getTargetPath = () => {
251
48
const Login = ( ) => {
252
49
const dispatch = useAppDispatch ( ) ;
253
50
const navigate = useNavigate ( ) ;
254
- const classes = useStyles ( ) ;
255
51
256
52
const loginStrategy = useSelector (
257
53
( state : AppState ) => state . login . loginStrategy
@@ -308,19 +104,32 @@ const Login = () => {
308
104
}
309
105
default :
310
106
loginComponent = (
311
- < div style = { { textAlign : "center" } } >
107
+ < Box
108
+ sx = { {
109
+ textAlign : "center" ,
110
+ "& .loadingLoginStrategy" : {
111
+ textAlign : "center" ,
112
+ width : 40 ,
113
+ height : 40 ,
114
+ } ,
115
+ "& .buttonRetry" : {
116
+ display : "flex" ,
117
+ justifyContent : "center" ,
118
+ } ,
119
+ } }
120
+ >
312
121
{ loadingFetchConfiguration ? (
313
- < Loader className = { classes . loadingLoginStrategy } />
122
+ < Loader className = { " loadingLoginStrategy" } />
314
123
) : (
315
124
< Fragment >
316
- < div >
317
- < p style = { { color : "#000" , textAlign : "center" } } >
125
+ < Box >
126
+ < p style = { { textAlign : "center" } } >
318
127
An error has occurred
319
128
< br />
320
129
The backend cannot be reached.
321
130
</ p >
322
- </ div >
323
- < div className = { classes . buttonRetry } >
131
+ </ Box >
132
+ < div className = { " buttonRetry" } >
324
133
< Button
325
134
onClick = { ( ) => {
326
135
dispatch ( getFetchConfigurationAsync ( ) ) ;
@@ -334,7 +143,7 @@ const Login = () => {
334
143
</ div >
335
144
</ Fragment >
336
145
) }
337
- </ div >
146
+ </ Box >
338
147
) ;
339
148
}
340
149
@@ -351,35 +160,42 @@ const Login = () => {
351
160
logoProps = { { applicationName : "console" , subVariant : getLogoVar ( ) } }
352
161
form = { loginComponent }
353
162
formFooter = {
354
- < Fragment >
163
+ < Box
164
+ sx = { {
165
+ "& .separator" : {
166
+ marginLeft : 4 ,
167
+ marginRight : 4 ,
168
+ } ,
169
+ } }
170
+ >
355
171
< a href = { docsURL } target = "_blank" rel = "noopener" >
356
172
Documentation
357
173
</ a >
358
- < span className = { classes . separator } > |</ span >
174
+ < span className = { " separator" } > |</ span >
359
175
< a
360
176
href = "https://github.com/minio/minio"
361
177
target = "_blank"
362
178
rel = "noopener"
363
179
>
364
180
GitHub
365
181
</ a >
366
- < span className = { classes . separator } > |</ span >
182
+ < span className = { " separator" } > |</ span >
367
183
< a
368
184
href = "https://subnet.min.io/?ref=con"
369
185
target = "_blank"
370
186
rel = "noopener"
371
187
>
372
188
Support
373
189
</ a >
374
- < span className = { classes . separator } > |</ span >
190
+ < span className = { " separator" } > |</ span >
375
191
< a
376
192
href = "https://min.io/download/?ref=con"
377
193
target = "_blank"
378
194
rel = "noopener"
379
195
>
380
196
Download
381
197
</ a >
382
- </ Fragment >
198
+ </ Box >
383
199
}
384
200
promoHeader = {
385
201
< span style = { { fontSize : 28 } } > High-Performance Object Store</ span >
0 commit comments