Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

페이지라우트-설정 #8

Merged
merged 2 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions client/src/app/auth/forgot-password/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type Props = {};
import { nameOfApp } from "@/const/brand";
import { Metadata } from "next";

export const metaData: Metadata = {
title: `${nameOfApp} | 비밀번호 재설정`,
};

const ForgotPasswordPage = (props: Props) => {
return <div>비밀번호 재설정 페이지</div>;
};

export default ForgotPasswordPage;
109 changes: 109 additions & 0 deletions client/src/app/auth/signup/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
"use client";
import Avatar from "@mui/material/Avatar";
import Button from "@mui/material/Button";
import CssBaseline from "@mui/material/CssBaseline";
import TextField from "@mui/material/TextField";
import FormControlLabel from "@mui/material/FormControlLabel";
import Checkbox from "@mui/material/Checkbox";

import Grid from "@mui/material/Grid";
import Box from "@mui/material/Box";
import LockOutlinedIcon from "@mui/icons-material/LockOutlined";
import Typography from "@mui/material/Typography";
import Container from "@mui/material/Container";
import { SIGNIN } from "@/const/clientPath";
import Link from "next/link";

export default function SignUpPage() {
return (
<Container component="main" maxWidth="xs">
<CssBaseline />
<Box
sx={{
marginTop: 8,
display: "flex",
flexDirection: "column",
alignItems: "center",
}}
>
<Avatar sx={{ m: 1, bgcolor: "secondary.main" }}>
<LockOutlinedIcon />
</Avatar>
<Typography variant="h1">Sign up</Typography>
<Box component="form" noValidate sx={{ mt: 3 }}>
<Grid container spacing={2}>
<Grid item xs={12}>
<TextField
required
fullWidth
id="email"
label="이메일"
name="email"
autoComplete="email"
/>
</Grid>
<Grid item xs={12}>
<TextField
required
fullWidth
name="password"
label="비밀번호"
type="password"
id="password"
autoComplete="new-password"
/>
</Grid>
<Grid item xs={12} sm={6}>
<TextField
name="userId"
required
fullWidth
id="userId"
label="유저 아이디"
autoFocus
/>
</Grid>
<Grid item xs={12} sm={6}>
<TextField
required
fullWidth
id="nickname"
label="닉네임"
name="nickname"
/>
</Grid>
<Grid item xs={12}>
<FormControlLabel
control={<Checkbox value="allowExtraEmails" color="primary" />}
label="유용한 정보를 받아볼게요."
/>
</Grid>
</Grid>
<Button
type="submit"
fullWidth
variant="contained"
sx={{ mt: 3, mb: 2 }}
>
회원가입
</Button>
<Grid container justifyContent="flex-end">
<Grid item>
<Link href={SIGNIN}>
<Typography variant="label">
Already have an account?{" "}
<Typography
variant="label"
sx={{ color: "primary", fontWeight: "bold" }}
>
Sign in
</Typography>
</Typography>
</Link>
</Grid>
</Grid>
</Box>
</Box>
</Container>
);
}
16 changes: 16 additions & 0 deletions client/src/app/post/[userId]/[postId]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const PostDetailPage = ({
params,
}: {
params: { userId: string; postId: string };
}) => {
const parsedUserId = params.userId.slice(1, params.userId.length);
const parsedPostId = params.postId.slice(1, params.postId.length);
return (
<div>
userId:{parsedUserId}
<br /> postId:{parsedPostId}
</div>
);
};

export default PostDetailPage;
5 changes: 5 additions & 0 deletions client/src/app/post/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const page = () => {
return <div>모든 포스트를 보는 페이지</div>;
};

export default page;
5 changes: 5 additions & 0 deletions client/src/app/user/[userId]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const page = ({ params }: { params: { userId: string } }) => {
return <div>{params.userId}님의 page 입니다</div>;
};

export default page;
8 changes: 8 additions & 0 deletions client/src/app/user/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

const MyPage = () => {
return (
<div>page</div>
)
}

export default MyPage
5 changes: 5 additions & 0 deletions client/src/app/wiki/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const WikiPage = () => {
return <div>위키 메인페이지</div>;
};

export default WikiPage;
5 changes: 4 additions & 1 deletion client/src/components/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import SearchIcon from "~/assets/icons/SearchIcon.svg";
import PostIcon from "~/assets/icons/PostIcon.svg";
import BeverageIcon from "~/assets/icons/BeverageIcon.svg";
import MyIcon from "~/assets/icons/MyIcon.svg";
import HOME, { MY_PROFILE, WIKI } from "@/const/clientPath";

const NavbarData = [
{
iconComponent: <img src={HomeIcon.src} />,
label: "홈",
href: "/",
href: HOME,
},
{
iconComponent: <img src={SearchIcon.src} />,
Expand All @@ -29,10 +30,12 @@ const NavbarData = [
{
iconComponent: <img src={BeverageIcon.src} />,
label: "술과사전",
href: WIKI,
},
{
iconComponent: <img src={MyIcon.src} />,
label: "내 정보",
href: MY_PROFILE,
},
];

Expand Down
26 changes: 20 additions & 6 deletions client/src/const/clientPath.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
const HOME = "/" as const;

export const SIGNIN = "/user/login" as const;

export const SIGNUP = "/user/signup" as const;

export const FORGOTPASSWORD = "/user/forgot-password" as const;
/**
* 로그인 페이지 라우트
*/
export const SIGNIN = "/auth/login" as const;
/**
* 회원가입 페이지 라우트
*/
export const SIGNUP = "/auth/signup" as const;
/**
* 비밀번호 재설정페이지 라우트
*/
export const FORGOTPASSWORD = "/auth/forgot-password" as const;
/**
* 로그인 했을 경우만 접근 가능한 마이페이지
*/
export const MY_PROFILE = "/user" as const
/**
* 술과사전 페이지 라우트
*/
export const WIKI = "/wiki" as const

export default HOME;