diff --git a/src/components/_mobile/collection/CardBase.tsx b/src/components/_mobile/collection/CardBase.tsx index 1840efa..5786b68 100644 --- a/src/components/_mobile/collection/CardBase.tsx +++ b/src/components/_mobile/collection/CardBase.tsx @@ -38,7 +38,7 @@ export const CardComponent = ( return (ext === false) ? ( {left} - + {right} diff --git a/src/components/_mobile/collection/NavMenu.tsx b/src/components/_mobile/collection/NavMenu.tsx index 4a76f88..0441b2f 100644 --- a/src/components/_mobile/collection/NavMenu.tsx +++ b/src/components/_mobile/collection/NavMenu.tsx @@ -1,9 +1,62 @@ -import React, { useState, useEffect } from 'react'; -import { ClickAwayListener, Grow, IconButton, MenuItem, MenuList, Paper, Popper } from '@mui/material'; import MenuIcon from '@mui/icons-material/Menu'; +import { Drawer, IconButton, MenuItem, MenuList, Toolbar, useTheme } from '@mui/material'; +import React, { useState } from 'react'; import { Link } from 'react-router-dom'; const NavMenu = () => { + const theme = useTheme(); + const [open, setOpen] = useState(false); + + const handleToggle = () => { + setOpen((prevOpen) => !prevOpen); + }; + + return (<> + + + + + + + Home + Collection + Portal + Forum + Play + + + ); +}; + +export default NavMenu; + +/* +const NavMenu = () => { + const theme = useTheme(); const [open, setOpen] = useState(false); const anchorRef = React.useRef(null); const prevOpen = React.useRef(open); @@ -37,6 +90,8 @@ const NavMenu = () => { prevOpen.current = open; }, [open]); + // TODO change from popper to drawer + return (<> { aria-label="menu" ref={anchorRef} onClick={handleToggle} - sx={{ margin: "auto", mr: 1, p: 2 }} + sx={{ mr: 1, p: 2, + [theme.breakpoints.down("sm")]: { + top: `-${theme.spacing(2)}`, + marginBottom: 0 + } + }} > @@ -96,4 +156,4 @@ const NavMenu = () => { ); }; -export default NavMenu; +*/ diff --git a/src/components/_mobile/collection/index.tsx b/src/components/_mobile/collection/index.tsx index fd839c2..9d7089a 100644 --- a/src/components/_mobile/collection/index.tsx +++ b/src/components/_mobile/collection/index.tsx @@ -1,6 +1,6 @@ import { AppBar, Box, Card, Checkbox, createTheme, FormControl, FormControlLabel, InputLabel, MenuItem, - Pagination, Paper, Select, SelectChangeEvent, Stack, styled, ThemeProvider, Typography + Pagination, Paper, Select, SelectChangeEvent, Stack, styled, ThemeProvider, Typography, useMediaQuery } from '@mui/material'; import React, { useEffect, useState } from 'react'; import { Attack, Battlegear, Card as ChaoticCard, Location, Mugic, Creature } from '../../common/definitions'; @@ -19,8 +19,8 @@ let theme = createTheme({ breakpoints: { values: { xs: 0, - sm: 650, - md: 900, + sm: 430, + md: 650, lg: 1200, xl: 1536, } @@ -63,6 +63,7 @@ export default function Collection (_props) { const [content, setContent] = useState([]); const [info, setInfo] = useState<{text?: string}>({}); const [selected, setSelected] = useState(null); + const isSmall = useMediaQuery(theme.breakpoints.down("sm")); useEffect(() => { const load = localStorage.getItem("collection"); @@ -122,6 +123,65 @@ export default function Collection (_props) { setSelected(null); }, [content]); + const TopMenu = () => (<> + {content.length} results + + Per Page + + 5 + 10 + 25 + 50 + + + + + Stats + + Min + Average + Max + + + } + sx={{ + margin: "auto 0", + '& > .MuiCheckbox-root': { + padding: 0 + } + }} + /> + } + sx={{ + margin: "auto 0", + '& > .MuiCheckbox-root': { + padding: 0 + } + }} + /> + ); + return ( - - - + + {isSmall ? (<> - {content.length} results - - Per Page - - 5 - 10 - 25 - 50 - - - - - Stats - - Min - Average - Max - - - } - sx={{ - margin: "auto 0", - '& > .MuiCheckbox-root': { - padding: 0 - } - }} - /> - } - sx={{ - margin: "auto 0", - '& > .MuiCheckbox-root': { - padding: 0 - } - }} - /> + + - + ): (<> + + + + + + + )} - + {info.text ? ( {info.text} ) : (