14
14
// You should have received a copy of the GNU Affero General Public License
15
15
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
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" ;
18
19
import { useNavigate } from "react-router-dom" ;
19
20
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" ;
23
21
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" ;
28
25
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 ,
47
52
} ,
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
+ } ) ) ;
101
60
102
- interface ILoginCallBackProps {
103
- classes : any ;
104
- }
105
-
106
- const LoginCallback = ( { classes } : ILoginCallBackProps ) => {
61
+ const LoginCallback = ( ) => {
107
62
const navigate = useNavigate ( ) ;
108
63
109
64
const [ error , setError ] = useState < string > ( "" ) ;
@@ -150,28 +105,19 @@ const LoginCallback = ({ classes }: ILoginCallBackProps) => {
150
105
}
151
106
} , [ loading , navigate ] ) ;
152
107
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" } >
162
115
< WarnIcon />
163
116
</ span >
164
- < span className = { classes . errorLabel } > Error from IDP</ span >
117
+ < span className = { " errorLabel" } > Error from IDP</ span >
165
118
</ 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 >
175
121
< Button
176
122
id = { "back-to-login" }
177
123
onClick = { ( ) => {
@@ -183,11 +129,28 @@ const LoginCallback = ({ classes }: ILoginCallBackProps) => {
183
129
>
184
130
Back to Login
185
131
</ 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 >
190
153
) : null ;
191
154
} ;
192
155
193
- export default withStyles ( styles ) ( LoginCallback ) ;
156
+ export default LoginCallback ;
0 commit comments