Skip to content

Commit 20419ad

Browse files
committed
refacor: use sx (remove makeStyles) on /admin/[id/ page
1 parent 2bcc087 commit 20419ad

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

src/pages/admin/[id]/index.tsx

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
Container,
77
Box,
88
} from '@mui/material';
9-
import { makeStyles } from '@mui/styles'
109
import { User } from '@firebase/auth';
1110
import { ref, onValue, DataSnapshot } from '@firebase/database';
1211
import { AuthProvider } from '@/lib/AuthProvider';
@@ -23,20 +22,6 @@ const Editors = {
2322
iframe: IFrameWidgetEditor,
2423
};
2524

26-
const useStyles = makeStyles((_) => ({
27-
root: {
28-
display: 'flex',
29-
flexDirection: 'column',
30-
width: '100%',
31-
height: '100vh',
32-
overflow: 'hidden',
33-
},
34-
content: {
35-
flex: 1,
36-
overflow: 'auto',
37-
},
38-
}));
39-
4025
type Widget = {
4126
name: string;
4227
}
@@ -67,7 +52,6 @@ const Widgets = ({ profile }: { profile: string }) => {
6752
};
6853

6954
const AdminIndexPage = () => {
70-
const classes = useStyles();
7155
const router = useRouter();
7256
const [currentUser, setCurrentUser] = useState<User | null>(null);
7357

@@ -88,14 +72,20 @@ const AdminIndexPage = () => {
8872
currentUser !== null ? (
8973
<AuthProvider>
9074
<CssBaseline />
91-
<div className={classes.root}>
75+
<Box sx={{
76+
display: 'flex',
77+
flexDirection: 'column',
78+
width: '100%',
79+
height: '100vh',
80+
overflow: 'hidden',
81+
}}>
9282
<Navbar profile={currentProfile} />
93-
<Container className={classes.content}>
83+
<Container sx={{ flex: 1, overflow: 'auto' }}>
9484
<Box my={4}>
9585
<Widgets profile={currentProfile} />
9686
</Box>
9787
</Container>
98-
</div>
88+
</Box>
9989
</AuthProvider>
10090
) : (
10191
<Signin />

0 commit comments

Comments
 (0)