Skip to content

Commit c116edb

Browse files
committed
emotion: OAuthSignInForm
1 parent e726411 commit c116edb

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

site/src/pages/LoginPage/OAuthSignInForm.tsx

+12-14
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,28 @@ import Button from "@mui/material/Button";
33
import GitHubIcon from "@mui/icons-material/GitHub";
44
import KeyIcon from "@mui/icons-material/VpnKey";
55
import Box from "@mui/material/Box";
6+
import { type FC } from "react";
7+
import { useTheme } from "@emotion/react";
68
import { Language } from "./SignInForm";
7-
import { AuthMethods } from "api/typesGenerated";
8-
import { FC } from "react";
9-
import { makeStyles } from "@mui/styles";
9+
import { type AuthMethods } from "api/typesGenerated";
1010

1111
type OAuthSignInFormProps = {
1212
isSigningIn: boolean;
1313
redirectTo: string;
1414
authMethods?: AuthMethods;
1515
};
1616

17-
const useStyles = makeStyles((theme) => ({
18-
buttonIcon: {
19-
width: theme.spacing(2),
20-
height: theme.spacing(2),
21-
},
22-
}));
23-
2417
export const OAuthSignInForm: FC<OAuthSignInFormProps> = ({
2518
isSigningIn,
2619
redirectTo,
2720
authMethods,
2821
}) => {
29-
const styles = useStyles();
22+
const theme = useTheme();
23+
24+
const iconStyles = {
25+
width: theme.spacing(2),
26+
height: theme.spacing(2),
27+
};
3028

3129
return (
3230
<Box display="grid" gap="16px">
@@ -37,7 +35,7 @@ export const OAuthSignInForm: FC<OAuthSignInFormProps> = ({
3735
)}`}
3836
>
3937
<Button
40-
startIcon={<GitHubIcon className={styles.buttonIcon} />}
38+
startIcon={<GitHubIcon css={iconStyles} />}
4139
disabled={isSigningIn}
4240
fullWidth
4341
type="submit"
@@ -61,10 +59,10 @@ export const OAuthSignInForm: FC<OAuthSignInFormProps> = ({
6159
<img
6260
alt="Open ID Connect icon"
6361
src={authMethods.oidc.iconUrl}
64-
className={styles.buttonIcon}
62+
css={iconStyles}
6563
/>
6664
) : (
67-
<KeyIcon className={styles.buttonIcon} />
65+
<KeyIcon css={iconStyles} />
6866
)
6967
}
7068
disabled={isSigningIn}

0 commit comments

Comments
 (0)