Commit 2d4c59fc authored by Nawasan Wisitsingkhon's avatar Nawasan Wisitsingkhon

fix: admin page on mobile;

parent 31785e10
...@@ -45,76 +45,70 @@ export default function AdminCategory() { ...@@ -45,76 +45,70 @@ export default function AdminCategory() {
<Head> <Head>
<title>จัดการหมวดหมู่ | admin</title> <title>จัดการหมวดหมู่ | admin</title>
</Head> </Head>
<Box> <Box sx={{maxWidth: 800, mx: "auto"}}>
<Grid container> <Box sx={{ mb: 2, textAlign: "right" }}>
<Grid item lg={3} md={0}></Grid> <Button onClick={() => setModal(true)}>
<Grid item lg={6} md={12}> <Add /> เพิ่มหมวดหมู่
<Box sx={{ mb: 2, textAlign: "right" }}> </Button>
<Button onClick={() => setModal(true)}> </Box>
<Add /> เพิ่มหมวดหมู่ <Paper sx={{ p: 2, overflowX: "scroll" }}>
</Button> <div>
</Box> <Table>
<Paper sx={{ p: 2, overflowX: "scroll" }}> <TableHead>
<div> <TableRow>
<Table> <TableCell>id</TableCell>
<TableHead> <TableCell>ชื่อ</TableCell>
<TableRow> <TableCell sx={{ maxWidth: 10, textAlign: "center" }}>
<TableCell>id</TableCell> แก้ไข
<TableCell>ชื่อ</TableCell> </TableCell>
<TableCell sx={{ maxWidth: 10, textAlign: "center" }}> <TableCell sx={{ maxWidth: 10, textAlign: "center" }}>
แก้ไข ลบ
</TableCell> </TableCell>
<TableCell sx={{ maxWidth: 10, textAlign: "center" }}> </TableRow>
ลบ </TableHead>
</TableCell> <TableBody>
</TableRow> {category.map(
</TableHead> (cate, idx) =>
<TableBody> (!router.query?.q ||
{category.map( cate.id === Number(router.query.q) ||
(cate, idx) => String(cate.name)
(!router.query?.q || .toLocaleLowerCase()
cate.id === Number(router.query.q) || .includes(
String(cate.name) String(router.query.q).toLocaleLowerCase()
.toLocaleLowerCase() )) && (
.includes( <TableRow key={idx}>
String(router.query.q).toLocaleLowerCase() <TableCell>{cate.id}</TableCell>
)) && ( <TableCell>{cate.name}</TableCell>
<TableRow key={idx}> <TableCell sx={{ maxWidth: 10 }}>
<TableCell>{cate.id}</TableCell> <Button
<TableCell>{cate.name}</TableCell> color="warning"
<TableCell sx={{ maxWidth: 10 }}> onClick={() =>
<Button setUpdateState({
color="warning" open: true,
onClick={() => data: { id: cate.id, name: cate.name },
setUpdateState({ })
open: true, }
data: { id: cate.id, name: cate.name }, >
}) <Edit />
} </Button>
> </TableCell>
<Edit /> <TableCell sx={{ maxWidth: 10 }}>
</Button> <Button
</TableCell> color="error"
<TableCell sx={{ maxWidth: 10 }}> onClick={() =>
<Button setDeleteState({ open: true, id: cate.id })
color="error" }
onClick={() => >
setDeleteState({ open: true, id: cate.id }) <Delete />
} </Button>
> </TableCell>
<Delete /> </TableRow>
</Button> )
</TableCell> )}
</TableRow> </TableBody>
) </Table>
)} </div>
</TableBody> </Paper>
</Table>
</div>
</Paper>
</Grid>
<Grid item lg={3} md={0}></Grid>
</Grid>
{deleteState.open && ( {deleteState.open && (
<DeleteCategory <DeleteCategory
......
...@@ -102,7 +102,7 @@ export default function Member() { ...@@ -102,7 +102,7 @@ export default function Member() {
</Select> </Select>
</FormControl> </FormControl>
</Box> </Box>
<Paper sx={{ p: 2 }}> <Paper sx={{ p: 2, overflowX: "scroll" }}>
<Table> <Table>
<TableHead> <TableHead>
<TableRow> <TableRow>
......
...@@ -71,7 +71,7 @@ export default function Stock() { ...@@ -71,7 +71,7 @@ export default function Stock() {
</Button> </Button>
</Box> </Box>
<Box className="flex justify-start mb-3 px-10 max-w-[1520px] mx-auto"> <Box className="flex justify-start mb-3 sm:px-10 max-w-[1520px] mx-auto">
<Box sx={{ display: "flex", overflowX: "scroll", maxWidth: "100vw" }}> <Box sx={{ display: "flex", overflowX: "scroll", maxWidth: "100vw" }}>
<Button <Button
variant={category === -1 ? "contained" : "text"} variant={category === -1 ? "contained" : "text"}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment