-
Notifications
You must be signed in to change notification settings - Fork 20
[김희진] sprint 10 & 11 #94
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
Merged
kiJu2
merged 76 commits into
codeit-bootcamp-frontend:Next-김희진
from
heewls:Next-김희진-sprint2
Apr 21, 2025
The head ref may contain hidden characters: "Next-\uAE40\uD76C\uC9C4-sprint2"
Merged
Changes from all commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
0013f79
Refactor : best item useMemo
heewls c9fe8c7
Refactor : pagination magic number
heewls 5907f13
Refactor : rename useBoardsParams
heewls c4f88cc
Feat : all boards suspens
heewls ab814f7
Feat : best boards suspense
heewls deb00ab
Feat : root layout edit
heewls 3f45d17
Chore : setting
heewls 9f3753f
Fix : input
heewls 55ab7c8
Feat : auth footer
heewls ceddc83
Feat : auth layout & login page
heewls 7f21155
Style : add semibold, medium
heewls 49f69c2
Feat : common button component
heewls 6fd45f5
Feat : login UI
heewls 7addbf6
Feat : formField
heewls 00cce3c
Feat : auth layout
heewls eae642e
Feat : signup page UI
heewls a79cde9
Feat : errormessage & isValid
heewls 9079ee4
Feat : button disabeld css
heewls c95088c
Feat : api
heewls 98c9838
Feat : fetch api
heewls 4c6791c
Feat: button type extend
heewls ffd0849
Feat : authValidate
heewls 783cfcf
Feat : check all form complete
heewls 6f029ec
Feat : signup server action
heewls 47de8ec
Feat : signup form logic
heewls 3a4c6b0
Feat : router push login
heewls a0088b4
Feat : separeate validate & 400 nickname error
heewls 0bcffdf
Feat : apiClient & apiServer
heewls bfab735
Refactor : apply apiClient
heewls 68151e1
Feat : apply apiServer
heewls 3db3bec
Refactor : edit css
heewls d1738f6
Feat : status -> success
heewls b4d3167
Chore : rename
heewls 0ebee32
Chore : export default
heewls eed3e72
Feat : login logic
heewls 476eacb
Feat : login accessToken
heewls 6c71c6f
Fix : response data
heewls d5c2062
Fix : get boards return
heewls 5bf643e
Feat : label required
heewls bf4c2d0
Style : prettier
heewls d15f466
Style : textarea minHeight
heewls 8b6911c
Style : header
heewls 2ab2b9d
Feat : file input
heewls 6ac4116
Feat : add board UI
heewls b0d94d3
Fix : input required
heewls 3a41084
Fix : edit isJson
heewls 0ec3fa0
Fix : localstoarge & createFeachOptions url
heewls e38706d
Feat : add board route handler
heewls d986163
Feat : add board logic
heewls 3367d23
Feat : file logic
heewls 1a26da7
Feat : upload file
heewls 28e1910
Feat : refresh accessToken
heewls 6705809
Style : board layout
heewls af892a5
Fix : edit pathname
heewls 6c50e81
Style : bestItem width
heewls 90db46e
Feat : detail board
heewls 0421468
Feat: board comment input
heewls d043787
Feat : get comments
heewls 77c1df6
Feat : boardId page
heewls d13316b
Feat : zustand userId
heewls 5c3dc9c
Feat : post comment
heewls 929721b
Feat : action.ts
heewls a57870b
Style : bold32
heewls 23e1283
Feat : home page footer
heewls cde26c1
Feat : home page footer
heewls 8f5595d
Feat : home page
heewls 744dd07
Feat : link items
heewls 9b54049
Feat : edit active nav
heewls 71b0f08
Feat : default image invisible
heewls d741066
Feat : header user(using userId)
heewls 30eb49d
Fix : userId zustand -> localstorage
heewls e164756
Fix : delete layout user zustand
heewls 5270194
Feat : logout
heewls 71baddd
Feat : has accessToken redirect /
heewls 5c35e75
Feat : edit userId
heewls 223cb00
Feat : refresh accessToken
heewls File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "plugins": ["prettier-plugin-tailwindcss"] | ||
| } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import Image from "next/image"; | ||
| import Link from "next/link"; | ||
| import google from "@/public/icons/google.svg"; | ||
| import kakao from "@/public/icons/kakao.svg"; | ||
|
|
||
| interface FooterProps { | ||
| title: string; | ||
| href: string; | ||
| hrefMessage: string; | ||
| } | ||
|
|
||
| export default function AuthFooter({ title, href, hrefMessage }: FooterProps) { | ||
| return ( | ||
| <> | ||
| <div className="flex w-full items-center justify-between rounded-lg bg-[#e6f2ff] px-[23px] py-4"> | ||
| <p className="text-gray800 text-Regular16">간편 로그인하기</p> | ||
| <div className="flex gap-4"> | ||
| <Link href="https://www.google.com"> | ||
| <Image src={google} width={42} height={42} alt="google" /> | ||
| </Link> | ||
| <Link href="https://www.kakaocorp.com/page"> | ||
| <Image src={kakao} width={42} height={42} alt="kakao" /> | ||
| </Link> | ||
| </div> | ||
| </div> | ||
| <div className="text-Regular14 text-gray800 flex items-center justify-center"> | ||
| {title} | ||
| <Link className="text-blue ml-1 underline" href={href}> | ||
| {hrefMessage} | ||
| </Link> | ||
| </div> | ||
| </> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import Image from "next/image"; | ||
| import Link from "next/link"; | ||
| import { cookies } from "next/headers"; | ||
| import { redirect } from "next/navigation"; | ||
|
|
||
| export default async function AuthLayout({ | ||
| children, | ||
| }: { | ||
| children: React.ReactNode; | ||
| }) { | ||
| const cookie = await cookies(); | ||
| const accessToken = cookie.get("accessToken")?.value; | ||
|
|
||
| if (accessToken) { | ||
| redirect("/"); | ||
| } | ||
|
|
||
| return ( | ||
| <div className="flex h-screen items-center justify-center"> | ||
| <div className="flex w-[640px] flex-col items-center justify-center gap-10 px-4 sm:px-6"> | ||
| <Link className="flex items-center gap-5" href="/"> | ||
| <Image | ||
| src="/icons/panda.svg" | ||
| width={103} | ||
| height={103} | ||
| alt="logo" | ||
| className="hidden sm:block" | ||
| /> | ||
| <h1 className="font-rokaf text-blue text-[66px] font-bold"> | ||
| 판다마켓 | ||
| </h1> | ||
| </Link> | ||
| {children} | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import AuthFooter from "../_components/AuthFooter"; | ||
| import LoginForm from "@/components/Login/LoginForm"; | ||
|
|
||
| export default function Login() { | ||
| return ( | ||
| <div className="flex w-full flex-col gap-6"> | ||
| <LoginForm /> | ||
| <AuthFooter | ||
| href="/signup" | ||
| title="판다마켓이 처음이신가요?" | ||
| hrefMessage="회원가입" | ||
| /> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import SignupForm from "@/components/Signup/SignupForm"; | ||
| import AuthFooter from "../_components/AuthFooter"; | ||
|
|
||
| export default function Signup() { | ||
| return ( | ||
| <div className="flex w-full flex-col gap-6"> | ||
| <SignupForm /> | ||
| <AuthFooter | ||
| href="/login" | ||
| title="이미 회원이신가요?" | ||
| hrefMessage="로그인" | ||
| /> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import AddBoardForm from "@/components/AddBoard/AddBoardForm"; | ||
|
|
||
| export default function AddBoard() { | ||
| return ( | ||
| <div className="mt-6 flex h-full items-start justify-center px-4 sm:px-6"> | ||
| <AddBoardForm /> | ||
| </div> | ||
| ); | ||
| } |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 굿굿 적절한 동적 라우팅이예요 👍👍NextJs 라우팅을 잘 활용하고 계신데요? 😊😊 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import Image from "next/image"; | ||
| import Link from "next/link"; | ||
| import Comment from "@/components/Comment/Comment"; | ||
| import Button from "@/components/common/Button/Button"; | ||
| import DetailBoard from "@/components/DetailBoard/DetailBoard"; | ||
| import CommentList from "@/components/Comment/CommentList"; | ||
|
|
||
| export default async function DetailBoardPage({ | ||
| params, | ||
| }: { | ||
| params: Promise<{ id: string }>; | ||
| }) { | ||
| const { id } = await params; | ||
| const articleId = Number(id); | ||
|
|
||
| return ( | ||
| <> | ||
| <div className="flex flex-col gap-8"> | ||
| <DetailBoard articleId={articleId} /> | ||
| <Comment articleId={articleId} /> | ||
| <CommentList articleId={articleId} /> | ||
| </div> | ||
| <Link href="/board"> | ||
| <Button paddingX={64} paddingY={12} className="m-auto"> | ||
| 목록으로 돌아가기 | ||
| <Image | ||
| src="/icons/return.svg" | ||
| alt="return" | ||
| width={24} | ||
| height={24} | ||
| className="ml-1" | ||
| /> | ||
| </Button> | ||
| </Link> | ||
| </> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import { apiClient } from "@/lib/apiClient"; | ||
|
|
||
| export interface BoardItem { | ||
| updatedAt: string; | ||
| createdAt: string; | ||
| likeCount: number; | ||
| writer: { | ||
| nickname: string; | ||
| id: number; | ||
| }; | ||
| image: string; | ||
| content: string; | ||
| title: string; | ||
| id: number; | ||
| } | ||
|
|
||
| export interface Boards { | ||
| totalCount?: 0; | ||
| list: BoardItem[]; | ||
| } | ||
|
|
||
| interface Params { | ||
| page: number; | ||
| pageSize: number; | ||
| orderBy: string; | ||
| keyword: string; | ||
| } | ||
|
|
||
| export const INITIAL_BOARDS_VALUE = { | ||
| id: 0, | ||
| title: "", | ||
| content: "", | ||
| image: "", | ||
| likeCount: 0, | ||
| createdAt: "", | ||
| updatedAt: "", | ||
| writer: { | ||
| id: 0, | ||
| nickname: "", | ||
| }, | ||
| }; | ||
|
|
||
| export async function getBoards(params: Params) { | ||
| const { page, pageSize, orderBy, keyword } = params; | ||
| const query = new URLSearchParams({ | ||
| page: String(page), | ||
| pageSize: String(pageSize), | ||
| orderBy, | ||
| keyword, | ||
| }); | ||
|
|
||
| const response = await apiClient.get<Boards>(`/articles?${query}`); | ||
|
|
||
| return response.data; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| export default function PagesLayout({ | ||
| children, | ||
| }: { | ||
| children: React.ReactNode; | ||
| }) { | ||
| return ( | ||
| <div className="flex items-center justify-center"> | ||
| <div className="flex w-full max-w-[1200px] min-w-[343px] flex-col gap-10 px-4 py-5 md:p-6"> | ||
| {children} | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { Metadata } from "next"; | ||
| import { Suspense } from "react"; | ||
| import Best from "@/components/BestBoards/Best"; | ||
| import All from "@/components/AllBoards/All"; | ||
| import AllLoading from "@/components/AllBoards/Loading/AllLoading"; | ||
| import BestLoading from "@/components/BestBoards/Loading/BestLoading"; | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: "판다마켓 | 자유게시판", | ||
| }; | ||
|
|
||
| export const revalidate = 60; | ||
|
|
||
| export default async function Board() { | ||
| return ( | ||
| <> | ||
| <Suspense fallback={<BestLoading />}> | ||
| <Best /> | ||
| </Suspense> | ||
| <Suspense fallback={<AllLoading />}> | ||
| <All /> | ||
| </Suspense> | ||
| </> | ||
| ); | ||
| } |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import Header from "@/components/common/Header/Header"; | ||
|
|
||
| export default async function PagesLayout({ | ||
| children, | ||
| }: { | ||
| children: React.ReactNode; | ||
| }) { | ||
| return ( | ||
| <div className="flex h-screen flex-col"> | ||
| <Header /> | ||
| {children} | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import Image from "next/image"; | ||
| import Link from "next/link"; | ||
| import Button from "@/components/common/Button/Button"; | ||
| import HomeCardSection from "@/components/HomePage/HomeCardSection"; | ||
| import HomeFooter from "@/components/HomePage/HomeFooter"; | ||
|
|
||
| export default function HomePage() { | ||
| return ( | ||
| <div className="bg-white"> | ||
| <div className="mb-24"> | ||
| <div className="flex w-full items-end justify-center bg-[#CFE5FF] lg:h-[540px]"> | ||
| <div className="flex w-full flex-col items-center justify-center gap-20 overflow-x-hidden lg:flex-row lg:gap-0 lg:pl-2"> | ||
| <div className="mt-12 flex w-full shrink-0 flex-col items-center gap-6 lg:w-[357px] lg:items-start"> | ||
| <h1 className="text-bold32 text-gray700 md:text-bold40 text-center lg:text-left"> | ||
| 일상의 모든 물건을 | ||
| <br /> | ||
| 거래해 보세요 | ||
| </h1> | ||
| <Link href="/items"> | ||
| <Button paddingX={110} paddingY={16}> | ||
| <p className="text-semi18 sm:text-semi20 shrink-0"> | ||
| 구경하러가기 | ||
| </p> | ||
| </Button> | ||
| </Link> | ||
| </div> | ||
| <Image | ||
| src="/icons/hiPanda.svg" | ||
| alt="hi-panda" | ||
| width={730} | ||
| height={340} | ||
| className="h-auto w-full max-w-[730px] min-w-[448px]" | ||
| /> | ||
| </div> | ||
| </div> | ||
|
|
||
| <HomeCardSection /> | ||
| </div> | ||
|
|
||
| <div className="flex items-end justify-center bg-[#CFE5FF] lg:h-[540px]"> | ||
| <div className="mt-28 flex w-full max-w-300 flex-col items-center justify-between gap-40 px-5 lg:flex-row lg:gap-0"> | ||
| <p className="text-gray700 text-bold32 sm:text-bold40 shrink-0 text-center lg:text-left"> | ||
| 믿을 수 있는 | ||
| <br /> | ||
| 판다마켓 중고 거래 | ||
| </p> | ||
| <Image | ||
| src="/icons/twoPandas.svg" | ||
| alt="two-pandas" | ||
| width={746} | ||
| height={397} | ||
| className="h-auto w-full max-w-[746px] min-w-[375px]" | ||
| /> | ||
| </div> | ||
| </div> | ||
|
|
||
| <HomeFooter /> | ||
| </div> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오호 쿠키를 서버 사이드에서 읽고 대처하셨군요 ? 👍👍
굿굿. NextJS에서 서버사이드의 활용 방법을 잘 이해하신 것으로 보여요 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
layout.tsx에 설정하신 점도 인상깊네요.레이아웃의 nested 특징을 잘 살리셨네요. 이렇게 된다면
auth그룹 라우팅에 해당하는 곳들은 해당 레이아웃으로 인해 인가 된 유저들을 효과적으로 구별할 수 있겠어요 👍