1
- import { makeStyles } from "@mui/styles " ;
2
- import { FC } from "react" ;
1
+ import { type Interpolation , type Theme } from "@emotion/react " ;
2
+ import { type FC } from "react" ;
3
3
import { useLocation } from "react-router-dom" ;
4
4
import { SignInForm } from "./SignInForm" ;
5
5
import { retrieveRedirect } from "utils/redirect" ;
6
6
import { CoderIcon } from "components/Icons/CoderIcon" ;
7
7
import { getApplicationName , getLogoURL } from "utils/appearance" ;
8
- import { AuthMethods } from "api/typesGenerated" ;
8
+ import type { AuthMethods } from "api/typesGenerated" ;
9
9
10
10
export interface LoginPageViewProps {
11
11
authMethods : AuthMethods | undefined ;
@@ -22,7 +22,6 @@ export const LoginPageView: FC<LoginPageViewProps> = ({
22
22
} ) => {
23
23
const location = useLocation ( ) ;
24
24
const redirectTo = retrieveRedirect ( location . search ) ;
25
- const styles = useStyles ( ) ;
26
25
// This allows messages to be displayed at the top of the sign in form.
27
26
// Helpful for any redirects that want to inform the user of something.
28
27
const info = new URLSearchParams ( location . search ) . get ( "info" ) || undefined ;
@@ -41,12 +40,12 @@ export const LoginPageView: FC<LoginPageViewProps> = ({
41
40
} }
42
41
/>
43
42
) : (
44
- < CoderIcon fill = "white" opacity = { 1 } className = { styles . icon } />
43
+ < CoderIcon fill = "white" opacity = { 1 } css = { styles . icon } />
45
44
) ;
46
45
47
46
return (
48
- < div className = { styles . root } >
49
- < div className = { styles . container } >
47
+ < div css = { styles . root } >
48
+ < div css = { styles . container } >
50
49
{ applicationLogo }
51
50
< SignInForm
52
51
authMethods = { authMethods }
@@ -56,40 +55,40 @@ export const LoginPageView: FC<LoginPageViewProps> = ({
56
55
info = { info }
57
56
onSubmit = { onSignIn }
58
57
/>
59
- < footer className = { styles . footer } >
58
+ < footer css = { styles . footer } >
60
59
Copyright © { new Date ( ) . getFullYear ( ) } Coder Technologies, Inc.
61
60
</ footer >
62
61
</ div >
63
62
</ div >
64
63
) ;
65
64
} ;
66
65
67
- const useStyles = makeStyles ( ( theme ) => ( {
68
- root : {
66
+ const styles = {
67
+ root : ( theme ) => ( {
69
68
padding : theme . spacing ( 3 ) ,
70
69
display : "flex" ,
71
70
alignItems : "center" ,
72
71
justifyContent : "center" ,
73
72
minHeight : "100%" ,
74
73
textAlign : "center" ,
75
- } ,
74
+ } ) ,
76
75
77
- container : {
76
+ container : ( theme ) => ( {
78
77
width : "100%" ,
79
78
maxWidth : 385 ,
80
79
display : "flex" ,
81
80
flexDirection : "column" ,
82
81
alignItems : "center" ,
83
82
gap : theme . spacing ( 2 ) ,
84
- } ,
83
+ } ) ,
85
84
86
- icon : {
85
+ icon : ( theme ) => ( {
87
86
fontSize : theme . spacing ( 8 ) ,
88
- } ,
87
+ } ) ,
89
88
90
- footer : {
89
+ footer : ( theme ) => ( {
91
90
fontSize : 12 ,
92
91
color : theme . palette . text . secondary ,
93
92
marginTop : theme . spacing ( 3 ) ,
94
- } ,
95
- } ) ) ;
93
+ } ) ,
94
+ } satisfies Record < string , Interpolation < Theme > > ;
0 commit comments