-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: current generation 업데이트 #157
Changes from 1 commit
aa8e604
92039da
e61bbc3
0301d45
425ca8c
cf534d4
52f4ff1
72d58e6
e9c5ec5
a702b1e
df9f627
b2a22ef
f9343d9
3170bf6
fa560d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ const KanbanBoardDetailPage = ({ | |
return ( | ||
<main className="flex mt-8 overflow-auto pt-12 pl-12"> | ||
<KanbanColumnDetailCard | ||
columnIndex={+columnIndex ?? 0} | ||
columnIndex={+(columnIndex ?? 0)} | ||
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.
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. 아이고 맞네요.. 수정하도록 하겠습니다! 제가 이전에 몇번의 삽질을 했었는데요, |
||
generation={generation} | ||
cardId={cardId} | ||
applicantId={applicantId} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,12 @@ import NavbarUserInfo from "./UserInfo"; | |
import { NavbarOperation } from "./NavbarOperation"; | ||
import Link from "next/link"; | ||
import { usePathname } from "next/navigation"; | ||
import { NavbarToggle } from "./NavbarToggle"; | ||
|
||
interface CommonNavbarProps { | ||
generation: string; | ||
} | ||
|
||
const CommonNavbar = ({ generation }: CommonNavbarProps) => { | ||
const currentPath = usePathname().split("/")[1]; | ||
const isShort = currentPath === "kanban"; | ||
const CommonNavbar = () => { | ||
const currentPath = usePathname(); | ||
const isShort = currentPath.split("/")[1] === "kanban"; | ||
const generation = currentPath.split("/")[2]; | ||
|
||
return ( | ||
<nav className="flex flex-col transition-all"> | ||
|
@@ -25,10 +23,11 @@ const CommonNavbar = ({ generation }: CommonNavbarProps) => { | |
<div>{generation}th</div> | ||
</Link> | ||
<div className="flex flex-col gap-8 mt-8 text-xl"> | ||
{MainNavbar.map((item) => ( | ||
{MainNavbar(+generation).map((item) => ( | ||
<CommonNavbarCell key={item.type} item={item} /> | ||
))} | ||
<NavbarOperation generation={generation} /> | ||
<NavbarToggle /> | ||
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. Toggle이라.. 맞는거 같지만 더 좋은 이름이 없을까유?? 항상 이런 부분이 어려운거 같네요 ㅠㅠ 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. 맞아요.. 사실 토글이긴 한데 보여질 기수를 변경해주는 토글이니 |
||
<NavbarOperation /> | ||
</div> | ||
<NavbarUserInfo /> | ||
</nav> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { usePathname } from "next/navigation"; | ||
import CommonNavbarCell from "./NavbarCell"; | ||
import { CURRENT_GENERATION } from "@/src/constants"; | ||
|
||
export const NavbarToggle = () => { | ||
const currentPath = usePathname(); | ||
const selectedGeneration = +currentPath.split("/")[2]; | ||
|
||
const isCurrentGeneration = selectedGeneration === CURRENT_GENERATION; | ||
const generation = isCurrentGeneration | ||
? CURRENT_GENERATION - 1 | ||
: CURRENT_GENERATION; | ||
|
||
const short_title = isCurrentGeneration ? "지난 모집" : "현재 모집"; | ||
const title = isCurrentGeneration | ||
? "지난 신입모집 보기" | ||
: "현재 신입모집 보기"; | ||
|
||
return ( | ||
<CommonNavbarCell | ||
item={{ | ||
href: `/kanban/${generation}`, | ||
short_title, | ||
title, | ||
target: "_self", | ||
type: "toggle", | ||
}} | ||
/> | ||
); | ||
}; |
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.
type import를 사용해봅시다 :)
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.
넵 수정하겠습니다!