Commit 66d1236f authored by Nawasan Wisitsingkhon's avatar Nawasan Wisitsingkhon

show name in title in profile page

parent 81075e21
...@@ -8,6 +8,7 @@ import { ...@@ -8,6 +8,7 @@ import {
} from "@mui/material"; } from "@mui/material";
import React, { useContext } from "react"; import React, { useContext } from "react";
import { UserContext } from "./_app"; import { UserContext } from "./_app";
import Head from "next/head";
export default function Profile() { export default function Profile() {
const user = useContext(UserContext); const user = useContext(UserContext);
...@@ -17,49 +18,57 @@ export default function Profile() { ...@@ -17,49 +18,57 @@ export default function Profile() {
return ( return (
<> <>
{user.value?.token ? ( {user.value?.token ? (
<Box> <>
<Paper sx={{ p: 3, boxShadow: "none" }}> <Head>
<div className="gap-10 mx-auto text-left grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 max-w-[1520px]"> <title>{`${user.value.name} | OpenShop`}</title>
<div className="mx-auto"> </Head>
<img
className="inline-block w-[200px] h-[200px] sm:w-[300px] sm:h-[300px] rounded-lg object-cover" <Box>
src={user.value.photo.length ? user.value.photo : "empty.jpg"} <Paper sx={{ p: 3, boxShadow: "none" }}>
alt="" <div className="gap-10 mx-auto text-left grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 max-w-[1520px]">
/> <div className="mx-auto">
</div> <img
<div className="lg:col-span-2 p-3 text-lg overflow-x-scroll"> className="inline-block w-[200px] h-[200px] sm:w-[300px] sm:h-[300px] rounded-lg object-cover"
<Table> src={
<TableBody> user.value.photo.length ? user.value.photo : "empty.jpg"
<TableRow> }
<TableCell sx={{ maxWidth }}>ชื่อ</TableCell> alt=""
<TableCell>{user.value.name}</TableCell> />
</TableRow> </div>
<TableRow> <div className="lg:col-span-2 p-3 text-lg overflow-x-scroll">
<TableCell sx={{ maxWidth }}>อีเมล</TableCell> <Table>
<TableCell>{user.value.email}</TableCell> <TableBody>
</TableRow> <TableRow>
<TableRow> <TableCell sx={{ maxWidth }}>ชื่อ</TableCell>
<TableCell sx={{ maxWidth }}>username</TableCell> <TableCell>{user.value.name}</TableCell>
<TableCell>@{user.value.username}</TableCell> </TableRow>
</TableRow> <TableRow>
<TableRow> <TableCell sx={{ maxWidth }}>อีเมล</TableCell>
<TableCell sx={{ maxWidth }}>เบอร์โทร</TableCell> <TableCell>{user.value.email}</TableCell>
<TableCell>{user.value.phone}</TableCell> </TableRow>
</TableRow> <TableRow>
<TableRow> <TableCell sx={{ maxWidth }}>username</TableCell>
<TableCell sx={{ maxWidth }}>ที่อยู่</TableCell> <TableCell>@{user.value.username}</TableCell>
<TableCell> </TableRow>
{!!user.value.address <TableRow>
? user.value.address <TableCell sx={{ maxWidth }}>เบอร์โทร</TableCell>
: "ยังไม่ระบุ"} <TableCell>{user.value.phone}</TableCell>
</TableCell> </TableRow>
</TableRow> <TableRow>
</TableBody> <TableCell sx={{ maxWidth }}>ที่อยู่</TableCell>
</Table> <TableCell>
{!!user.value.address
? user.value.address
: "ยังไม่ระบุ"}
</TableCell>
</TableRow>
</TableBody>
</Table>
</div>
</div> </div>
</div> </Paper>
</Paper> </Box>
</Box> </>
) : ( ) : (
<Box> <Box>
<Paper sx={{ p: 3, textAlign: "center" }}> <Paper sx={{ p: 3, textAlign: "center" }}>
......
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