Skip to content

Commit

Permalink
style : 지도 편지 페이지 스타일 수정 (#329)
Browse files Browse the repository at this point in the history
* style : 편지 마커 수정

* style : 편지 클릭 시 나타나는 info 수정
  • Loading branch information
mmjjaa authored Dec 8, 2024
1 parent eb19fd0 commit 42ea75d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BottleLetter } from '@/components/Common/BottleLetter/BottleLetter';
import { NavLink } from 'react-router-dom';

type LetterInfoContainerProps = {
Expand All @@ -8,6 +9,7 @@ type LetterInfoContainerProps = {
daysLeft: number;
lat: number;
lot: number;
label: string;
};

export const LetterInfoContainer = ({
Expand All @@ -17,15 +19,17 @@ export const LetterInfoContainer = ({
date,
daysLeft,
lat,
lot
lot,
label
}: LetterInfoContainerProps) => {
const limitDistance = parseFloat(distance) <= 15;
const Letter = { label };

return (
<div className="flex flex-col w-[330px] bg-gray-200 rounded-lg p-4 shadow-md">
<div className="flex gap-4 mb-4">
<div className="p-2 bg-gray-300 rounded-md">
<img src="/bottle.png" alt="Bottle" className="w-20 h-20" />
<div className="p-2 bg-gray-300 rounded-md w-20 h-20">
<BottleLetter Letter={Letter} />
</div>
<div className="flex flex-col h-20">
<div className="gap-2 flex-center">
Expand Down
13 changes: 8 additions & 5 deletions src/components/MapPage/Maplibre/MaplibreWithSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useCurrentLocation } from '@/hooks/useCurrentLocation';
import { useNearbyLetters } from '@/hooks/useNearbyLetters';
import { NearbyLettersResponseType } from '@/types/letter';
import { useLocationState } from '@/hooks/useLocationState';
import { BottleLetter } from '@/components/Common/BottleLetter/BottleLetter';

type MaplibreWithSearchProps = {
onFocus: () => void;
Expand Down Expand Up @@ -92,16 +93,18 @@ export const MaplibreWithSearch = ({
latitude={letter.latitude}
>
<div
className="bg-gray-100 p-1 rounded-sm"
className="relative flex items-center justify-center w-8 h-8 bg-white rounded-full cursor-pointer transform"
onClick={(e) => {
e.stopPropagation();
toggleSelectedLetter(letter);
}}
>
<img
src="/bottle.png"
className="w-full h-5 rounded-lg"
/>
<div className="absolute top-1/2 left-1/2 w-10 h-10 bg-white rounded-full transform -translate-x-1/2 -translate-y-1/2">
<BottleLetter
Letter={{ label: letter.label }}
/>
</div>
<div className="absolute bottom-[-10px] left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-[6px] border-l-transparent border-r-[6px] border-r-transparent border-t-[6px] border-t-white"></div>
</div>
</Marker>
)
Expand Down
1 change: 1 addition & 0 deletions src/pages/Map/MapExplorerPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export const MapExplorerPage = () => {
daysLeft={daysLeft}
lat={selectedLetter.latitude}
lot={selectedLetter.longitude}
label={selectedLetter.label}
/>
</>
) : (
Expand Down

0 comments on commit 42ea75d

Please sign in to comment.