Skip to content

Commit

Permalink
feat: 지도 qa 수행
Browse files Browse the repository at this point in the history
  • Loading branch information
ooherin committed Dec 25, 2024
1 parent 00bcd96 commit 9d254ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ import roomInfoNonValidatedStore from '@/store/roomInfoNonValidatedStore';

const NearSubwayStations = () => {
const nearSubwayStation = useStore(roomInfoNonValidatedStore, state => state.nearSubwayStation);
const position = useStore(roomInfoNonValidatedStore, state => state.position);

return (
<FlexBox.Vertical gap="1.5rem">
<FormField.Label label="가까운 지하철" />
<FlexBox.Vertical gap="1rem">
<SubwayStations stations={nearSubwayStation} />
{!position.latitude ? (
<span>{'보신 방과 가까운 지하철역을 찾아드릴게요.'}</span>
) : (
<SubwayStations stations={nearSubwayStation ? nearSubwayStation : []} />
)}
</FlexBox.Vertical>
<FormField.BottomEmptyBox />
</FlexBox.Vertical>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/_common/Subway/SubwayStations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ interface Props {
const SubwayStations = ({ stations, size, textType = 'full' }: Props) => {
return (
<>
{stations?.length ? (
{stations && stations.length > 0 ? (
<S.Box>
{stations?.map(station => (
{stations.map(station => (
<SubwayStationItem textType={textType} size={size} station={station} key={station.stationName} />
))}
</S.Box>
) : (
<span>{'보신 방과 가까운 지하철역을 찾아드릴게요.'}</span>
<span>{'주변에 가까운 지하철역이 없어요.'}</span>
)}
</>
);
Expand Down
1 change: 1 addition & 0 deletions frontend/src/styles/subway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const SUBWAY_LINE_PALLETE = {
경강선: '#1C2B55',
서해선: '#21AC41',
GTX: '#212177',
'GTX-A': '#98618F',
};

export type SubwayLineName = keyof typeof SUBWAY_LINE_PALLETE;
Expand Down

0 comments on commit 9d254ba

Please sign in to comment.