Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/frontend/src/components/AddReviewDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ export default function AddReviewDialog({
<span className="mr-2 w-24 shrink-0 text-right text-xs font-bold whitespace-nowrap text-(--sea-ink-soft)">
Select a rating:
</span>
<div className="flex items-center -space-x-4">
<div className="flex items-center">
{RATING_VALUES.map((value) => (
<label
key={value}
onMouseEnter={() => setHoveredRating(value)}
className="cursor-pointer rounded-md p-0.5"
className="flex w-6.75 shrink-0 cursor-pointer items-center justify-center"
>
<input
type="radio"
Expand All @@ -186,7 +186,7 @@ export default function AddReviewDialog({
alt=""
aria-hidden="true"
draggable={false}
className={`h-5 w-auto rounded-sm select-none transition-opacity peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-(--lagoon-deep) ${
className={`pointer-events-none block h-5 w-auto max-w-none shrink-0 select-none transition-opacity peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-(--lagoon-deep) ${
value <= visibleRating ? 'opacity-100' : 'opacity-30'
}`}
/>
Expand Down
5 changes: 2 additions & 3 deletions apps/frontend/src/components/NearbyVenues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 bg-(--chip-bg) px-2 py-0.5 text-xs font-bold text-(--sea-ink)"
className="inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-xs font-bold text-(--sea-ink)"
>
<span aria-hidden="true" className="text-amber-500">
★
Expand Down Expand Up @@ -73,9 +73,8 @@ export default function NearbyVenues({
<section className="island-shell rise-in rounded-2xl p-5">
<div className="flex flex-wrap items-start justify-between gap-3">
<div>
<p className="island-kicker">Nearby pubs</p>
<h2 className="mt-1 text-xl font-extrabold">
Within {maxDistanceKm} km
Pubs within {maxDistanceKm} km
</h2>
</div>
<button
Expand Down
3 changes: 0 additions & 3 deletions apps/frontend/src/components/SearchFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ export default function SearchFilters({
<div className="flex flex-wrap items-start justify-between gap-3">
<div>
<h2 className="mt-1 text-lg font-extrabold">Filter pubs</h2>
<p className="mt-0.5 text-xs text-(--sea-ink-soft)">
Applies to the map, nearby pubs and search results.
</p>
</div>
<button
type="button"
Expand Down
5 changes: 1 addition & 4 deletions apps/frontend/src/components/VenueCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ export default function VenueCard({ current }: { current: venue }) {
params={{ cityId: current.city.id, venueId: current.id }}
className="block rounded-2xl transition hover:-translate-y-0.5 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-(--lagoon-deep)"
>
<ViewVenue
venue={venueToSearchResult(current)}
kicker={current.city.name}
/>
<ViewVenue venue={venueToSearchResult(current)} />
</Link>
)
}
13 changes: 3 additions & 10 deletions apps/frontend/src/components/ViewVenue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,19 @@ import {
import { formatPrice } from '#/lib/format-price'
import type { SearchResult } from '#/types/search'

export function ViewVenue({
venue,
kicker = 'Selected pub',
}: {
venue: SearchResult
kicker?: string
}) {
export function ViewVenue({ venue }: { venue: SearchResult }) {
return (
<article className="rounded-2xl bg-(--surface-strong) p-5 text-(--sea-ink)">
<div className="flex items-start justify-between gap-3">
<div className="min-w-0">
<p className="island-kicker">{kicker}</p>
<h2 className="mt-1 text-xl font-extrabold">{venue.name}</h2>
</div>
{venue.averageRating != null && (
<p
title={`Average rating ${venue.averageRating.toFixed(1)} out of 5 from ${
venue.reviewCount ?? 0
} ${(venue.reviewCount ?? 0) === 1 ? 'review' : 'reviews'}`}
className="mt-0.5 inline-flex shrink-0 items-center gap-1 rounded-full bg-(--chip-bg) px-2.5 py-1 text-sm font-bold text-(--sea-ink)"
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)"
>
<span>Average rating:</span>
<span aria-hidden="true" className="text-amber-500">
Expand All @@ -47,7 +40,7 @@ export function ViewVenue({
)}
<h3 className="mt-4 text-sm font-bold">Opening hours</h3>
{venue.openingHours && venue.openingHours.length > 0 ? (
<ul className="mt-1 striped-list">
<ul className="mt-1">
{venue.openingHours.map((openingHours, index) => (
<li
key={index}
Expand Down
3 changes: 1 addition & 2 deletions apps/frontend/src/components/__tests__/VenueCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('venueToSearchResult', () => {
})

describe('VenueCard', () => {
it('links to the venue and shows its city as the kicker', async () => {
it('links to the venue and shows its name', async () => {
const { user, router } = renderWithProviders(
<VenueCard current={makeVenue()} />,
)
Expand All @@ -68,7 +68,6 @@ describe('VenueCard', () => {
expect(
screen.getByRole('heading', { name: 'Studentersamfundet' }),
).toBeInTheDocument()
expect(screen.getByText('Trondheim')).toBeInTheDocument()

await user.click(link)

Expand Down
3 changes: 1 addition & 2 deletions apps/frontend/src/components/__tests__/ViewVenue.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import { ViewVenue } from '../ViewVenue'

describe('ViewVenue', () => {
it('renders the venue details, rating, price and opening hours', () => {
render(<ViewVenue venue={makeSearchResult()} kicker="Trondheim" />)
render(<ViewVenue venue={makeSearchResult()} />)

expect(screen.getByText('Trondheim')).toBeInTheDocument()
expect(
screen.getByRole('heading', { name: 'Studentersamfundet' }),
).toBeInTheDocument()
Expand Down
5 changes: 1 addition & 4 deletions apps/frontend/src/routes/$cityId/venues/$venueId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ function VenuePage() {
/>

<div className="mt-4 grid gap-6 lg:grid-cols-[1.1fr_0.9fr]">
<ViewVenue
venue={venueToSearchResult(current)}
kicker={current.city.name}
/>
<ViewVenue venue={venueToSearchResult(current)} />
<section
aria-label={`Map showing ${current.name}`}
className="overflow-hidden rounded-2xl bg-(--surface-strong) p-2"
Expand Down
6 changes: 5 additions & 1 deletion apps/frontend/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ a {

/* Cluster marker for overlapping pubs. Kept at 44x44 so it is a comfortable
* touch target (WCAG 2.2 target size) and never overlaps another marker. */
.gspotter-cluster {
.leaflet-marker-icon.gspotter-cluster {
display: flex;
align-items: center;
justify-content: center;
Expand Down Expand Up @@ -600,3 +600,7 @@ a {
opacity: 1;
}
}

button {
cursor: pointer;
}