From d7e1a79fb25fafccdf4dd34a60790a22b7129ef4 Mon Sep 17 00:00:00 2001 From: Aaron Po Date: Thu, 27 Aug 2026 02:44:25 -0400 Subject: [PATCH] Reformat with Prettier's updated line-wrapping for ternaries and JSX. --- .../features/account/hooks/useSectionError.ts | 5 ++- .../breweries/components/BreweryMap.tsx | 13 ++++--- .../components/FeaturedBreweryCard.tsx | 3 +- .../breweries/components/NearbyBreweryMap.tsx | 4 ++- .../features/breweries/routes/breweries.tsx | 36 +++++++++---------- .../breweries/routes/brewery-directory.tsx | 5 +-- .../stories/PasswordSection.stories.tsx | 6 +++- 7 files changed, 40 insertions(+), 32 deletions(-) diff --git a/web/frontend/app/features/account/hooks/useSectionError.ts b/web/frontend/app/features/account/hooks/useSectionError.ts index b34274b7..9a574ff9 100644 --- a/web/frontend/app/features/account/hooks/useSectionError.ts +++ b/web/frontend/app/features/account/hooks/useSectionError.ts @@ -2,7 +2,10 @@ import { useEffect } from 'react'; import { showErrorToast } from '../../../components/ui/toast/toast'; import type { ActionResult } from '../types'; -export const useSectionError = (result: ActionResult | undefined, intent: ActionResult['intent']) => { +export const useSectionError = ( + result: ActionResult | undefined, + intent: ActionResult['intent'], +) => { useEffect(() => { if (!result || result.intent !== intent) return; showErrorToast(result.error); diff --git a/web/frontend/app/features/breweries/components/BreweryMap.tsx b/web/frontend/app/features/breweries/components/BreweryMap.tsx index 99b3747a..196f1c10 100644 --- a/web/frontend/app/features/breweries/components/BreweryMap.tsx +++ b/web/frontend/app/features/breweries/components/BreweryMap.tsx @@ -61,7 +61,13 @@ const CurrentLocationMarker = ({ position }: { position: LatLngTuple }) => ( const CURRENT_LOCATION_ZOOM = 6; -const RecenterMap = ({ bounds, currentLocation }: { bounds: LatLngTuple[]; currentLocation: LatLngTuple | null }) => { +const RecenterMap = ({ + bounds, + currentLocation, +}: { + bounds: LatLngTuple[]; + currentLocation: LatLngTuple | null; +}) => { const map = useMap(); useEffect(() => { @@ -77,10 +83,7 @@ const RecenterMap = ({ bounds, currentLocation }: { bounds: LatLngTuple[]; curre const BreweryMap = ({ breweries }: BreweryMapProps) => { const currentLocation = useCurrentLocation(); - const bounds: LatLngTuple[] = breweries.map((brewery) => [ - brewery.latitude, - brewery.longitude, - ]); + const bounds: LatLngTuple[] = breweries.map((brewery) => [brewery.latitude, brewery.longitude]); return ( void; } -// Founded year, beers-listed count, and house style aren't tracked anywhere yet - -// see BREWERY_INDEX_HANDOFF.md. Filler until those fields/queries exist. +// see BREWERY_INDEX_HANDOFF.md const FILLER_STATS = [ { label: 'Founded', value: '2014' }, { label: 'Beers listed', value: '18' }, diff --git a/web/frontend/app/features/breweries/components/NearbyBreweryMap.tsx b/web/frontend/app/features/breweries/components/NearbyBreweryMap.tsx index 72aa0b11..6cfc8a72 100644 --- a/web/frontend/app/features/breweries/components/NearbyBreweryMap.tsx +++ b/web/frontend/app/features/breweries/components/NearbyBreweryMap.tsx @@ -98,7 +98,9 @@ const NearbyBreweryMap = ({ >

{pin.name}

- {pin.cityLabel &&

{pin.cityLabel}

} + {pin.cityLabel && ( +

{pin.cityLabel}

+ )} View brewery → diff --git a/web/frontend/app/features/breweries/routes/breweries.tsx b/web/frontend/app/features/breweries/routes/breweries.tsx index 2a0d3749..15332a50 100644 --- a/web/frontend/app/features/breweries/routes/breweries.tsx +++ b/web/frontend/app/features/breweries/routes/breweries.tsx @@ -24,24 +24,22 @@ const Breweries = ({ loaderData }: Route.ComponentProps) => { const { featured, recent } = loaderData; const [selectedId, setSelectedId] = useState(null); - const featuredPin = - featured?.location?.coordinates ? - { - id: featured.breweryPostId, - name: featured.breweryName, - latitude: featured.location.coordinates.latitude, - longitude: featured.location.coordinates.longitude, - } - : null; + const featuredPin = featured?.location?.coordinates + ? { + id: featured.breweryPostId, + name: featured.breweryName, + latitude: featured.location.coordinates.latitude, + longitude: featured.location.coordinates.longitude, + } + : null; - const fallbackCenter = - featured?.location?.coordinates ? - { - latitude: featured.location.coordinates.latitude, - longitude: featured.location.coordinates.longitude, - label: featured.location.cityName, - } - : null; + const fallbackCenter = featured?.location?.coordinates + ? { + latitude: featured.location.coordinates.latitude, + longitude: featured.location.coordinates.longitude, + label: featured.location.cityName, + } + : null; return (
@@ -85,7 +83,9 @@ const Breweries = ({ loaderData }: Route.ComponentProps) => {
-

Looking for something specific?

+

+ Looking for something specific? +

All {FILLER_TOTAL_BREWERY_COUNT} partner breweries, filterable by country, region, and beer style. diff --git a/web/frontend/app/features/breweries/routes/brewery-directory.tsx b/web/frontend/app/features/breweries/routes/brewery-directory.tsx index 09ce94e2..6f5f15c0 100644 --- a/web/frontend/app/features/breweries/routes/brewery-directory.tsx +++ b/web/frontend/app/features/breweries/routes/brewery-directory.tsx @@ -103,10 +103,7 @@ const Breweries = ({ loaderData }: Route.ComponentProps) => { ))} {fetcher.state !== 'idle' && Array.from({ length: PAGE_SIZE }).map((_, index) => ( -

+
))}
)} diff --git a/web/frontend/stories/PasswordSection.stories.tsx b/web/frontend/stories/PasswordSection.stories.tsx index 7377fddd..f12169e8 100644 --- a/web/frontend/stories/PasswordSection.stories.tsx +++ b/web/frontend/stories/PasswordSection.stories.tsx @@ -14,7 +14,11 @@ const PasswordSectionRoute = () => { return (
- setOpen((value) => !value)} result={result} /> + setOpen((value) => !value)} + result={result} + />
); };