Skip to content

Commit 9c3e8f5

Browse files
authored
Login UX update (#1328)
1 parent 21158e6 commit 9c3e8f5

File tree

3 files changed

+112
-46
lines changed

3 files changed

+112
-46
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// This file is part of MinIO Console Server
2+
// Copyright (c) 2021 MinIO, Inc.
3+
//
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU Affero General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU Affero General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU Affero General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
17+
import * as React from "react";
18+
import { SVGProps } from "react";
19+
20+
const LoginMinIOLogo = (props: SVGProps<SVGSVGElement>) => (
21+
<svg
22+
xmlns="http://www.w3.org/2000/svg"
23+
width="284.616"
24+
height="49.568"
25+
viewBox="0 0 284.616 49.568"
26+
{...props}
27+
>
28+
<g transform="translate(0.5 0.5)">
29+
<path
30+
d="M10822.423,3589.089c0-14.873,14.033-24.285,33.612-24.285s33.7,9.328,33.7,24.285-13.782,24.282-33.7,24.282C10836.374,3613.371,10822.423,3604.046,10822.423,3589.089Zm7.731,0c0,11.763,11.263,18.065,25.881,18.065s25.966-6.3,25.966-18.065c0-11.681-11.345-18.068-25.966-18.068S10830.154,3577.408,10830.154,3589.089Zm-43.43,23.094-41.918-22.23a1.586,1.586,0,0,0-2.329,1.4v21.011H10726.5v-42.123a4.421,4.421,0,0,1,4.42-4.422h.029a4.4,4.4,0,0,1,2.077.519l41.752,22.233a1.587,1.587,0,0,0,2.334-1.4v-21.35h16.11v42.454a4.42,4.42,0,0,1-6.493,3.905Zm-88.75.186v-46.534h15.884v46.534Zm-28.218,0v-20.147a1.588,1.588,0,0,0-2.392-1.367l-19.068,11.186a5.668,5.668,0,0,1-5.818-.055l-18.07-11.057a1.589,1.589,0,0,0-2.416,1.355v20.084h-15.876v-42.323a4.423,4.423,0,0,1,4.423-4.422h.038a4.453,4.453,0,0,1,2.3.648l32.246,19.694a1.429,1.429,0,0,0,1.5,0l32.243-19.694a4.453,4.453,0,0,1,2.3-.648h.041a4.421,4.421,0,0,1,4.42,4.422v42.323Zm136.353-.011v-46.534h7.39v46.534Z"
31+
transform="translate(-10606.116 -3564.803)"
32+
fill="#fff"
33+
stroke="rgba(0,0,0,0)"
34+
strokeWidth="1"
35+
/>
36+
</g>
37+
</svg>
38+
);
39+
40+
export default LoginMinIOLogo;

portal-ui/src/icons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,4 @@ export { default as VersionIcon } from "./VersionIcon";
118118
export { default as WarnIcon } from "./WarnIcon";
119119
export { default as WarpIcon } from "./WarpIcon";
120120
export { default as WatchIcon } from "./WatchIcon";
121+
export { default as LoginMinIOLogo } from "./LoginMinIOLogo";

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

Lines changed: 71 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import React, { useEffect, useState } from "react";
1818
import { connect } from "react-redux";
19-
import { OutlinedInputProps } from "@mui/material/OutlinedInput";
2019
import {
2120
CircularProgress,
2221
InputAdornment,
@@ -31,7 +30,6 @@ import withStyles from "@mui/styles/withStyles";
3130
import Button from "@mui/material/Button";
3231
import TextField from "@mui/material/TextField";
3332
import Grid from "@mui/material/Grid";
34-
import Typography from "@mui/material/Typography";
3533
import { ILoginDetails, loginStrategyType } from "./types";
3634
import { SystemState } from "../../types";
3735
import { setErrorSnackMessage, userLoggedIn } from "../../actions";
@@ -41,7 +39,8 @@ import history from "../../history";
4139
import RefreshIcon from "../../icons/RefreshIcon";
4240
import MainError from "../Console/Common/MainError/MainError";
4341
import { encodeFileName } from "../../common/utils";
44-
import { LockIcon, UsersIcon, VersionIcon } from "../../icons";
42+
import { LockIcon, UsersIcon, LoginMinIOLogo } from "../../icons";
43+
import { spacingUtils } from "../Console/Common/FormComponents/common/styleLibrary";
4544

4645
const styles = (theme: Theme) =>
4746
createStyles({
@@ -67,7 +66,7 @@ const styles = (theme: Theme) =>
6766
},
6867
},
6968
shadowBox: {
70-
boxShadow: "0px 3px 10px #00000014",
69+
boxShadow: "0px 3px 20px #00000014",
7170
height: "100%",
7271
},
7372
loginContainer: {
@@ -113,6 +112,36 @@ const styles = (theme: Theme) =>
113112
margin: "auto",
114113
textAlign: "left",
115114
},
115+
"& .text-line1": {
116+
font: "normal 100 70px 'Lato'",
117+
marginBottom: 20,
118+
"@media (max-width: 600px)": {
119+
fontSize: 35,
120+
},
121+
},
122+
"& .text-line2": {
123+
fontSize: 70,
124+
marginLeft: 25,
125+
fontWeight: 400,
126+
127+
"@media (max-width: 600px)": {
128+
fontSize: 35,
129+
marginLeft: 0,
130+
},
131+
},
132+
"& .logo-console": {
133+
display: "flex",
134+
alignItems: "center",
135+
136+
"@media (max-width: 900px)": {
137+
marginTop: 20,
138+
flexFlow: "column",
139+
140+
"& svg": {
141+
width: "50%",
142+
},
143+
},
144+
},
116145
},
117146
},
118147
"@media (max-width: 900px)": {
@@ -135,19 +164,6 @@ const styles = (theme: Theme) =>
135164
},
136165
},
137166
},
138-
inputField: {
139-
"& input": {
140-
padding: 5,
141-
"&::placeholder": {
142-
fontSize: 12,
143-
},
144-
"@media (max-width: 900px)": {
145-
padding: 10,
146-
},
147-
},
148-
"& svg": { height: 16 },
149-
},
150-
151167
loadingLoginStrategy: {
152168
textAlign: "center",
153169
},
@@ -158,9 +174,6 @@ const styles = (theme: Theme) =>
158174
submitContainer: {
159175
textAlign: "right",
160176
},
161-
jwtInput: {
162-
marginTop: 45,
163-
},
164177
linearPredef: {
165178
height: 10,
166179
},
@@ -176,14 +189,38 @@ const styles = (theme: Theme) =>
176189
retryButton: {
177190
alignSelf: "flex-end",
178191
},
192+
...spacingUtils,
179193
});
180194

181195
const inputStyles = makeStyles((theme: Theme) =>
182196
createStyles({
183-
disabled: {
184-
"&.MuiInput-underline::before": {
185-
borderColor: "#eaeaea",
186-
borderBottomStyle: "solid",
197+
root: {
198+
"& .MuiOutlinedInput-root": {
199+
paddingLeft: 0,
200+
"& svg": { height: 16 },
201+
"& input": {
202+
padding: 5,
203+
paddingLeft: 0,
204+
"&::placeholder": {
205+
fontSize: 12,
206+
},
207+
"@media (max-width: 900px)": {
208+
padding: 10,
209+
},
210+
},
211+
"& fieldset": {
212+
border: "none", // default
213+
borderBottom: "1px solid #EAEAEA",
214+
borderRadius: 0,
215+
},
216+
"&.Mui-focused fieldset": {
217+
borderBottom: "1px solid #000000",
218+
borderRadius: 0,
219+
},
220+
"& fieldset:hover": {
221+
borderBottom: "2px solid #000000",
222+
borderRadius: 0,
223+
},
187224
},
188225
},
189226
})
@@ -194,7 +231,9 @@ function LoginField(props: TextFieldProps) {
194231

195232
return (
196233
<TextField
197-
InputProps={{ classes } as Partial<OutlinedInputProps>}
234+
classes={{
235+
root: classes.root,
236+
}}
198237
variant="standard"
199238
{...props}
200239
/>
@@ -305,16 +344,9 @@ const Login = ({
305344
case loginStrategyType.form: {
306345
loginComponent = (
307346
<React.Fragment>
308-
<Typography
309-
component="h1"
310-
variant="h6"
311-
className={classes.headerTitle}
312-
>
313-
Console Login
314-
</Typography>
315347
<form className={classes.form} noValidate onSubmit={formSubmit}>
316348
<Grid container spacing={2}>
317-
<Grid item xs={12}>
349+
<Grid item xs={12} className={classes.spacerBottom}>
318350
<LoginField
319351
fullWidth
320352
id="accessKey"
@@ -323,7 +355,7 @@ const Login = ({
323355
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
324356
setAccessKey(e.target.value)
325357
}
326-
placeholder={"Enter Username"}
358+
placeholder={"Username"}
327359
name="accessKey"
328360
autoComplete="username"
329361
disabled={loginSending}
@@ -350,7 +382,7 @@ const Login = ({
350382
id="secretKey"
351383
autoComplete="current-password"
352384
disabled={loginSending}
353-
placeholder={"Enter Password"}
385+
placeholder={"Password"}
354386
variant={"outlined"}
355387
InputProps={{
356388
startAdornment: (
@@ -401,16 +433,9 @@ const Login = ({
401433
case loginStrategyType.serviceAccount: {
402434
loginComponent = (
403435
<React.Fragment>
404-
<Typography
405-
component="h1"
406-
variant="h6"
407-
className={classes.headerTitle}
408-
>
409-
Operator Login
410-
</Typography>
411436
<form className={classes.form} noValidate onSubmit={formSubmit}>
412437
<Grid container spacing={2}>
413-
<Grid item xs={12} className={classes.jwtInput}>
438+
<Grid item xs={12}>
414439
<LoginField
415440
required
416441
className={classes.inputField}
@@ -497,9 +522,9 @@ const Login = ({
497522
<Grid item className="consoleTextBanner">
498523
<div className="left-items">
499524
<div className="text-line1">Welcome to</div>
500-
<div className="text-line2">{consoleText}</div>
501-
<div className="logoLine">
502-
<VersionIcon /> MinIO {consoleText}
525+
<div className="logo-console">
526+
<LoginMinIOLogo />
527+
<div className="text-line2">{consoleText}</div>
503528
</div>
504529
</div>
505530
</Grid>

0 commit comments

Comments
 (0)