Fix: don't show dummy on mobile
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
d493777de3
commit
bd72659215
2 changed files with 22 additions and 14 deletions
|
@ -7,6 +7,7 @@ import {
|
||||||
SpeedRoundPair,
|
SpeedRoundPair,
|
||||||
} from '../data/SpeedFlowchart';
|
} from '../data/SpeedFlowchart';
|
||||||
import { Card, CardContent, Grid, Skeleton, Typography } from '@mui/material';
|
import { Card, CardContent, Grid, Skeleton, Typography } from '@mui/material';
|
||||||
|
import { theme } from '../utils/Theme';
|
||||||
|
|
||||||
interface SpeedRoundPairDummy extends SpeedRoundPair {
|
interface SpeedRoundPairDummy extends SpeedRoundPair {
|
||||||
dummy: boolean;
|
dummy: boolean;
|
||||||
|
@ -88,6 +89,13 @@ export default function SpeedFlowchartPage() {
|
||||||
<Card
|
<Card
|
||||||
sx={{
|
sx={{
|
||||||
opacity: (pair as SpeedRoundPairDummy).dummy ? 0 : 1,
|
opacity: (pair as SpeedRoundPairDummy).dummy ? 0 : 1,
|
||||||
|
[theme.breakpoints.down('md')]: (
|
||||||
|
pair as SpeedRoundPairDummy
|
||||||
|
).dummy
|
||||||
|
? {
|
||||||
|
display: 'none',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
|
|
|
@ -1,15 +1,7 @@
|
||||||
import { CssBaseline } from '@mui/material';
|
import { CssBaseline } from '@mui/material';
|
||||||
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
||||||
|
|
||||||
/**
|
export const theme = createTheme({
|
||||||
* Sets a MaterialUi theme for its children
|
|
||||||
* @param {any} props accepts JSX elements to wrap theme in
|
|
||||||
* @return {JSX.Element}
|
|
||||||
*/
|
|
||||||
export default function Theme(props: { children: JSX.Element }) {
|
|
||||||
const { children } = props;
|
|
||||||
|
|
||||||
const Theme = createTheme({
|
|
||||||
components: {
|
components: {
|
||||||
MuiToggleButton: {
|
MuiToggleButton: {
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
|
@ -20,9 +12,17 @@ export default function Theme(props: { children: JSX.Element }) {
|
||||||
palette: {
|
palette: {
|
||||||
mode: 'dark',
|
mode: 'dark',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a MaterialUi theme for its children
|
||||||
|
* @param {any} props accepts JSX elements to wrap theme in
|
||||||
|
* @return {JSX.Element}
|
||||||
|
*/
|
||||||
|
export default function Theme(props: { children: JSX.Element }) {
|
||||||
|
const { children } = props;
|
||||||
return (
|
return (
|
||||||
<ThemeProvider theme={Theme}>
|
<ThemeProvider theme={theme}>
|
||||||
<CssBaseline />
|
<CssBaseline />
|
||||||
{children}
|
{children}
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
|
|
Loading…
Reference in a new issue