diff --git a/client/src/components/new-recipe/RecipeStep1.tsx b/client/src/components/new-recipe/RecipeStep1.tsx index b5040d4..3dd8b21 100644 --- a/client/src/components/new-recipe/RecipeStep1.tsx +++ b/client/src/components/new-recipe/RecipeStep1.tsx @@ -13,6 +13,7 @@ type RecipeStep1Props = { onNext: () => void } + const categories = ['Frokost', 'Lunsj', 'Middag', 'Dessert', 'Snacks', 'Drikke'] const dietaryTags = ['Vegetar', 'Vegansk', 'Pescetar', 'Glutenfri', 'Laktosefri', 'Annet +'] @@ -102,10 +103,8 @@ export default function RecipeStep1({ data, setData, onNext }: RecipeStep1Props) -
- + {servings} + +
+ + + + + {/* TODO: koble til handlelisten når den finnes */} +
+ +
+ + + {/* FREMGANGSMÅTE */} +
+

Fremgangsmåte

+ +
    + {instructions.length === 0 &&
  1. Ingen fremgangsmåte lagt til.
  2. } + {instructions.map((step, index) => ( +
  3. + + {index + 1} + + +

    + {step.text} + {step.minutes && ({step.minutes} min)} +

    + + +
  4. + ))} +
+
{/* Knapper */} -
- - - - +
+ + +
- ) -} \ No newline at end of file +} diff --git a/client/src/components/ui/Button.tsx b/client/src/components/ui/Button.tsx index f905676..fef93e4 100644 --- a/client/src/components/ui/Button.tsx +++ b/client/src/components/ui/Button.tsx @@ -16,7 +16,7 @@ type ButtonProps = ButtonHTMLAttributes & { size?: ButtonSize } -// Felles styling +// Felles styling for alle knappene const baseStyles = [ 'font-body', 'rounded-medium', @@ -24,7 +24,7 @@ const baseStyles = [ 'cursor-pointer', ].join(' ') -// Fokus og deaktivert tilstand +// Felles styling for tastaturfokus og deaktiverte knapper const sharedStyles = [ 'focus-visible:outline-2', 'focus-visible:outline-offset-2', @@ -63,15 +63,17 @@ const sizeStyles: Record = { large: 'px-6 py-4 text-lg', } +// Gjenbrukbar knapp som kan tilpasses med variant, størrelse og andre props export function Button({ children, - variant = 'primary', - size = 'medium', - className = '', - type = 'button', + variant = 'primary', // Bruker primary hvis ingen variant er valgt + size = 'medium', // Bruker medium hvis ingen størrelse er valgt + className = '', // Gjør det mulig å legge til ekstra styling + type = 'button', // Hindrer at knappen automatisk sender inn et skjema ...props }: ButtonProps) { - // Kombinerer styling + + // Kombinerer felles styling, variant, størrelse og eventuell ekstra styling const classes = [ baseStyles, sharedStyles, @@ -83,6 +85,7 @@ export function Button({ .join(' ') return ( + // Sender videre vanlige HTML-egenskaper som onClick, disabled og aria-label