diff --git a/src/components/company/CompanyTitle.tsx b/src/components/company/CompanyTitle.tsx index a8b33e8..d282b62 100644 --- a/src/components/company/CompanyTitle.tsx +++ b/src/components/company/CompanyTitle.tsx @@ -1,6 +1,6 @@ "use client"; -import { GetCompanyKebabItems } from "@/util/object/kebabMenuItems"; +import { getCompanyKebabItems } from "@/util/object/kebabMenuItems"; import { KebabItemType } from "@/util/type/kebabMenu"; import Image from "next/image"; import KebabMenu from "../common/Dropdown/KebabMenu"; @@ -22,7 +22,7 @@ export default function CompanyTitle({ onClickInterview, children, }: PropsType) { - const kebabItems = GetCompanyKebabItems( + const kebabItems = getCompanyKebabItems( onClickRecruitments, onClickInterview ); diff --git a/src/components/mypage/DetailProfile.tsx b/src/components/mypage/DetailProfile.tsx index 448e7c8..31c9b6d 100644 --- a/src/components/mypage/DetailProfile.tsx +++ b/src/components/mypage/DetailProfile.tsx @@ -2,7 +2,7 @@ import { MyProfile } from "@/apis/students"; import { departmentEnum } from "@/util/object/enum"; -import { mypageKebabItems } from "@/util/object/kebabMenuItems"; +import { getMypageKebabItems } from "@/util/object/kebabMenuItems"; import Image from "next/image"; import KebabMenu from "../common/Dropdown/KebabMenu"; import GhostTag from "./GhostTag"; @@ -33,7 +33,7 @@ export default function DetailProfile() { {profile && departmentEnum[profile.department]}

- + ); } diff --git a/src/util/object/kebabMenuItems.ts b/src/util/object/kebabMenuItems.ts index 49c8820..a649d5c 100644 --- a/src/util/object/kebabMenuItems.ts +++ b/src/util/object/kebabMenuItems.ts @@ -3,56 +3,53 @@ import { useRouter } from "next/navigation"; import { Cookies } from "react-cookie"; import { KebabItemType } from "../type/kebabMenu"; -export const mypageKebabItems: KebabItemType[] = [ - { - label: "프로필 수정", - onClick: () => { - const { append } = useToastStore(); - append({ - title: "", - message: "개발 중인 기능입니다.", - type: "YELLOW", - }); +export const getMypageKebabItems = (): KebabItemType[] => { + const { append } = useToastStore(); + const navigator = useRouter(); + const cookies = new Cookies(); + return [ + { + label: "프로필 수정", + onClick: () => { + append({ + title: "", + message: "개발 중인 기능입니다.", + type: "YELLOW", + }); + }, }, - }, - { - label: "비밀변호 변경", - onClick: () => { - const { append } = useToastStore(); - - append({ - title: "", - message: "개발 중인 기능입니다.", - type: "YELLOW", - }); + { + label: "비밀변호 변경", + onClick: () => { + append({ + title: "", + message: "개발 중인 기능입니다.", + type: "YELLOW", + }); + }, }, - }, - { - label: "버그 제보하기", - onClick: () => { - const { append } = useToastStore(); - - append({ - title: "", - message: "개발 중인 기능입니다.", - type: "YELLOW", - }); + { + label: "버그 제보하기", + onClick: () => { + append({ + title: "", + message: "개발 중인 기능입니다.", + type: "YELLOW", + }); + }, }, - }, - { - label: "로그아웃", - onClick: () => { - const navigator = useRouter(); - const cookies = new Cookies(); - - navigator.push("/account/login"); - cookies.remove("access_token"); - cookies.remove("refresh_token"); + { + label: "로그아웃", + onClick: () => { + navigator.push("/account/login"); + cookies.remove("access_token"); + cookies.remove("refresh_token"); + }, }, - }, -]; + ]; +}; -export const GetCompanyKebabItems = ( +export const getCompanyKebabItems = ( onClickRecruitments?: () => void, onClickInterview?: () => void ): KebabItemType[] => {