Skip to content

Commit ec5fbbc

Browse files
authored
Updated Login Error Callback page to mds (#3120)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
1 parent 7816405 commit ec5fbbc

File tree

1 file changed

+71
-108
lines changed

1 file changed

+71
-108
lines changed

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

Lines changed: 71 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -14,96 +14,51 @@
1414
// You should have received a copy of the GNU Affero General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
import React, { useEffect, useState } from "react"; // eslint-disable-line @typescript-eslint/no-unused-vars
17+
import React, { Fragment, useEffect, useState } from "react";
18+
import styled from "styled-components";
1819
import { useNavigate } from "react-router-dom";
1920
import api from "../../common/api";
20-
import withStyles from "@mui/styles/withStyles";
21-
import { Theme } from "@mui/material/styles";
22-
import createStyles from "@mui/styles/createStyles";
2321
import { baseUrl } from "../../history";
24-
import { Paper } from "@mui/material";
25-
import Grid from "@mui/material/Grid";
26-
import Typography from "@mui/material/Typography";
27-
import { Button, WarnIcon } from "mds";
22+
import { Box, Button, LoginWrapper, WarnIcon } from "mds";
23+
import { getLogoVar } from "../../config";
24+
import get from "lodash/get";
2825

29-
const styles = (theme: Theme) =>
30-
createStyles({
31-
paper: {
32-
borderRadius: 8,
33-
display: "flex",
34-
flexDirection: "column",
35-
alignItems: "center",
36-
width: 800,
37-
height: 424,
38-
margin: "auto",
39-
position: "absolute",
40-
top: "50%",
41-
left: "50%",
42-
marginLeft: -400,
43-
marginTop: -212,
44-
"&.MuiPaper-root": {
45-
borderRadius: 8,
46-
},
26+
const CallBackContainer = styled.div(({ theme }) => ({
27+
"& .errorDescription": {
28+
fontStyle: "italic",
29+
transition: "all .2s ease-in-out",
30+
padding: "0 15px",
31+
marginTop: 5,
32+
overflow: "auto",
33+
},
34+
"& .errorLabel": {
35+
color: get(theme, "fontColor", "#000"),
36+
fontSize: 18,
37+
fontWeight: "bold",
38+
marginLeft: 5,
39+
},
40+
"& .simpleError": {
41+
marginTop: 5,
42+
padding: "2px 5px",
43+
fontSize: 16,
44+
color: get(theme, "fontColor", "#000"),
45+
},
46+
"& .messageIcon": {
47+
color: get(theme, "signalColors.danger", "#C72C48"),
48+
display: "flex",
49+
"& svg": {
50+
width: 32,
51+
height: 32,
4752
},
48-
mainContainer: {
49-
position: "relative",
50-
height: 424,
51-
},
52-
theOcean: {
53-
borderTopLeftRadius: 8,
54-
borderBottomLeftRadius: 8,
55-
background:
56-
"transparent linear-gradient(to bottom, #073052 0%,#05122b 100%); 0% 0% no-repeat padding-box;",
57-
},
58-
oceanBg: {
59-
backgroundImage: "url(/images/BG_Illustration.svg)",
60-
backgroundRepeat: "no-repeat",
61-
backgroundPosition: "bottom left",
62-
height: "100%",
63-
width: 324,
64-
},
65-
theLogin: {
66-
padding: "40px 45px 20px 45px",
67-
},
68-
extraDetailsContainer: {
69-
fontStyle: "italic",
70-
color: "#9C9C9C",
71-
transition: "all .2s ease-in-out",
72-
padding: "0 5px",
73-
marginTop: 5,
74-
overflow: "auto",
75-
},
76-
errorLabel: {
77-
color: "#000",
78-
fontSize: 18,
79-
fontWeight: 500,
80-
marginLeft: 5,
81-
},
82-
simpleError: {
83-
marginTop: 5,
84-
padding: "2px 5px",
85-
fontSize: 16,
86-
color: "#000",
87-
},
88-
messageIcon: {
89-
color: "#C72C48",
90-
display: "flex",
91-
"& svg": {
92-
width: 32,
93-
height: 32,
94-
},
95-
},
96-
errorTitle: {
97-
display: "flex",
98-
alignItems: "center",
99-
},
100-
});
53+
},
54+
"& .errorTitle": {
55+
display: "flex",
56+
alignItems: "center",
57+
borderBottom: 15,
58+
},
59+
}));
10160

102-
interface ILoginCallBackProps {
103-
classes: any;
104-
}
105-
106-
const LoginCallback = ({ classes }: ILoginCallBackProps) => {
61+
const LoginCallback = () => {
10762
const navigate = useNavigate();
10863

10964
const [error, setError] = useState<string>("");
@@ -150,28 +105,19 @@ const LoginCallback = ({ classes }: ILoginCallBackProps) => {
150105
}
151106
}, [loading, navigate]);
152107
return error !== "" || errorDescription !== "" ? (
153-
<React.Fragment>
154-
<Paper className={classes.paper}>
155-
<Grid container className={classes.mainContainer}>
156-
<Grid item xs={7} className={classes.theOcean}>
157-
<div className={classes.oceanBg} />
158-
</Grid>
159-
<Grid item xs={5} className={classes.theLogin}>
160-
<div className={classes.errorTitle}>
161-
<span className={classes.messageIcon}>
108+
<Fragment>
109+
<LoginWrapper
110+
logoProps={{ applicationName: "console", subVariant: getLogoVar() }}
111+
form={
112+
<CallBackContainer>
113+
<div className={"errorTitle"}>
114+
<span className={"messageIcon"}>
162115
<WarnIcon />
163116
</span>
164-
<span className={classes.errorLabel}>Error from IDP</span>
117+
<span className={"errorLabel"}>Error from IDP</span>
165118
</div>
166-
<div className={classes.simpleError}>{error}</div>
167-
<Typography
168-
variant="body1"
169-
gutterBottom
170-
component="div"
171-
className={classes.extraDetailsContainer}
172-
>
173-
{errorDescription}
174-
</Typography>
119+
<div className={"simpleError"}>{error}</div>
120+
<Box className={"errorDescription"}>{errorDescription}</Box>
175121
<Button
176122
id={"back-to-login"}
177123
onClick={() => {
@@ -183,11 +129,28 @@ const LoginCallback = ({ classes }: ILoginCallBackProps) => {
183129
>
184130
Back to Login
185131
</Button>
186-
</Grid>
187-
</Grid>
188-
</Paper>
189-
</React.Fragment>
132+
</CallBackContainer>
133+
}
134+
promoHeader={
135+
<span style={{ fontSize: 28 }}>High-Performance Object Store</span>
136+
}
137+
promoInfo={
138+
<span style={{ fontSize: 14, lineHeight: 1 }}>
139+
MinIO is a cloud-native object store built to run on any
140+
infrastructure - public, private or edge clouds. Primary use cases
141+
include data lakes, databases, AI/ML, SaaS applications and fast
142+
backup & recovery. MinIO is dual licensed under GNU AGPL v3 and
143+
commercial license. To learn more, visit{" "}
144+
<a href={"https://min.io/?ref=con"} target="_blank" rel="noopener">
145+
www.min.io
146+
</a>
147+
.
148+
</span>
149+
}
150+
backgroundAnimation={false}
151+
/>
152+
</Fragment>
190153
) : null;
191154
};
192155

193-
export default withStyles(styles)(LoginCallback);
156+
export default LoginCallback;

0 commit comments

Comments
 (0)