fix(frontend): build errors and warnings

This commit is contained in:
Leandro Farias 2023-05-08 12:13:27 +00:00
parent a1ccd87b43
commit d682a46f69
8 changed files with 2395 additions and 949 deletions

View File

@ -4,6 +4,7 @@
"@next/next/no-img-element": "off",
"jsx-a11y/alt-text": "off",
"react/display-name": "off",
"react/no-unescaped-entities": 0,
"react/jsx-max-props-per-line": [
1,
{

File diff suppressed because it is too large Load Diff

View File

@ -39,7 +39,7 @@ export const AuthGuard = (props) => {
setChecked(true);
}
},
[router.isReady]
[router.isReady, isAuthenticated, router]
);
if (!checked) {

View File

@ -67,7 +67,9 @@ export const SideNav = (props) => {
}}
>
<div style={{display:'flex',justifyContent:'center'}}>
<img src="/assets/oktopus.png" width={'60%'}></img>
<img src="/assets/oktopus.png"
width={'60%'}
/>
</div>
<SvgIcon
fontSize="small"

View File

@ -29,8 +29,12 @@ const Favicon = () => (
</>
);
const Fonts = () => (
<>
class CustomDocument extends Document {
render() {
return (
<Html lang="en">
<Head>
<Favicon />
<link
rel="preconnect"
href="https://fonts.googleapis.com"
@ -51,16 +55,6 @@ const Fonts = () => (
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@600;700&display=swap"
/>
</>
);
class CustomDocument extends Document {
render() {
return (
<Html lang="en">
<Head>
<Favicon />
<Fonts />
</Head>
<body>
<Main />

View File

@ -93,7 +93,11 @@ const handleOpen = () => {
</CardContent>
<Divider />
<CardActions sx={{ justifyContent: 'flex-end' }}>
<Button variant="contained" endIcon={<SvgIcon><PaperAirplane /></SvgIcon>} onClick={handleOpen}>
<Button
variant="contained"
endIcon={<SvgIcon><PaperAirplane /></SvgIcon>}
onClick={handleOpen}
>
Send
</Button>
</CardActions>

View File

@ -80,7 +80,11 @@ export const OverviewLatestOrders = (props) => {
</SeverityPill>
</TableCell>
<TableCell>
<SvgIcon fontSize="small" sx={{cursor:'pointer'}} onClick={()=>router.push("devices/"+order.id)}>
<SvgIcon
fontSize="small"
sx={{cursor:'pointer'}}
onClick={()=>router.push("devices/"+order.id)}
>
<ArrowTopRightOnSquareIcon />
</SvgIcon>
</TableCell>

View File

@ -24,7 +24,11 @@ function MyApp() {
}}
>
{theme.palette.mode} mode
<IconButton sx={{ ml: 1 }} onClick={colorMode.toggleColorMode} color="inherit">
<IconButton
sx={{ ml: 1 }}
onClick={colorMode.toggleColorMode}
color="inherit"
>
{theme.palette.mode === 'dark' ? <Brightness7Icon /> : <Brightness4Icon />}
</IconButton>
</Box>
@ -39,7 +43,7 @@ export default function ToggleColorMode() {
setMode((prevMode) => (prevMode === 'light' ? 'dark' : 'light'));
},
}),
[],
[setMode],
);
const theme = React.useMemo(