Skip to content

Commit 06b0859

Browse files
authored
Login page UX (#1248)
1 parent 6b3ff10 commit 06b0859

File tree

3 files changed

+163
-58
lines changed

3 files changed

+163
-58
lines changed

portal-ui/src/index.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ declare module "@mui/styles/defaultTheme" {
4141
const GlobalCss = withStyles({
4242
// @global is handled by jss-plugin-global.
4343
"@global": {
44+
body: {
45+
height: "100vh",
46+
width: "100vw",
47+
},
48+
"#root": {
49+
height: "100%",
50+
width: "100%",
51+
display: "flex",
52+
flexFlow: "column",
53+
alignItems: "stretch",
54+
},
4455
".min-icon": {
4556
// height: 26,
4657
width: 26,

portal-ui/src/screens/Console/Console.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ const ConfigurationOptions = React.lazy(
106106

107107
const styles = (theme: Theme) =>
108108
createStyles({
109+
"@global": {
110+
body: {
111+
backgroundColor: "#FFFFFF",
112+
},
113+
},
109114
root: {
110115
display: "flex",
111116
"& .MuiPaper-root.MuiSnackbarContent-root": {

portal-ui/src/screens/LoginPage/LoginPage.tsx

Lines changed: 147 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { connect } from "react-redux";
1919
import { OutlinedInputProps } from "@mui/material/OutlinedInput";
2020
import {
2121
CircularProgress,
22+
InputAdornment,
2223
LinearProgress,
2324
Paper,
2425
TextFieldProps,
@@ -40,31 +41,10 @@ import history from "../../history";
4041
import RefreshIcon from "../../icons/RefreshIcon";
4142
import MainError from "../Console/Common/MainError/MainError";
4243
import { encodeFileName } from "../../common/utils";
44+
import { LockIcon, UsersIcon, VersionIcon } from "../../icons";
4345

4446
const styles = (theme: Theme) =>
4547
createStyles({
46-
"@global": {
47-
body: {
48-
backgroundColor: "#FAFAFA",
49-
},
50-
},
51-
paper: {
52-
borderRadius: 8,
53-
display: "flex",
54-
flexDirection: "column",
55-
alignItems: "center",
56-
width: 800,
57-
height: 424,
58-
margin: "auto",
59-
position: "absolute",
60-
top: "50%",
61-
left: "50%",
62-
marginLeft: -400,
63-
marginTop: -212,
64-
"&.MuiPaper-root": {
65-
borderRadius: 8,
66-
},
67-
},
6848
avatar: {
6949
margin: theme.spacing(1),
7050
backgroundColor: theme.palette.secondary.main,
@@ -86,42 +66,117 @@ const styles = (theme: Theme) =>
8666
justifyContent: "center",
8767
alignItems: "center",
8868
position: "absolute",
69+
zIndex: 9,
8970
left: "50%",
9071
top: "50%",
91-
marginLeft: -400,
92-
marginTop: -290,
72+
9373
color: "#fff",
9474
fontWeight: 700,
9575
fontSize: 14,
9676
borderRadius: 8,
9777
padding: 10,
9878
boxSizing: "border-box",
9979
},
100-
mainContainer: {
80+
loginPage: {
81+
height: "100%",
82+
display: "flex",
83+
flexFlow: "column",
84+
alignItems: "stretch",
10185
position: "relative",
102-
height: 424,
86+
padding: 84,
87+
88+
"@media (max-width: 900px)": {
89+
padding: 0,
90+
},
10391
},
104-
theOcean: {
105-
borderTopLeftRadius: 8,
106-
borderBottomLeftRadius: 8,
107-
background:
108-
"transparent linear-gradient(to bottom, #073052 0%,#05122b 100%); 0% 0% no-repeat padding-box;",
92+
shadowBox: {
93+
boxShadow: "0px 3px 10px #00000014",
94+
height: "100%",
10995
},
110-
oceanBg: {
111-
backgroundImage: "url(/images/BG_Illustration.svg)",
112-
backgroundRepeat: "no-repeat",
113-
backgroundPosition: "bottom left",
96+
loginContainer: {
97+
flex: 1,
11498
height: "100%",
115-
width: 324,
99+
100+
"& .right-items": {
101+
padding: 50,
102+
flex: 1,
103+
height: "100%",
104+
display: "flex",
105+
flexFlow: "column",
106+
alignItems: "center",
107+
justifyContent: "center",
108+
maxWidth: "33%",
109+
110+
"@media (max-width: 900px)": {
111+
maxWidth: "100%",
112+
margin: "auto",
113+
},
114+
},
115+
"& .consoleTextBanner": {
116+
fontWeight: 300,
117+
fontSize: "calc(3vw + 3vh + 1.5vmin)",
118+
lineHeight: 1.15,
119+
color: "#ffffff",
120+
flex: 1,
121+
textAlign: "center",
122+
height: "100%",
123+
display: "flex",
124+
justifyContent: "flex-start",
125+
margin: "auto",
126+
flexFlow: "column",
127+
background: "linear-gradient(120deg,#081c42,#073052)",
128+
129+
"& .logoLine": {
130+
display: "flex",
131+
alignItems: "center",
132+
fontSize: 18,
133+
marginTop: 40,
134+
},
135+
"& .left-items": {
136+
margin: "auto",
137+
textAlign: "left",
138+
},
139+
},
116140
},
117-
theLogin: {
118-
padding: "40px 45px 20px 45px",
141+
"@media (max-width: 900px)": {
142+
loginContainer: {
143+
display: "flex",
144+
flexFlow: "column",
145+
146+
"& .consoleTextBanner": {
147+
margin: 0,
148+
flex: 2,
149+
150+
"& .left-items": {
151+
alignItems: "center",
152+
textAlign: "center",
153+
},
154+
155+
"& .logoLine": {
156+
justifyContent: "center",
157+
},
158+
},
159+
},
160+
},
161+
inputField: {
162+
"& input": {
163+
padding: 5,
164+
"&::placeholder": {
165+
fontSize: 12,
166+
},
167+
"@media (max-width: 900px)": {
168+
padding: 10,
169+
},
170+
},
171+
"& svg": { height: 16 },
119172
},
173+
120174
loadingLoginStrategy: {
121175
textAlign: "center",
122176
},
123177
headerTitle: {
124-
marginBottom: 10,
178+
marginRight: "auto",
179+
marginBottom: 15,
125180
},
126181
submitContainer: {
127182
textAlign: "right",
@@ -292,29 +347,47 @@ const Login = ({
292347
<LoginField
293348
fullWidth
294349
id="accessKey"
350+
className={classes.inputField}
295351
value={accessKey}
296352
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
297353
setAccessKey(e.target.value)
298354
}
299-
label="Enter Username"
355+
placeholder={"Enter Username"}
300356
name="accessKey"
301357
autoComplete="username"
302358
disabled={loginSending}
359+
variant={"outlined"}
360+
InputProps={{
361+
startAdornment: (
362+
<InputAdornment position="start">
363+
<UsersIcon />
364+
</InputAdornment>
365+
),
366+
}}
303367
/>
304368
</Grid>
305369
<Grid item xs={12}>
306370
<LoginField
307371
fullWidth
372+
className={classes.inputField}
308373
value={secretKey}
309374
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
310375
setSecretKey(e.target.value)
311376
}
312377
name="secretKey"
313-
label="Enter Password"
314378
type="password"
315379
id="secretKey"
316380
autoComplete="current-password"
317381
disabled={loginSending}
382+
placeholder={"Enter Password"}
383+
variant={"outlined"}
384+
InputProps={{
385+
startAdornment: (
386+
<InputAdornment position="start">
387+
<LockIcon />
388+
</InputAdornment>
389+
),
390+
}}
318391
/>
319392
</Grid>
320393
</Grid>
@@ -340,13 +413,6 @@ const Login = ({
340413
case loginStrategyType.redirect: {
341414
loginComponent = (
342415
<React.Fragment>
343-
<Typography
344-
component="h1"
345-
variant="h6"
346-
className={classes.headerTitle}
347-
>
348-
Welcome
349-
</Typography>
350416
<Button
351417
component={"a"}
352418
href={loginStrategy.redirect}
@@ -376,16 +442,25 @@ const Login = ({
376442
<Grid item xs={12} className={classes.jwtInput}>
377443
<LoginField
378444
required
445+
className={classes.inputField}
379446
fullWidth
380447
id="jwt"
381448
value={jwt}
382449
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
383450
setJwt(e.target.value)
384451
}
385-
label="JWT"
386452
name="jwt"
387453
autoComplete="off"
388454
disabled={loginSending}
455+
placeholder={"Enter JWT"}
456+
variant={"outlined"}
457+
InputProps={{
458+
startAdornment: (
459+
<InputAdornment position="start">
460+
<LockIcon />
461+
</InputAdornment>
462+
),
463+
}}
389464
/>
390465
</Grid>
391466
</Grid>
@@ -425,6 +500,7 @@ const Login = ({
425500
}}
426501
endIcon={<RefreshIcon />}
427502
color={"primary"}
503+
variant="outlined"
428504
className={classes.retryButton}
429505
>
430506
Retry
@@ -436,18 +512,31 @@ const Login = ({
436512
);
437513
}
438514

515+
const consoleText =
516+
loginStrategy.loginStrategy === loginStrategyType.serviceAccount
517+
? "Operator"
518+
: "Console";
519+
439520
return (
440521
<React.Fragment>
441-
<Paper className={classes.paper}>
442-
<MainError customStyle={{ marginTop: -140 }} />
443-
<Grid container className={classes.mainContainer}>
444-
<Grid item xs={7} className={classes.theOcean}>
445-
<div className={classes.oceanBg} />
446-
</Grid>
447-
<Grid item xs={5} className={classes.theLogin}>
448-
{loginComponent}
522+
<Paper className={classes.loginPage}>
523+
<MainError />
524+
<div className={classes.shadowBox}>
525+
<Grid container className={classes.loginContainer}>
526+
<Grid item className="consoleTextBanner">
527+
<div className="left-items">
528+
<div className="text-line1">Welcome to</div>
529+
<div className="text-line2">{consoleText}</div>
530+
<div className="logoLine">
531+
<VersionIcon /> MinIO {consoleText}
532+
</div>
533+
</div>
534+
</Grid>
535+
<Grid item className="right-items">
536+
{loginComponent}
537+
</Grid>
449538
</Grid>
450-
</Grid>
539+
</div>
451540
</Paper>
452541
</React.Fragment>
453542
);

0 commit comments

Comments
 (0)