From d642460c6529463fd877c6d40dc3865c7271b5dd Mon Sep 17 00:00:00 2001 From: quangnhankie Date: Wed, 8 Sep 2021 11:43:04 +0700 Subject: [PATCH] fix: fix type Image --- pages/test.tsx | 5 ++--- .../recipes/RecipeListPage/RecipeListPage.tsx | 12 ++++++------ .../recipes/RecipesList/RecipesItem/RecipesItem.tsx | 5 ++--- .../modules/recipes/RecipesList/RecipesList.tsx | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/pages/test.tsx b/pages/test.tsx index 859375a63..9ed255f6c 100644 --- a/pages/test.tsx +++ b/pages/test.tsx @@ -65,10 +65,9 @@ export default function Test() { return ( <> - {/* */} - + {/* */} - {/* */} + {/* */} diff --git a/src/components/modules/recipes/RecipeListPage/RecipeListPage.tsx b/src/components/modules/recipes/RecipeListPage/RecipeListPage.tsx index ba5f7fa4e..c8c06a4ec 100644 --- a/src/components/modules/recipes/RecipeListPage/RecipeListPage.tsx +++ b/src/components/modules/recipes/RecipeListPage/RecipeListPage.tsx @@ -114,40 +114,40 @@ const CATEGORYSELECT = [ const RECIPES = [ { id: '1', - image: blog1, + image: blog1.src, title: "Want to Lose Weight? Here are 10 DEBM Diet Guidelines for Beginners", description: 'The DEBM diet stands for "Delicious Happy Fun Diet". This diet was popularized by Robert...', link: `${ROUTE.PRODUCTS}?${QUERY_KEY.RECIPES}=veggie` }, { id: '2', - image: blog2, + image: blog2.src, title: "9 Ways to Make an Aloe Vera Mask at Home", description: 'Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...', link: `${ROUTE.PRODUCTS}?${QUERY_KEY.RECIPES}=seafood` } , { id: '3', - image: blog3, + image: blog3.src, title: "Don't Buy Wrong, Here Are 7 Ways to Choose a Ripe Dragon Fruit", description: 'Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...', link: `${ROUTE.PRODUCTS}?${QUERY_KEY.RECIPES}=coffee-bean` } , { id: '4', - image: blog4, + image: blog4.src, title: "Want to Lose Weight? Here are 10 DEBM Diet Guidelines for Beginners", description: 'The DEBM diet stands for "Delicious Happy Fun Diet". This diet was popularized by Robert...', link: `${ROUTE.PRODUCTS}?${QUERY_KEY.RECIPES}=sauce`, }, { id: '5', - image: blog5, + image: blog5.src, title: "9 Ways to Make an Aloe Vera Mask at Home", description: 'Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...', link: `${ROUTE.PRODUCTS}?${QUERY_KEY.RECIPES}=sauce`, } , { id: '6', - image: blog6, + image: blog6.src, title: "Don't Buy Wrong, Here Are 7 Ways to Choose a Ripe Dragon Fruit", description: 'Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...', link: `${ROUTE.PRODUCTS}?${QUERY_KEY.RECIPES}=sauce`, diff --git a/src/components/modules/recipes/RecipesList/RecipesItem/RecipesItem.tsx b/src/components/modules/recipes/RecipesList/RecipesItem/RecipesItem.tsx index f770314ff..11f772a8d 100644 --- a/src/components/modules/recipes/RecipesList/RecipesItem/RecipesItem.tsx +++ b/src/components/modules/recipes/RecipesList/RecipesItem/RecipesItem.tsx @@ -1,11 +1,10 @@ -import Image from "next/image"; import Link from 'next/link'; import React from 'react'; import s from './RecipesItem.module.scss'; interface RecipesItem { - image:StaticImageData, + image:string, name: string, description:string, link: string @@ -17,7 +16,7 @@ const RecipesItem = ({ image, name,description, link }: RecipesItem) => { diff --git a/src/components/modules/recipes/RecipesList/RecipesList.tsx b/src/components/modules/recipes/RecipesList/RecipesList.tsx index 96e84f028..3454786f1 100644 --- a/src/components/modules/recipes/RecipesList/RecipesList.tsx +++ b/src/components/modules/recipes/RecipesList/RecipesList.tsx @@ -8,7 +8,7 @@ interface Props{ recipes:{ id:string, title:string, - image:StaticImageData, + image:string, description:string, link:string }[],