-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 14-router-consumer
- Loading branch information
Showing
14 changed files
with
435 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_API_BASE_URL=https://diversity-api.tech4impact.kr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,111 @@ | ||
import { MapSVG, type MetroID, MetroInfo } from "@/../static/MapSVGData"; | ||
import { type ReactNode } from "react"; | ||
import { Dropdown, Flex } from "antd"; | ||
import { DownOutlined } from "@ant-design/icons"; | ||
import { css } from "@emotion/react"; | ||
|
||
interface Props { | ||
selected: MetroID; | ||
onClick?: (local: string) => void; | ||
} | ||
|
||
const LocalSelector = ({ selected, onClick = () => {} }: Props) => ( | ||
<svg | ||
version="1.1" | ||
id="Layer_1" | ||
xmlns="http://www.w3.org/2000/svg" | ||
xmlnsXlink="http://www.w3.org/1999/xlink" | ||
x="0px" | ||
y="0px" | ||
viewBox={MetroInfo[selected]?.viewBox || "0 0 509 716.1"} | ||
xmlSpace="preserve" | ||
> | ||
<style type="text/css"> | ||
{` | ||
.local{ | ||
fill: ${MetroInfo[selected]?.color || "#1c3f64"}; | ||
stroke: #1c3f64; | ||
stroke-width: 0.5px; | ||
-webkit-transition: | ||
fill 0.2s, | ||
stroke 0.2s | ||
} | ||
.local:hover{ | ||
fill: #1c3f64; | ||
<Flex vertical align="center"> | ||
<Dropdown | ||
menu={{ | ||
items: [ | ||
{ key: "1", label: "One" }, | ||
{ key: "2", label: "Two" }, | ||
{ type: "divider" }, | ||
{ key: "3", label: "Three" }, | ||
{ key: "4", label: "Four" }, | ||
], | ||
}} | ||
> | ||
<Flex | ||
justify="center" | ||
align="center" | ||
gap="small" | ||
css={css` | ||
@media (max-width: 768px) { | ||
width: 80%; | ||
} | ||
width: 30%; | ||
height: 20pt; | ||
border-radius: 5pt; | ||
background-color: white; | ||
`} | ||
</style> | ||
{MapSVG.map<ReactNode>(group => | ||
group.groupId === selected ? ( | ||
<g key={group.groupId}> | ||
{group.component.map(shape => { | ||
if (shape.type === `path`) { | ||
return ( | ||
<path | ||
key={shape.id} | ||
className="local" | ||
id={shape.id} | ||
d={shape.data} | ||
onClick={() => onClick(shape.id)} | ||
/> | ||
); | ||
} | ||
if (shape.type === `polygon`) { | ||
return ( | ||
<polygon | ||
key={shape.id} | ||
className="local" | ||
id={shape.id} | ||
points={shape.data} | ||
onClick={() => onClick(shape.id)} | ||
/> | ||
); | ||
} | ||
throw new Error(`${shape.id} is not path or polygon`); | ||
})} | ||
</g> | ||
) : ( | ||
<g key={group.groupId} /> | ||
), | ||
)} | ||
</svg> | ||
> | ||
기초 자치 단체 선택하기 | ||
<DownOutlined /> | ||
</Flex> | ||
</Dropdown> | ||
<div | ||
css={css` | ||
height: 15pt; | ||
`} | ||
/> | ||
<svg | ||
version="1.1" | ||
id="Layer_1" | ||
xmlns="http://www.w3.org/2000/svg" | ||
xmlnsXlink="http://www.w3.org/1999/xlink" | ||
x="0px" | ||
y="0px" | ||
viewBox={MetroInfo[selected]?.viewBox || "0 0 509 716.1"} | ||
xmlSpace="preserve" | ||
css={css` | ||
@media (max-width: 768px) { | ||
width: 80%; | ||
} | ||
width: 30%; | ||
.local { | ||
fill: ${MetroInfo[selected]?.color || "#4CC9F0"}; | ||
stroke: #080808; | ||
stroke-width: 1px; | ||
-webkit-transition: | ||
fill 0.2s, | ||
stroke 0.2s; | ||
} | ||
.local:hover { | ||
fill: #080808; | ||
} | ||
`} | ||
> | ||
{MapSVG.map<ReactNode>(group => | ||
group.groupId === selected ? ( | ||
<g key={group.groupId}> | ||
{group.component.map(shape => { | ||
if (shape.type === `path`) { | ||
return ( | ||
<path | ||
key={shape.id} | ||
className="local" | ||
id={shape.id} | ||
d={shape.data} | ||
onClick={() => onClick(shape.id)} | ||
/> | ||
); | ||
} | ||
if (shape.type === `polygon`) { | ||
return ( | ||
<polygon | ||
key={shape.id} | ||
className="local" | ||
id={shape.id} | ||
points={shape.data} | ||
onClick={() => onClick(shape.id)} | ||
/> | ||
); | ||
} | ||
throw new Error(`${shape.id} is not path or polygon`); | ||
})} | ||
</g> | ||
) : ( | ||
<g key={group.groupId} /> | ||
), | ||
)} | ||
</svg> | ||
</Flex> | ||
); | ||
export default LocalSelector; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
// organism 단계의 컴포넌트들을 한번에 export 하기 위한 index.ts 파일 | ||
export { default as Header } from "./Header"; | ||
export { default as Footer } from "./Footer"; | ||
export { default as Histogram } from "./Histogram"; | ||
export { default as PieChart } from "./PieChart"; | ||
export * from "./Histogram"; | ||
export * from "./PieChart"; | ||
export { default as TestChart } from "./TestChart"; | ||
export { default as MetroSelector } from "./MetroSelector"; | ||
export { default as LocalSelector } from "./LocalSelector"; |
Oops, something went wrong.