migrate EmptyView to Mui 5 (#95)

This commit is contained in:
Aria Moradi
2021-11-15 19:29:57 +03:30
committed by GitHub
parent 5c61dcc22f
commit 0ac0d2d52c

View File

@@ -10,6 +10,7 @@ import React from 'react';
import Typography from '@mui/material/Typography'; import Typography from '@mui/material/Typography';
import { useTheme } from '@mui/material/styles'; import { useTheme } from '@mui/material/styles';
import { useMediaQuery } from '@mui/material'; import { useMediaQuery } from '@mui/material';
import { Box } from '@mui/system';
const ERROR_FACES = [ const ERROR_FACES = [
'(・o・;)', '(・o・;)',
@@ -35,7 +36,7 @@ export default function EmptyView({ message, messageExtra }: IProps) {
const isMobileWidth = useMediaQuery(theme.breakpoints.down('sm')); const isMobileWidth = useMediaQuery(theme.breakpoints.down('sm'));
return ( return (
<div style={{ <Box sx={{
position: 'absolute', position: 'absolute',
left: `calc(50% + ${isMobileWidth ? '0px' : theme.spacing(8 / 2)})`, left: `calc(50% + ${isMobileWidth ? '0px' : theme.spacing(8 / 2)})`,
top: '50%', top: '50%',
@@ -50,7 +51,7 @@ export default function EmptyView({ message, messageExtra }: IProps) {
{message} {message}
</Typography> </Typography>
{messageExtra} {messageExtra}
</div> </Box>
); );
} }