diff --git a/web/src/components/items/IngredientList.tsx b/web/src/components/items/IngredientList.tsx index 98f9db9..160a522 100644 --- a/web/src/components/items/IngredientList.tsx +++ b/web/src/components/items/IngredientList.tsx @@ -1,16 +1,31 @@ import { Fragment } from "react/jsx-runtime"; import type { RecipeIngredient, RecipeIngredientSection } from "../../types/recipe"; +import { useState } from "react"; interface IngredientListProps { sections: RecipeIngredientSection[]; ingredients: RecipeIngredient[]; } +const CLASSES_ACTIVE = "p-1 bg-blue-100 border border-blue-200 h-fit duration-300 cursor-pointer"; +const CLASSES_INACTIVE = "p-1 bg-gray-100 border border-gray-200 h-fit duration-300 cursor-pointer hover:bg-gray-200 hover:border-gray-300"; + export default function IngredientList({ sections, ingredients }: IngredientListProps) { + const [scale, setScale] = useState(1); + return ( <>
-

Ingredients

+
+

Ingredients

+ {/* Serving size toggle */} +
+ + + + +
+

{sections?.map(section => ( @@ -33,7 +48,7 @@ export default function IngredientList({ sections, ingredients }: IngredientList - {ingredient.Amount > 0 ? ingredient.Amount : null} {ingredient.Unit} + {ingredient.Amount > 0 ? (ingredient.Amount * scale) : null} {ingredient.Unit} {ingredient.Name} diff --git a/web/src/pages/Recipe.tsx b/web/src/pages/Recipe.tsx index b1c0781..0ff0dfb 100644 --- a/web/src/pages/Recipe.tsx +++ b/web/src/pages/Recipe.tsx @@ -59,7 +59,7 @@ export default function RecipePage() { return recipe ? ( <> - +

{recipe.Title}

{author ? author.Name : "Loading..."}