From e249de0a73164ac92be796c10521dc4d239e64bf Mon Sep 17 00:00:00 2001 From: Nicolay Bennett Rennemo Date: Sun, 22 Nov 2026 21:01:25 +0100 Subject: [PATCH] Harps in reviews and fixed show all nearby button --- apps/frontend/src/assets/harp-rating.svg | 1 + apps/frontend/src/components/HarpIcon.tsx | 14 ++++++++++ apps/frontend/src/components/NearbyVenues.tsx | 28 ++++++++----------- apps/frontend/src/components/SearchBox.tsx | 5 ++-- .../frontend/src/components/SearchFilters.tsx | 2 +- apps/frontend/src/components/ViewVenue.tsx | 5 ++-- .../src/routes/$cityId/venues/$venueId.tsx | 24 +++++++++++----- 7 files changed, 49 insertions(+), 30 deletions(-) create mode 100644 apps/frontend/src/assets/harp-rating.svg create mode 100644 apps/frontend/src/components/HarpIcon.tsx diff --git a/apps/frontend/src/assets/harp-rating.svg b/apps/frontend/src/assets/harp-rating.svg new file mode 100644 index 0000000..d9dfa8d --- /dev/null +++ b/apps/frontend/src/assets/harp-rating.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/frontend/src/components/HarpIcon.tsx b/apps/frontend/src/components/HarpIcon.tsx new file mode 100644 index 0000000..17fb9f2 --- /dev/null +++ b/apps/frontend/src/components/HarpIcon.tsx @@ -0,0 +1,14 @@ +import HARP_SRC from '#/assets/harp-rating.svg?url' + +// Cropped version of harp.svg, so the icon fills the same space as a star. +export function HarpIcon({ className = '' }: { className?: string }) { + return ( + + ) +} diff --git a/apps/frontend/src/components/NearbyVenues.tsx b/apps/frontend/src/components/NearbyVenues.tsx index 9f26d7a..18f57b5 100644 --- a/apps/frontend/src/components/NearbyVenues.tsx +++ b/apps/frontend/src/components/NearbyVenues.tsx @@ -1,5 +1,6 @@ import { Link } from '@tanstack/react-router' +import { HarpIcon } from '#/components/HarpIcon' import { formatOpeningHours } from '#/lib/format-opening-hours' import { formatPrice } from '#/lib/format-price' import { useUserTimeZone } from '#/lib/use-user-time-zone' @@ -37,9 +38,7 @@ function VenueRow({ } ${(venue.reviewCount ?? 0) === 1 ? 'review' : 'reviews'}`} className="inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-xs font-bold text-(--sea-ink)" > - + {venue.averageRating.toFixed(1)} ({venue.reviewCount ?? 0}) @@ -133,21 +132,18 @@ export default function NearbyVenues({ {hasLocation && venues.length > 0 && ( <> {venues[0].cityId && venues[0].cityName && ( -
-

- - Show all venues in {venues[0].cityName} - -

-

+
+ + Show all venues in {venues[0].cityName} + + Not in {venues[0].cityName}? Search for your city in the search bar above! -

+
)} diff --git a/apps/frontend/src/components/SearchBox.tsx b/apps/frontend/src/components/SearchBox.tsx index e2f0f25..4ef3aa1 100644 --- a/apps/frontend/src/components/SearchBox.tsx +++ b/apps/frontend/src/components/SearchBox.tsx @@ -1,6 +1,7 @@ import { keepPreviousData, useQuery } from '@tanstack/react-query' import { useNavigate } from '@tanstack/react-router' import { useEffect, useId, useMemo, useState } from 'react' +import { HarpIcon } from '#/components/HarpIcon' import type { FormEvent, KeyboardEvent } from 'react' import { graphqlFetch } from '../graphql/client' @@ -332,9 +333,7 @@ export function SearchBox({ coordinates = null, filters }: SearchBoxProps) { }`} className="inline-flex shrink-0 items-center gap-1 rounded-full bg-(--chip-bg) px-1.5 py-0.5 text-xs font-bold" > - + {result.averageRating.toFixed(1)} ({result.reviewCount ?? 0}) diff --git a/apps/frontend/src/components/SearchFilters.tsx b/apps/frontend/src/components/SearchFilters.tsx index 8a75369..7d11acd 100644 --- a/apps/frontend/src/components/SearchFilters.tsx +++ b/apps/frontend/src/components/SearchFilters.tsx @@ -159,7 +159,7 @@ export default function SearchFilters({ {RATING_OPTIONS.map((rating) => ( ))} diff --git a/apps/frontend/src/components/ViewVenue.tsx b/apps/frontend/src/components/ViewVenue.tsx index efa6128..e90b923 100644 --- a/apps/frontend/src/components/ViewVenue.tsx +++ b/apps/frontend/src/components/ViewVenue.tsx @@ -1,3 +1,4 @@ +import { HarpIcon } from '#/components/HarpIcon' import { formatOpeningDays, formatOpeningTime, @@ -23,9 +24,7 @@ export function ViewVenue({ venue }: { venue: SearchResult }) { className="mt-0.5 inline-flex shrink-0 items-center gap-1 rounded-full px-2.5 py-1 text-sm font-bold text-(--sea-ink)" > Average rating: - + {venue.averageRating.toFixed(1)} out of 5 from {venue.reviewCount ?? 0}{' '} diff --git a/apps/frontend/src/routes/$cityId/venues/$venueId.tsx b/apps/frontend/src/routes/$cityId/venues/$venueId.tsx index 0f5b23c..7462721 100644 --- a/apps/frontend/src/routes/$cityId/venues/$venueId.tsx +++ b/apps/frontend/src/routes/$cityId/venues/$venueId.tsx @@ -2,6 +2,7 @@ import type { ReactNode } from 'react' import { useQuery } from '@tanstack/react-query' import { Link, createFileRoute } from '@tanstack/react-router' import Breadcrumbs from '#/components/Breadcrumbs' +import { HarpIcon } from '#/components/HarpIcon' import { ReportPriceDialog } from '#/components/prices/ReportPriceDialog' import AddReviewDialog from '#/components/reviews/AddReviewDialog' import { venueToSearchResult } from '#/components/VenueCard' @@ -146,6 +147,17 @@ function BackLink() { ) } +// The five harps keep the exact width and height of the old five-star row. +function Harps({ className = '' }: { className?: string }) { + return ( + + ) +} + function Rating({ rating }: { rating: number }) { const percent = Math.max(0, Math.min(100, (rating / 5) * 100)) @@ -153,18 +165,16 @@ function Rating({ rating }: { rating: number }) { - +