From ac2dc21047e8843448d74997d819a7ac828d2262 Mon Sep 17 00:00:00 2001 From: Amalie Date: Fri, 16 Oct 2026 22:51:53 +0200 Subject: [PATCH] =?UTF-8?q?Endret=20design=20p=C3=A5=20recipeDetail=20og?= =?UTF-8?q?=20lagt=20til=20favorittknapp=20(#133)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/recipe/RecipeCard.tsx | 52 +++++++++++-------- client/src/components/recipe/RecipeDetail.tsx | 15 ++++-- 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/client/src/components/recipe/RecipeCard.tsx b/client/src/components/recipe/RecipeCard.tsx index 57609b1..c8f7183 100644 --- a/client/src/components/recipe/RecipeCard.tsx +++ b/client/src/components/recipe/RecipeCard.tsx @@ -4,6 +4,7 @@ import { Rating } from '@mui/material'; import { RecipeImage } from '../ui/RecipeImage'; import RestaurantIcon from '@mui/icons-material/Restaurant'; import AccessTimeIcon from '@mui/icons-material/AccessTime'; +import { FavoriteButton } from '../favorites/FavoriteButton'; // Sier hva komponenten får inn. type RecipeCardProps = { @@ -12,30 +13,35 @@ type RecipeCardProps = { export function RecipeCard({ recipe }: RecipeCardProps) { return ( - -
- -
-

{recipe.title}

-
-

{recipe.prepTimeMinutes} min

-

·

-

{recipe.servings} porsjoner

+
+ +
+ +
+

{recipe.title}

+
+

{recipe.prepTimeMinutes} min

+

·

+

{recipe.servings} porsjoner

+
+
+ {recipe.averageRating !== null ?( + + ) : (

Ingen rating ennå

+ )} +
-
- {recipe.averageRating !== null ?( - - ) : (

Ingen rating ennå

- )} -
-
-
- + + +
+ +
+ ); } diff --git a/client/src/components/recipe/RecipeDetail.tsx b/client/src/components/recipe/RecipeDetail.tsx index e851c6e..80b4fcc 100644 --- a/client/src/components/recipe/RecipeDetail.tsx +++ b/client/src/components/recipe/RecipeDetail.tsx @@ -8,6 +8,7 @@ import Checkbox from '@mui/material/Checkbox'; import FormControlLabel from '@mui/material/FormControlLabel'; import AddIcon from '@mui/icons-material/Add'; import RemoveIcon from '@mui/icons-material/Remove'; +import { FavoriteButton } from '../favorites/FavoriteButton'; // Sier hva komponenten får inn. type RecipeDetailProps = { @@ -34,7 +35,7 @@ export function RecipeDetail({ recipe }: RecipeDetailProps) { return (
-
+
    {recipe.tags.map((tag) => ( @@ -60,15 +61,19 @@ export function RecipeDetail({ recipe }: RecipeDetailProps) {

    {recipe.description}

    -
    +

    {recipe.prepTimeMinutes} minutter

    +

    ·

    {recipe.servings} porsjoner

-
+
+
+ +
-
+

Ingredienser

@@ -126,7 +131,7 @@ export function RecipeDetail({ recipe }: RecipeDetailProps) { ))}
-
+

Fremgangsmåte

    {recipe.steps.map((step) => (