Skip to content

Commit

Permalink
fead: crumb
Browse files Browse the repository at this point in the history
  • Loading branch information
songc04 committed Nov 28, 2023
1 parent 4af9a95 commit 7bf7c2e
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions src/components/organisms/MapSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,33 @@ const MapSelector = ({ idMap, type = "local" }: Props) => {
items={(
[
{
title: <a href="/localCouncil">뉴웨이즈 다양성 리포트</a>,
title: (
// eslint-disable-next-line jsx-a11y/anchor-is-valid
<a onClick={() => navigate("/localCouncil")}>

Check failure on line 46 in src/components/organisms/MapSelector.tsx

View workflow job for this annotation

GitHub Actions / Lint and Format (18.x)

Visible, non-interactive elements with click handlers must have at least one keyboard listener

Check failure on line 46 in src/components/organisms/MapSelector.tsx

View workflow job for this annotation

GitHub Actions / Lint and Format (18.x)

Avoid non-native interactive elements. If using native HTML is not possible, add an appropriate role and support for tabbing, mouse, keyboard, and touch inputs to an interactive content element
뉴웨이즈 다양성 리포트
</a>
),
},
] as { title: string | JSX.Element }[]
)
.concat(metroName ? [{ title: metroName }] : [])
.concat(
metroName
? [
{
title: (
// eslint-disable-next-line jsx-a11y/anchor-is-valid
<a

Check failure on line 59 in src/components/organisms/MapSelector.tsx

View workflow job for this annotation

GitHub Actions / Lint and Format (18.x)

Visible, non-interactive elements with click handlers must have at least one keyboard listener

Check failure on line 59 in src/components/organisms/MapSelector.tsx

View workflow job for this annotation

GitHub Actions / Lint and Format (18.x)

Avoid non-native interactive elements. If using native HTML is not possible, add an appropriate role and support for tabbing, mouse, keyboard, and touch inputs to an interactive content element
onClick={() =>
navigate(`/localCouncil/${metroName}`)
}
>
{metroName}
</a>
),
},
]
: [],
)
.concat(localName ? [{ title: localName }] : [])}
/>
</div>
Expand All @@ -59,10 +81,10 @@ const MapSelector = ({ idMap, type = "local" }: Props) => {
<DropdownSelector
innerText="기초 의회를 선택하세요."
options={[...(idMap.get(metroName as MetroID)?.keys() || [])]}
onClick={localName => {
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}`);
}}
/>
<div
Expand All @@ -84,10 +106,10 @@ const MapSelector = ({ idMap, type = "local" }: Props) => {
</Flex>
<LocalSelector
selected={metroName as MetroID}
onClick={localName => {
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}`);
}}
/>
</>
Expand Down

0 comments on commit 7bf7c2e

Please sign in to comment.