Commit bbf90a9e authored by Nawasan Wisitsingkhon's avatar Nawasan Wisitsingkhon

change title page

parent 25a6bea2
...@@ -62,7 +62,7 @@ export default function AddProduct({ open, handleClose }) { ...@@ -62,7 +62,7 @@ export default function AddProduct({ open, handleClose }) {
setImage(""); setImage("");
setCategory(0); setCategory(0);
setMessage({ message: "เพิ่มสินค้าสำเร็จ", error: false }); setMessage({ message: "เพิ่มสินค้าสำเร็จ", error: false });
handleClose() handleClose();
setTimeout(() => { setTimeout(() => {
setMessage({ message: "", error: false }); setMessage({ message: "", error: false });
}, 3000); }, 3000);
...@@ -107,6 +107,7 @@ export default function AddProduct({ open, handleClose }) { ...@@ -107,6 +107,7 @@ export default function AddProduct({ open, handleClose }) {
/> />
<div className="text-left"> <div className="text-left">
<TextField <TextField
fullWidth
className="m-1" className="m-1"
label="รายละเอียด" label="รายละเอียด"
variant="standard" variant="standard"
......
import { Add } from "@mui/icons-material"; import { Add } from "@mui/icons-material";
import { import {
Snackbar,
Box, Box,
Button, Button,
Grid, Grid,
...@@ -10,19 +9,17 @@ import { ...@@ -10,19 +9,17 @@ import {
TableCell, TableCell,
TableHead, TableHead,
TableRow, TableRow,
Alert,
} from "@mui/material"; } from "@mui/material";
import React, { useState, useContext, useEffect } from "react"; import React, { useState, useEffect } from "react";
import AddCategory from "@/components/category/AddCategory"; import AddCategory from "@/components/category/AddCategory";
import axios from "axios"; import axios from "axios";
import { Delete } from "@mui/icons-material"; import { Delete } from "@mui/icons-material";
import { Edit } from "@mui/icons-material"; import { Edit } from "@mui/icons-material";
import UpdateCategory from "@/components/category/UpdateCategory"; import UpdateCategory from "@/components/category/UpdateCategory";
import { UserContext } from "../_app";
import DeleteCategory from "@/components/category/DeleteCategory"; import DeleteCategory from "@/components/category/DeleteCategory";
import Head from "next/head";
export default function AdminCategory() { export default function AdminCategory() {
const user = useContext(UserContext);
const [modal, setModal] = useState(false); const [modal, setModal] = useState(false);
const [message, setMessage] = useState({ message: "", error: false }); const [message, setMessage] = useState({ message: "", error: false });
const [deleteState, setDeleteState] = useState({ const [deleteState, setDeleteState] = useState({
...@@ -42,6 +39,10 @@ export default function AdminCategory() { ...@@ -42,6 +39,10 @@ export default function AdminCategory() {
}; };
useEffect(fetchCategory, [modal, updateState, message, deleteState]); useEffect(fetchCategory, [modal, updateState, message, deleteState]);
return ( return (
<>
<Head>
<title>จัดการหมวดหมู่ | admin</title>
</Head>
<Box> <Box>
<Grid container> <Grid container>
<Grid item lg={3} md={0}></Grid> <Grid item lg={3} md={0}></Grid>
...@@ -87,7 +88,9 @@ export default function AdminCategory() { ...@@ -87,7 +88,9 @@ export default function AdminCategory() {
<TableCell sx={{ maxWidth: 10 }}> <TableCell sx={{ maxWidth: 10 }}>
<Button <Button
color="error" color="error"
onClick={() => setDeleteState({open: true, id: cate.id})} onClick={() =>
setDeleteState({ open: true, id: cate.id })
}
> >
<Delete /> <Delete />
</Button> </Button>
...@@ -120,5 +123,6 @@ export default function AdminCategory() { ...@@ -120,5 +123,6 @@ export default function AdminCategory() {
/> />
)} )}
</Box> </Box>
</>
); );
} }
...@@ -4,10 +4,14 @@ import { Grid, Paper } from "@mui/material"; ...@@ -4,10 +4,14 @@ import { Grid, Paper } from "@mui/material";
import Chart from "@/components/dashboard/Chart"; import Chart from "@/components/dashboard/Chart";
import Deposits from "@/components/dashboard/Deposits"; import Deposits from "@/components/dashboard/Deposits";
import Orders from "@/components/dashboard/Orders"; import Orders from "@/components/dashboard/Orders";
import Head from "next/head";
export default function Report() { export default function Report() {
return ( return (
<main> <>
<Head>
<title>รายงาน | admin</title>
</Head>
<DashboardLayout> <DashboardLayout>
<Grid container spacing={3}> <Grid container spacing={3}>
{/* Chart */} {/* Chart */}
...@@ -44,6 +48,6 @@ export default function Report() { ...@@ -44,6 +48,6 @@ export default function Report() {
</Grid> </Grid>
</Grid> </Grid>
</DashboardLayout> </DashboardLayout>
</main> </>
); );
} }
...@@ -6,21 +6,18 @@ import { ...@@ -6,21 +6,18 @@ import {
Card, Card,
CardActions, CardActions,
CardContent, CardContent,
CardHeader,
CardMedia, CardMedia,
Paper,
Table, Table,
TableBody, TableBody,
TableCell, TableCell,
TableHead,
TableRow, TableRow,
Typography, Typography,
} from "@mui/material"; } from "@mui/material";
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import axios from "axios"; import axios from "axios";
import Head from "next/head";
import { Delete } from "@mui/icons-material"; import { Delete } from "@mui/icons-material";
import { Edit } from "@mui/icons-material"; import { Edit } from "@mui/icons-material";
export default function Stock() { export default function Stock() {
const [modal, setModal] = useState(false); const [modal, setModal] = useState(false);
const [products, setProducts] = useState([]); const [products, setProducts] = useState([]);
...@@ -39,6 +36,10 @@ export default function Stock() { ...@@ -39,6 +36,10 @@ export default function Stock() {
}, []); }, []);
return ( return (
<>
<Head>
<title>รายการสินค้า | admin</title>
</Head>
<Box> <Box>
<Box sx={{ mb: 2, textAlign: "right" }}> <Box sx={{ mb: 2, textAlign: "right" }}>
<Button onClick={() => setModal(!modal)}> <Button onClick={() => setModal(!modal)}>
...@@ -94,5 +95,6 @@ export default function Stock() { ...@@ -94,5 +95,6 @@ export default function Stock() {
))} ))}
<AddProduct open={modal} handleClose={() => setModal(false)} /> <AddProduct open={modal} handleClose={() => setModal(false)} />
</Box> </Box>
</>
); );
} }
import { Inter } from 'next/font/google' import { Inter } from 'next/font/google'
import Head from 'next/head'
const inter = Inter({ subsets: ['latin'] }) const inter = Inter({ subsets: ['latin'] })
export default function Home() { export default function Home() {
return ( return (
<main> <>
<Head>
<title>หน้าหลัก | OpenShop</title>
</Head>
<div>
<h1>Hello world</h1> <h1>Hello world</h1>
</main> </div>
</>
) )
} }
...@@ -7,6 +7,7 @@ import { Container } from "@mui/material"; ...@@ -7,6 +7,7 @@ import { Container } from "@mui/material";
import { Google } from "@mui/icons-material"; import { Google } from "@mui/icons-material";
import { useState } from "react"; import { useState } from "react";
import axios from "axios"; import axios from "axios";
import Head from "next/head";
import userCookie from "@/components/lib/userCookie"; import userCookie from "@/components/lib/userCookie";
export default function Login() { export default function Login() {
...@@ -45,6 +46,9 @@ export default function Login() { ...@@ -45,6 +46,9 @@ export default function Login() {
return ( return (
<div> <div>
<Head>
<title>เข้าสู่ระบบ | OpenShop</title>
</Head>
<Container> <Container>
<Snackbar <Snackbar
ContentProps={{ className: "bg-red-500" }} ContentProps={{ className: "bg-red-500" }}
......
...@@ -7,6 +7,7 @@ import { Container } from "@mui/material"; ...@@ -7,6 +7,7 @@ import { Container } from "@mui/material";
import { Google } from "@mui/icons-material"; import { Google } from "@mui/icons-material";
import { useState } from "react"; import { useState } from "react";
import axios from "axios"; import axios from "axios";
import Head from "next/head";
export default function Login() { export default function Login() {
const [errorMessage, setErrorMessage] = useState(""); const [errorMessage, setErrorMessage] = useState("");
...@@ -66,6 +67,9 @@ export default function Login() { ...@@ -66,6 +67,9 @@ export default function Login() {
return ( return (
<div> <div>
<Head>
<title>สมัครสมาชิก | OpenShop</title>
</Head>
<Container> <Container>
<Snackbar <Snackbar
ContentProps={{ className: "bg-red-500" }} ContentProps={{ className: "bg-red-500" }}
......
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