diff --git a/apps/frontend/src/components/AddReviewDialog.tsx b/apps/frontend/src/components/AddReviewDialog.tsx index 9d7cf0d..38dfe28 100644 --- a/apps/frontend/src/components/AddReviewDialog.tsx +++ b/apps/frontend/src/components/AddReviewDialog.tsx @@ -4,11 +4,13 @@ import { useMutation, useQueryClient } from '@tanstack/react-query' import { graphqlFetch } from '#/graphql/client' import { CREATE_REVIEW } from '#/graphql/venues' +import { assetUrl } from '#/lib/asset-url' import type { VenueReview } from '#/types/venue' const USERNAME_STORAGE_KEY = 'g-spotter:review-username' const BODY_MAX_LENGTH = 1000 const RATING_VALUES = [1, 2, 3, 4, 5] +const HARP_SRC = assetUrl('harp.svg') interface ReviewInput { venueId: string @@ -110,7 +112,7 @@ export default function AddReviewDialog({ diff --git a/apps/frontend/src/components/Header.tsx b/apps/frontend/src/components/Header.tsx index 816e8ae..85016ca 100644 --- a/apps/frontend/src/components/Header.tsx +++ b/apps/frontend/src/components/Header.tsx @@ -8,7 +8,7 @@ export default function Header() {
G-SPOTTER diff --git a/apps/frontend/src/components/Map.tsx b/apps/frontend/src/components/Map.tsx index c29a4ea..16daadf 100644 --- a/apps/frontend/src/components/Map.tsx +++ b/apps/frontend/src/components/Map.tsx @@ -5,13 +5,15 @@ import { CircleMarker, MapContainer, Marker, - Popup, TileLayer, + Tooltip, useMap, } from 'react-leaflet' import L from 'leaflet' +import { useNavigate } from '@tanstack/react-router' import { formatPrice } from '../lib/format-price' +import { assetUrl } from '#/lib/asset-url' import { MOCK_LOCATION_NAME } from '../lib/location' import type { Coordinates } from '../lib/location' import type { SearchResult } from '../types/search' @@ -32,13 +34,13 @@ function FlyToResult({ coordinates }: { coordinates: number[] | undefined }) { } const harpIcon = new L.Icon({ - iconUrl: 'harp.svg', - shadowUrl: 'harp_shadow.svg', + iconUrl: assetUrl('harp.svg'), + shadowUrl: assetUrl('harp_shadow.svg'), iconSize: [46, 46], shadowSize: [50, 50], iconAnchor: [23, 23], shadowAnchor: [25, 25], - popupAnchor: [0, -47.5], + popupAnchor: [0, -25], }) export default function Map({ @@ -52,6 +54,7 @@ export default function Map({ flyTo?: number[] isMockLocation?: boolean }) { + const navigate = useNavigate() const markers = nearby.filter( (venue, index, all) => all.findIndex( @@ -80,8 +83,18 @@ export default function Map({ key={`${curr.type}-${curr.name}-${curr.lat}-${curr.lon}`} icon={harpIcon} position={[curr.lat, curr.lon]} + eventHandlers={{ + click: () => { + if (curr.cityId) { + void navigate({ + to: '/$cityId/venues/$venueId', + params: { cityId: curr.cityId, venueId: curr.id }, + }) + } + }, + }} > - + {curr.name} {curr.address && {curr.address}} {curr.latestPriceSighting && ( @@ -89,7 +102,7 @@ export default function Map({ {formatPrice(curr.latestPriceSighting)} )} - + ))} {userLocation && ( @@ -97,16 +110,16 @@ export default function Map({ center={[userLocation.lat, userLocation.lon]} radius={8} pathOptions={{ - color: '#328f97', - fillColor: '#4fb8b2', + color: '#d3ad57', + fillColor: '#e6c77f', fillOpacity: 0.85, }} > - + {isMockLocation ? `Mock location: ${MOCK_LOCATION_NAME}` : 'Your location'} - + )} diff --git a/apps/frontend/src/components/NearbyVenues.tsx b/apps/frontend/src/components/NearbyVenues.tsx index 5948bd9..6c8bdde 100644 --- a/apps/frontend/src/components/NearbyVenues.tsx +++ b/apps/frontend/src/components/NearbyVenues.tsx @@ -16,7 +16,7 @@ interface NearbyVenuesProps { } const rowClassName = - 'block w-full border-t border-[var(--line)] px-1 py-3 text-left text-sm text-[var(--sea-ink)] transition hover:bg-[var(--chip-bg)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--lagoon-deep)' + 'block w-full px-1 py-3 text-left text-sm text-[var(--sea-ink)] transition-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--lagoon-deep)' function VenueRow({ venue }: { venue: SearchResult }) { return ( @@ -28,7 +28,7 @@ function VenueRow({ venue }: { venue: SearchResult }) { title={`Average rating ${venue.averageRating.toFixed(1)} out of 5 from ${ venue.reviewCount ?? 0 } ${(venue.reviewCount ?? 0) === 1 ? 'review' : 'reviews'}`} - className="inline-flex shrink-0 items-center gap-1 rounded-full border border-[var(--chip-line)] bg-[var(--chip-bg)] px-2 py-0.5 text-xs font-bold text-[var(--sea-ink)]" + className="inline-flex shrink-0 items-center gap-1 rounded-full bg-[var(--chip-bg)] px-2 py-0.5 text-xs font-bold text-[var(--sea-ink)]" >