- Choose what you’re eating and discover wines that make it even
- better.
-
+
+
Explore
+
+
Find wine by food
+
+
+ Choose what you’re eating and discover wines that make it even
+ better.
+
+
+
+
+
+
diff --git a/client/src/components/FoodWineCard.tsx b/client/src/components/FoodWineCard.tsx
index 225e1a9..d599cf9 100644
--- a/client/src/components/FoodWineCard.tsx
+++ b/client/src/components/FoodWineCard.tsx
@@ -1,46 +1,7 @@
import { Link } from 'react-router';
import type { FoodWine } from '../types/wine';
-import { ACIDITY_LEVELS, BODY_LEVELS, wineTypeColor } from '../data/taste';
-
-/**
- * A wine bottle in the colour of the wine type. Decorative only.
- * X-Wines has no pictures of the wines, so we draw one.
- */
-function Bottle({ type }: { type: string }) {
- return (
-
- );
-}
+import { ACIDITY_LEVELS, BODY_LEVELS } from '../data/taste';
+import WineTypeImage from './WineTypeImage';
/** One row with label and bar, e.g. "Body ████░". The exact value is read by screen readers and shown on hover. */
function Bar(props: { label: string; share: number; value: string }) {
@@ -68,7 +29,9 @@ function Bar(props: { label: string; share: number; value: string }) {
export default function FoodWineCard({ wine }: { wine: FoodWine }) {
return (
-
+
+
+
diff --git a/client/src/components/SelectedWine.tsx b/client/src/components/SelectedWine.tsx
index 895966e..2d12cf7 100644
--- a/client/src/components/SelectedWine.tsx
+++ b/client/src/components/SelectedWine.tsx
@@ -2,31 +2,13 @@ import { Link } from 'react-router';
import { useQuery } from '@apollo/client/react';
import type { TasteWine } from '../types/wine';
import { WINE_GRAPES_QUERY, type WineGrapesData } from '../graphql/queries';
-import { ACIDITY_LEVELS, BODY_LEVELS, wineTypeColor } from '../data/taste';
+import { ACIDITY_LEVELS, BODY_LEVELS } from '../data/taste';
+import WineTypeImage from './WineTypeImage';
type Props = {
wine: TasteWine | null;
};
-/** A wine glass filled with the colour of the wine type. Decorative only. */
-function WineGlass({ type }: { type: string }) {
- return (
-
- );
-}
-
/** One row with label, bar and value, e.g. "Body ████░ Full-bodied". */
function TasteBar(props: { label: string; share: number; value: string }) {
return (
@@ -74,8 +56,8 @@ export default function SelectedWine({ wine }: Props) {
aria-live="polite"
>
-
-
+
+
{wine.name}
diff --git a/client/src/components/WineList.tsx b/client/src/components/WineList.tsx
index 37374a8..7c36a6b 100644
--- a/client/src/components/WineList.tsx
+++ b/client/src/components/WineList.tsx
@@ -1,24 +1,11 @@
import type { WineListItem } from '../types/wine';
import './WineList.css';
-import redWine from '../assets/wines/redWine.png';
-import whiteWine from '../assets/wines/whiteWine.png';
-import roseWine from '../assets/wines/roseWine.png';
-import sparklingWine from '../assets/wines/sparklingWine.png';
-import dessertWine from '../assets/wines/dessertWine.png';
-import portWine from '../assets/wines/portWine.png';
+import WineTypeImage from './WineTypeImage';
type Props = {
wines: WineListItem[];
};
-const wineImages: Record = {
- Red: redWine,
- White: whiteWine,
- Rosé: roseWine,
- Sparkling: sparklingWine,
- Dessert: dessertWine,
- 'Dessert/Port': portWine,
-};
/**
* Shows a list of wines as cards.
*
@@ -54,15 +41,9 @@ export default function WineList({ wines }: Props) {
aria-labelledby={`wine-${wine.id}`}
data-wine-type={wine.type.toLowerCase()}
>
- {wineImages[wine.type] && (
-
-
-
- )}
+
+
+
{wine.type}
diff --git a/client/src/components/WineTypeImage.tsx b/client/src/components/WineTypeImage.tsx
new file mode 100644
index 0000000..3503c64
--- /dev/null
+++ b/client/src/components/WineTypeImage.tsx
@@ -0,0 +1,30 @@
+import redWine from '../assets/wines/redWine.png';
+import whiteWine from '../assets/wines/whiteWine.png';
+import roseWine from '../assets/wines/roseWine.png';
+import sparklingWine from '../assets/wines/sparklingWine.png';
+import dessertWine from '../assets/wines/dessertWine.png';
+import portWine from '../assets/wines/portWine.png';
+
+const wineImages: Record = {
+ Red: redWine,
+ White: whiteWine,
+ Rosé: roseWine,
+ Sparkling: sparklingWine,
+ Dessert: dessertWine,
+ 'Dessert/Port': portWine,
+};
+
+type Props = {
+ type: string;
+ className?: string;
+};
+
+export default function WineTypeImage({ type, className }: Props) {
+ const image = wineImages[type];
+
+ if (!image) {
+ return null;
+ }
+
+ return ;
+}