Skip to content

Commit

Permalink
feat(#20): nav link change
Browse files Browse the repository at this point in the history
- poemBard -> poem (Poetry List Page)
- board -> post (Free Forum page)
  • Loading branch information
baejoonsoo committed Feb 18, 2023
1 parent 64bae31 commit 72ca7d9
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 39 deletions.
4 changes: 2 additions & 2 deletions components/common/header/pageNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { theme } from "styles/theme";
const PageNavigation: NextPage = () => {
return (
<PageNav>
<Link href="/poemBoard">
<Link href="/poem">
<NavItem>시 게시판</NavItem>
</Link>
<Link href="/best">
<NavItem>명예의 전당</NavItem>
</Link>
<Link href="/board">
<Link href="/forum">
<NavItem>자유 게시판</NavItem>
</Link>
<Link href="/group">
Expand Down
30 changes: 15 additions & 15 deletions components/boardHead/index.tsx → components/postHead/index.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
import styled from "@emotion/styled";
import { boardTypeData } from "docs/boardTypeData";
import { postTypeData } from "docs/postTypeData";
import { NextPage } from "next";
import { useRouter } from "next/router";
import { theme } from "styles/theme";
import { boardType } from "utils/interface/boardTypeData";
import { postType } from "utils/interface/postTypeData";

interface props {
type: boardType;
type: postType;
}

const BoardHead: NextPage<props> = ({ type }: props) => {
const PostHead: NextPage<props> = ({ type }: props) => {
const router = useRouter();

const goWritePage = () => router.push(boardTypeData[type].writeLink);
const goWritePage = () => router.push(postTypeData[type].writeLink);

return (
<BoardHeadSection>
<BoardNameWrap>
<BoardName>{boardTypeData[type].boardName}</BoardName>
{boardTypeData[type].writeLink ? (
<PostHeadSection>
<PostNameWrap>
<PostName>{postTypeData[type].postName}</PostName>
{postTypeData[type].writeLink ? (
<WriteButton onClick={goWritePage}>
<div />
<p>글 작성하기</p>
</WriteButton>
) : (
<></>
)}
</BoardNameWrap>
</PostNameWrap>
<TipBox>
선정성, 폭력성 등을 포함, 부적절하다고 판단되었을 시 통보없이 삭제될 수
있습니다.
</TipBox>
</BoardHeadSection>
</PostHeadSection>
);
};

Expand Down Expand Up @@ -78,7 +78,7 @@ const WriteButton = styled.button`
}
`;

const BoardNameWrap = styled.div`
const PostNameWrap = styled.div`
width: 100%;
display: flex;
align-items: center;
Expand All @@ -87,15 +87,15 @@ const BoardNameWrap = styled.div`
margin-bottom: 38px;
`;

const BoardName = styled.p`
const PostName = styled.p`
font-size: 28px;
font-weight: 700;
`;

const BoardHeadSection = styled.section`
const PostHeadSection = styled.section`
width: 100%;
height: fit-content;
margin-bottom: 68px;
`;

export default BoardHead;
export default PostHead;
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import { useState } from "react";
import { theme } from "styles/theme";

type categoryType = "question" | "communication";
const PostBoardList: NextPage = () => {

const PostList: NextPage = () => {
const [selected, setSelected] = useState<categoryType>("communication");
return (
<>
<BoardFilter>
<PostFilter>
<CategoryWrap>
<Category
type="communication"
Expand All @@ -32,7 +33,7 @@ const PostBoardList: NextPage = () => {
<option>최신순</option>
<option>인기순</option>
</SortSelect>
</BoardFilter>
</PostFilter>
<BoardList />
</>
);
Expand Down Expand Up @@ -88,7 +89,7 @@ const CategoryWrap = styled.div`
display: flex;
`;

const BoardFilter = styled.div`
const PostFilter = styled.div`
width: 100%;
height: fit-content;
Expand All @@ -97,4 +98,4 @@ const BoardFilter = styled.div`
align-items: center;
`;

export default PostBoardList;
export default PostList;
9 changes: 0 additions & 9 deletions docs/boardTypeData/index.ts

This file was deleted.

9 changes: 9 additions & 0 deletions docs/postTypeData/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const postTypeData = {
poem: {
postName: "시 게시판",
writeLink: "/write/poem",
},
post: { postName: "자유 게시판", writeLink: "/write/post" },

writePost: { postName: "소통해요 글쓰기", writeLink: "" },
};
10 changes: 5 additions & 5 deletions pages/post/index.tsx → pages/forum/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import styled from "@emotion/styled";
import Banner from "components/banner";
import BoardHead from "components/boardHead";
import PostBoardList from "components/postBoardList";
import PostHead from "components/postHead";
import PostBoardList from "components/postList";

const PostList = () => {
const Forum = () => {
const bannerData = {
title: "시리얼 시인들과\n이야기를 나눠보세요",
description:
Expand All @@ -12,7 +12,7 @@ const PostList = () => {
return (
<BoardListPage>
<Banner {...bannerData} />
<BoardHead type="post" />
<PostHead type="post" />
<PostBoardList />
</BoardListPage>
);
Expand All @@ -24,4 +24,4 @@ const BoardListPage = styled.main`
padding: 0 120px;
`;

export default PostList;
export default Forum;
4 changes: 2 additions & 2 deletions pages/write/post.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from "@emotion/styled";
import BoardHead from "components/boardHead";
import PostHead from "components/postHead";
import { NextPage } from "next";
import { useRef } from "react";
import { theme } from "styles/theme";
Expand All @@ -23,7 +23,7 @@ const WritePost: NextPage = () => {

return (
<WritePostPage>
<BoardHead type="writePost" />
<PostHead type="writePost" />
<Tip>
<TipIcon>
<div />
Expand Down
1 change: 0 additions & 1 deletion utils/interface/boardTypeData/index.ts

This file was deleted.

1 change: 1 addition & 0 deletions utils/interface/postTypeData/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type postType = "poem" | "post" | "writePost";

0 comments on commit 72ca7d9

Please sign in to comment.