From 4af9a95d8cf34e4d520fb4619df09eb969db732e Mon Sep 17 00:00:00 2001 From: songc04 Date: Tue, 28 Nov 2023 22:02:19 +0900 Subject: [PATCH 1/4] fead: crumb --- src/components/organisms/MapSelector.tsx | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/components/organisms/MapSelector.tsx b/src/components/organisms/MapSelector.tsx index 6dbdeac..c800c8e 100644 --- a/src/components/organisms/MapSelector.tsx +++ b/src/components/organisms/MapSelector.tsx @@ -1,4 +1,4 @@ -import { Button, Flex } from "antd"; +import { Button, Flex, Breadcrumb } from "antd"; import { css } from "@emotion/react"; import { LocalSelector, @@ -15,7 +15,7 @@ interface Props { } const MapSelector = ({ idMap, type = "local" }: Props) => { - const { metroName } = useParams(); + const { metroName, localName } = useParams(); const navigate = useNavigate(); return ( @@ -30,6 +30,25 @@ const MapSelector = ({ idMap, type = "local" }: Props) => { > {metroName && type === "local" ? ( <> +
+ 뉴웨이즈 다양성 리포트, + }, + ] as { title: string | JSX.Element }[] + ) + .concat(metroName ? [{ title: metroName }] : []) + .concat(localName ? [{ title: localName }] : [])} + /> +
Date: Tue, 28 Nov 2023 22:10:43 +0900 Subject: [PATCH 2/4] fead: crumb --- src/components/organisms/MapSelector.tsx | 38 +++++++++++++++++++----- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/components/organisms/MapSelector.tsx b/src/components/organisms/MapSelector.tsx index c800c8e..f9de8b6 100644 --- a/src/components/organisms/MapSelector.tsx +++ b/src/components/organisms/MapSelector.tsx @@ -41,11 +41,33 @@ const MapSelector = ({ idMap, type = "local" }: Props) => { items={( [ { - title: 뉴웨이즈 다양성 리포트, + title: ( + // eslint-disable-next-line jsx-a11y/anchor-is-valid + navigate("/localCouncil")}> + 뉴웨이즈 다양성 리포트 + + ), }, ] as { title: string | JSX.Element }[] ) - .concat(metroName ? [{ title: metroName }] : []) + .concat( + metroName + ? [ + { + title: ( + // eslint-disable-next-line jsx-a11y/anchor-is-valid + + navigate(`/localCouncil/${metroName}`) + } + > + {metroName} + + ), + }, + ] + : [], + ) .concat(localName ? [{ title: localName }] : [])} /> @@ -59,10 +81,10 @@ const MapSelector = ({ idMap, type = "local" }: Props) => { { - const idData = idMap.get(metroName as MetroID)?.get(localName); + onClick={local => { + const idData = idMap.get(metroName as MetroID)?.get(local); if (!idData) return; - navigate(`/localCouncil/${metroName}/${localName}`); + navigate(`/localCouncil/${metroName}/${local}`); }} />
{ { - const idData = idMap.get(metroName as MetroID)?.get(localName); + onClick={local => { + const idData = idMap.get(metroName as MetroID)?.get(local); if (!idData) return; - navigate(`/localCouncil/${metroName}/${localName}`); + navigate(`/localCouncil/${metroName}/${local}`); }} /> From bf442ebfe941a2eb14e1347ec02f6d3269d99799 Mon Sep 17 00:00:00 2001 From: songc04 Date: Tue, 28 Nov 2023 22:15:56 +0900 Subject: [PATCH 3/4] fix: linter check --- src/components/organisms/MapSelector.tsx | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/components/organisms/MapSelector.tsx b/src/components/organisms/MapSelector.tsx index f9de8b6..6bff4c1 100644 --- a/src/components/organisms/MapSelector.tsx +++ b/src/components/organisms/MapSelector.tsx @@ -43,32 +43,25 @@ const MapSelector = ({ idMap, type = "local" }: Props) => { { title: ( // eslint-disable-next-line jsx-a11y/anchor-is-valid - navigate("/localCouncil")}> - 뉴웨이즈 다양성 리포트 - + 뉴웨이즈 다양성 리포트 ), + onClick: () => navigate(`/localCouncil`), }, - ] as { title: string | JSX.Element }[] + ] as { title: string | JSX.Element; onClick: () => void }[] ) .concat( metroName ? [ { - title: ( - // eslint-disable-next-line jsx-a11y/anchor-is-valid - - navigate(`/localCouncil/${metroName}`) - } - > - {metroName} - - ), + title: {metroName}, + onClick: () => navigate(`/localCouncil/${metroName}`), }, ] : [], ) - .concat(localName ? [{ title: localName }] : [])} + .concat( + localName ? [{ title: localName, onClick: () => {} }] : [], + )} />
Date: Tue, 28 Nov 2023 22:18:23 +0900 Subject: [PATCH 4/4] fix: linter check --- src/components/organisms/MapSelector.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/organisms/MapSelector.tsx b/src/components/organisms/MapSelector.tsx index 6bff4c1..e3129c6 100644 --- a/src/components/organisms/MapSelector.tsx +++ b/src/components/organisms/MapSelector.tsx @@ -53,6 +53,7 @@ const MapSelector = ({ idMap, type = "local" }: Props) => { metroName ? [ { + // eslint-disable-next-line jsx-a11y/anchor-is-valid title: {metroName}, onClick: () => navigate(`/localCouncil/${metroName}`), },