Skip to content

Commit a10a04e

Browse files
authored
refactor: 패널 빈 공간 제거 및 버스 아이콘 대치 및 패널 내 아이콘, 텍스트 정렬 (#28)
* refactor: 패널 빈 공간 제거 및 버스 아이콘 추가 * refactor: 버스 아이콘 대치 및 패널 아이콘 텍스트 정렬 적용
1 parent f3036dc commit a10a04e

5 files changed

Lines changed: 36 additions & 11 deletions

File tree

src/assets/busIcon.svg

Lines changed: 12 additions & 0 deletions
Loading

src/components/BusStops.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { Bus, ChevronDown } from "lucide-react";
1+
import { ChevronDown } from "lucide-react";
22
import { useEffect, useId, useRef, useState } from "react";
33
import type { BusStop } from "../data/busStops";
4+
import busIconSvg from "../assets/busIcon.svg";
45

56
type Props = {
67
busStops: BusStop[];
@@ -74,7 +75,7 @@ export default function BusStops({
7475
className="group inline-flex w-full cursor-pointer items-center justify-between gap-3 rounded-lg border-0 bg-transparent px-4 py-3 transition-all duration-200 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-60"
7576
>
7677
<div className="inline-flex items-center gap-3">
77-
<div className="flex-shrink-0 transition-transform duration-200 group-hover:scale-110">
78+
<div className="flex h-8 w-8 flex-shrink-0 items-center justify-center transition-transform duration-200 group-hover:scale-110">
7879
<svg
7980
width="32"
8081
height="32"
@@ -155,10 +156,11 @@ export default function BusStops({
155156
className="group inline-flex w-full cursor-pointer items-center justify-between gap-3 rounded-lg border-0 bg-transparent px-4 py-3 transition-all duration-200 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-60"
156157
>
157158
<div className="inline-flex items-center gap-3">
158-
<div className="flex-shrink-0 transition-transform duration-200 group-hover:scale-110">
159-
<Bus
160-
className="h-8 w-8 text-blue-600"
161-
strokeWidth={2.5}
159+
<div className="flex h-8 w-8 flex-shrink-0 items-center justify-center transition-transform duration-200 group-hover:scale-110">
160+
<img
161+
src={busIconSvg}
162+
alt="버스"
163+
style={{ width: "20px", height: "38px" }}
162164
/>
163165
</div>
164166
<span

src/components/BusStopsPanel.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,18 @@ export const BusStopsPanel = ({
1717
return (
1818
<div
1919
style={{
20+
position: "fixed",
21+
left: 0,
22+
right: 0,
23+
bottom: 0,
24+
zIndex: 50,
2025
padding: "10px",
2126
display: "flex",
2227
alignItems: "center",
2328
gap: "8px",
2429
backgroundColor: "#f5f5f5",
2530
borderTop: "1px solid #ddd",
31+
boxShadow: "0 -6px 20px rgba(0,0,0,0.08)",
2632
}}
2733
>
2834
<BusStops

src/components/MapContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const MapContainer = ({
2525
useMapEventHandlers(mapId);
2626

2727
return (
28-
<div id={mapId} style={{ height: "70vh", width: "100vw" }}>
28+
<div id={mapId} style={{ flex: 1, width: "100%", minHeight: 200 }}>
2929
{children}
3030
</div>
3131
);

src/utils/mapOverlays.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Bus } from "../data/bus";
22
import type { BusStop } from "../data/busStops";
3+
import busIconSvg from "../assets/busIcon.svg";
34

45
export interface OverlayHandle {
56
setMap: (map: unknown) => void;
@@ -168,17 +169,21 @@ export const createBusOverlays = (
168169

169170
return buses.map((bus) => {
170171
const busDiv = document.createElement("div");
171-
busDiv.style.width = "32px";
172-
busDiv.style.height = "32px";
172+
busDiv.style.width = "24px";
173+
busDiv.style.height = "46px";
173174
busDiv.style.display = "flex";
174175
busDiv.style.alignItems = "center";
175176
busDiv.style.justifyContent = "center";
176177
busDiv.style.cursor = "pointer";
177178
busDiv.setAttribute("role", "img");
178179
busDiv.setAttribute("aria-label", bus.shuttleId || "bus");
179180

180-
const iconSVG = createIconSVG("bus");
181-
busDiv.appendChild(iconSVG);
181+
const img = document.createElement("img");
182+
img.src = busIconSvg;
183+
img.alt = "버스";
184+
img.style.width = "24px";
185+
img.style.height = "46px";
186+
busDiv.appendChild(img);
182187

183188
const busPosition = new window.kakao.maps.LatLng(bus.lat, bus.lng);
184189
const busOverlay = new window.kakao.maps.CustomOverlay({

0 commit comments

Comments
 (0)