diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5dc21b8..e8702c2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,12 +5,12 @@ settings: excludeLinksFromLockfile: false dependencies: + '@react-spring/web': + specifier: ^9.7.3 + version: 9.7.3(react-dom@18.2.0)(react@18.2.0) clsx: specifier: ^2.0.0 version: 2.0.0 - econo-image-cache: - specifier: ^0.1.0 - version: 0.1.0(react@18.2.0) gsap: specifier: ^3.12.1 version: 3.12.1 @@ -61,9 +61,6 @@ dependencies: version: 5.1.6 devDependencies: - '@react-spring/web': - specifier: ^9.7.3 - version: 9.7.3(react-dom@18.2.0)(react@18.2.0) '@types/lodash': specifier: ^4.14.195 version: 4.14.195 @@ -399,7 +396,7 @@ packages: '@react-spring/shared': 9.7.3(react@18.2.0) '@react-spring/types': 9.7.3 react: 18.2.0 - dev: true + dev: false /@react-spring/core@9.7.3(react@18.2.0): resolution: {integrity: sha512-IqFdPVf3ZOC1Cx7+M0cXf4odNLxDC+n7IN3MDcVCTIOSBfqEcBebSv+vlY5AhM0zw05PDbjKrNmBpzv/AqpjnQ==} @@ -410,7 +407,7 @@ packages: '@react-spring/shared': 9.7.3(react@18.2.0) '@react-spring/types': 9.7.3 react: 18.2.0 - dev: true + dev: false /@react-spring/shared@9.7.3(react@18.2.0): resolution: {integrity: sha512-NEopD+9S5xYyQ0pGtioacLhL2luflh6HACSSDUZOwLHoxA5eku1UPuqcJqjwSD6luKjjLfiLOspxo43FUHKKSA==} @@ -419,11 +416,11 @@ packages: dependencies: '@react-spring/types': 9.7.3 react: 18.2.0 - dev: true + dev: false /@react-spring/types@9.7.3: resolution: {integrity: sha512-Kpx/fQ/ZFX31OtlqVEFfgaD1ACzul4NksrvIgYfIFq9JpDHFwQkMVZ10tbo0FU/grje4rcL4EIrjekl3kYwgWw==} - dev: true + dev: false /@react-spring/web@9.7.3(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-BXt6BpS9aJL/QdVqEIX9YoUy8CE6TJrU0mNCqSoxdXlIeNcEBWOfIyE6B14ENNsyQKS3wOWkiJfco0tCr/9tUg==} @@ -437,7 +434,7 @@ packages: '@react-spring/types': 9.7.3 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - dev: true + dev: false /@rushstack/eslint-patch@1.6.0: resolution: {integrity: sha512-2/U3GXA6YiPYQDLGwtGlnNgKYBSwCFIHf8Y9LUY5VATHdtbLlU0Y1R3QoBnT0aB4qv/BEiVVsj7LJXoQCgJ2vA==} @@ -1376,14 +1373,6 @@ packages: esutils: 2.0.3 dev: true - /econo-image-cache@0.1.0(react@18.2.0): - resolution: {integrity: sha512-pYBJu6uZ6NPVkSyv07aToNDCbhDfTioIGTwdY3hmLPHuDrjePREcrdtFqua+yiI5OKtOxmh5ggpJkYAU4TmnFg==} - peerDependencies: - react: ^18.2.0 - dependencies: - react: 18.2.0 - dev: false - /electron-to-chromium@1.4.460: resolution: {integrity: sha512-kKiHnbrHME7z8E6AYaw0ehyxY5+hdaRmeUbjBO22LZMdqTYCO29EvF0T1cQ3pJ1RN5fyMcHl1Lmcsdt9WWJpJQ==} dev: true @@ -3383,6 +3372,7 @@ packages: loose-envify: 1.4.0 react: 18.2.0 scheduler: 0.23.0 + dev: false /react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} @@ -3405,6 +3395,7 @@ packages: engines: {node: '>=0.10.0'} dependencies: loose-envify: 1.4.0 + dev: false /read-cache@1.0.0: resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} @@ -3542,6 +3533,7 @@ packages: resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} dependencies: loose-envify: 1.4.0 + dev: false /schema-utils@3.3.0: resolution: {integrity: sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==} @@ -3703,9 +3695,6 @@ packages: /sqlite3@5.1.6: resolution: {integrity: sha512-olYkWoKFVNSSSQNvxVUfjiVbz3YtBwTJj+mfV5zpHmqW3sELx2Cf4QCdirMelhM5Zh+KDVaKgQHqCxrqiWHybw==} requiresBuild: true - peerDependenciesMeta: - node-gyp: - optional: true dependencies: '@mapbox/node-pre-gyp': 1.0.11 node-addon-api: 4.3.0 diff --git a/src/components/common/Hamberger.tsx b/src/components/common/Hamberger.tsx index da90952..09ccabb 100644 --- a/src/components/common/Hamberger.tsx +++ b/src/components/common/Hamberger.tsx @@ -8,9 +8,10 @@ import econovationWhiteLogo from "/public/images/econovation-white.svg"; import { LinkTo } from "./LinkTo"; import { cn } from "@/src/functions/util"; import { Icon } from "./Icon"; +import { URLS } from "@/src/constants/url.ko"; interface HambergerChildMenuProps { - hamburgerChildData: { NAME: string; LINK: string }[]; + hamburgerChildData: { NAME: string; LINK: keyof typeof URLS }[]; isOpen: boolean; } diff --git a/src/components/common/LinkTo.tsx b/src/components/common/LinkTo.tsx index 92bd942..0a1dc2c 100644 --- a/src/components/common/LinkTo.tsx +++ b/src/components/common/LinkTo.tsx @@ -10,7 +10,7 @@ import Link from "next/link"; import { cn } from "@/src/functions/util"; interface LinkToProps { - link: string; + link: keyof typeof URLS; className?: string; children: ReactElement[] | ReactElement | string[] | string; onClick?: () => void; @@ -27,16 +27,12 @@ export const LinkTo: FC = ({ const setIsLoading = useSetAtom(loadingState); const router = useRouter(); const viewLoading = debounce(() => { - router.push(URLS[link as keyof typeof URLS].LINK); + router.push(URLS[link].LINK); }, 600); return ( { - e.preventDefault(); - if (target === "_blank") { - return window.open(URLS[link as keyof typeof URLS].LINK); - } + href={URLS[link].LINK} + onClick={() => { setIsLoading(true); onClick && onClick(); viewLoading(); diff --git a/src/components/portfolio/Navbar.tsx b/src/components/portfolio/Navbar.tsx index e3548a8..8aa6858 100644 --- a/src/components/portfolio/Navbar.tsx +++ b/src/components/portfolio/Navbar.tsx @@ -135,15 +135,13 @@ export const PortfolioNavbar = () => {
{PORTFOLIO_MENU.map((menu, index) => ( - { -
- {menu.NAME} -
- } +
+ {menu.NAME} +
))}
diff --git a/src/components/recruit/Recruit.tsx b/src/components/recruit/Recruit.tsx index 52ada4a..9244309 100644 --- a/src/components/recruit/Recruit.tsx +++ b/src/components/recruit/Recruit.tsx @@ -19,22 +19,22 @@ export const Recruit = () => { }, []); return ( -
+
-

+

{RECRUIT.TITLE}

-
+
{RECRUIT.CONTENT.split("\n").map((d, i) => (
{d}
))}
{RECRUIT.IS_ON && ( - )}
-
+
{RECRUIT.SCHEDULE.map((d, i) => (
-
{d.DATE}
-
-
{d.TEXT}
+
{d.DATE}
+
+
{d.TEXT}
))}
diff --git a/src/components/recruit/Subscription.tsx b/src/components/recruit/Subscription.tsx index 502b58d..208fa1e 100644 --- a/src/components/recruit/Subscription.tsx +++ b/src/components/recruit/Subscription.tsx @@ -6,22 +6,22 @@ const { SUBSCRIPTION } = RECRUIT; export const Subscription = () => { return ( -
-

+
+

{SUBSCRIPTION.TITLE}

{SUBSCRIPTION.CONTENTS.map((d, i) => (
{d.TITLE}
{d.LINK ? ( { "" )}
-
+
{d.CONTENT.split("\n").map((cd, ci) => (
{cd}
))} diff --git a/src/constants/common.ko.ts b/src/constants/common.ko.ts index f0d81b1..4489e30 100644 --- a/src/constants/common.ko.ts +++ b/src/constants/common.ko.ts @@ -1,4 +1,5 @@ import { PORTFOLIO_MENU } from "./portfolio/portfolio.ko"; +import { URLS } from "./url.ko"; const MAIN = { SUBTITLE: "coding connected", @@ -9,13 +10,13 @@ const FOOTER = { CONTACT: [ { NAME: "kakao", LINK: "KAKAO_LINK" }, { NAME: "e-mail", LINK: "EMAIL_LINK" }, - ], + ] as { NAME: string; LINK: keyof typeof URLS }[], SOCIAL: [ { NAME: "instagram", LINK: "INSTAGRAM_LINK" }, { NAME: "facebook", LINK: "FACEBOOK_LINK" }, { NAME: "medium", LINK: "MEDIUM_LINK" }, { NAME: "youtube", LINK: "YOUTUBE_LINK" }, - ], + ] as { NAME: string; LINK: keyof typeof URLS }[], ADDRESS: { EN: "77. youngbong-ro, buk-gu, gwangju, republic of korea", KO: "전남대학교 정보화본부 101호", @@ -56,27 +57,31 @@ const HAMBGER_MENU = { }, { NAME: "recruit", LINK: "RECRUIT" }, { NAME: "contact", LINK: "CONTACT" }, - ], + ] as { + NAME: string; + LINK: keyof typeof URLS; + CHILDREN?: { NAME: string; LINK: keyof typeof URLS }[]; + }[], }; const SERVICES = { ECONOVATION_DEV: { TITLE: "econovation dev", TITLE_KO: "지난 데브 다시보기", - LINK: "PORTFOLIO_DEV", + LINK: "PORTFOLIO_DEV" as keyof typeof URLS, }, ECONO_RECRUIT: { TITLE: "econo recruit", TITLE_KO: "에코노베이션 신입모집 TF", SUBTITLE: "member only", SUBTITLE_KO: "회원 전용 페이지", - LINK: "ECONO_RECRUIT", + LINK: "ECONO_RECRUIT" as keyof typeof URLS, }, OTHER: [ { TITLE: "EEOS", TITLE_KO: "에코노베이션 행사 관리 시스템", - LINK: "EEOS", + LINK: "EEOS" as keyof typeof URLS, }, ], }; diff --git a/src/constants/main.ko.ts b/src/constants/main.ko.ts index 7717c9f..34554a9 100644 --- a/src/constants/main.ko.ts +++ b/src/constants/main.ko.ts @@ -5,6 +5,7 @@ import Head4 from "@/public/home/head_4.png"; import Pation from "@/public/home/passion.jpg"; import Communication from "@/public/home/communication.jpg"; import Faithful from "@/public/home/faithful.jpg"; +import { URLS } from "./url.ko"; const ECONOVATION = "econovation"; @@ -65,7 +66,13 @@ const MISSION = [ }, ]; -const MAIN_NAV = [ +interface MainNavType { + NAME: string; + LINK: keyof typeof URLS; + POSITION: "left" | "right"; +} + +const MAIN_NAV: MainNavType[] = [ { NAME: "home", LINK: "HOME", diff --git a/src/constants/portfolio/portfolio.ko.ts b/src/constants/portfolio/portfolio.ko.ts index 0f2989e..121310b 100644 --- a/src/constants/portfolio/portfolio.ko.ts +++ b/src/constants/portfolio/portfolio.ko.ts @@ -1,3 +1,4 @@ +import { URLS } from "../url.ko"; import { winter2020 } from "./ko/2019-2"; import { summer2020 } from "./ko/2020-1"; import { winter2021 } from "./ko/2020-2"; @@ -21,7 +22,12 @@ const PORTFOLIO = { ], }; -const PORTFOLIO_MENU = [ +interface PortfolioMenuType { + NAME: string; + LINK: keyof typeof URLS; +} + +const PORTFOLIO_MENU: PortfolioMenuType[] = [ { NAME: "DEV", LINK: "PORTFOLIO_DEV" }, { NAME: "HACKATHON", LINK: "PORTFOLIO_HACKATHON" }, { NAME: "SERVICE", LINK: "PORTFOLIO_SERVICE" }, diff --git a/src/constants/recruit/recruit.ko.ts b/src/constants/recruit/recruit.ko.ts index 7b5adf9..079e8f6 100644 --- a/src/constants/recruit/recruit.ko.ts +++ b/src/constants/recruit/recruit.ko.ts @@ -1,3 +1,5 @@ +import { URLS } from "../url.ko"; + const RECRUIT = { TITLE: "recruit", CONTENT: @@ -73,7 +75,7 @@ const RECRUIT = { CONTENTS: [ { TITLE: "주간 발표 참석", - LINK: "WEEK_ANOUNCE_REFERENCE", + LINK: "WEEK_ANOUNCE_REFERENCE" as keyof typeof URLS, CONTENT: "에코노베이션 활동회원은 매주 금요일\n주간 발표에 필수로 참여해야 합니다.", SUBCONTENT: @@ -81,7 +83,7 @@ const RECRUIT = { }, { TITLE: "최종 발표 DEV", - LINK: "LAST_ANOUNCE_VIDEO", + LINK: "LAST_ANOUNCE_VIDEO" as keyof typeof URLS, CONTENT: "활동 회원은 1월, 7월에 진행하는\n최종발표인 DEV에 참여해야 합니다.", SUBCONTENT: