mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 12:24:18 +00:00
♻️ enhan: link to recipe detail
:%s
This commit is contained in:
@@ -1,19 +1,24 @@
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import { ROUTE } from 'src/utils/constanst.utils'
|
||||||
import { RecipeProps } from 'src/utils/types.utils'
|
import { RecipeProps } from 'src/utils/types.utils'
|
||||||
import s from './RecipeCard.module.scss'
|
import s from './RecipeCard.module.scss'
|
||||||
export interface RecipeCardProps extends RecipeProps {}
|
export interface RecipeCardProps extends RecipeProps { }
|
||||||
|
|
||||||
const RecipeCard = ({ imageSrc, title, description }: RecipeCardProps) => {
|
const RecipeCard = ({ imageSrc, title, description, slug }: RecipeCardProps) => {
|
||||||
return (
|
return (
|
||||||
<div className={s.recipeCardWarpper}>
|
<div className={s.recipeCardWarpper}>
|
||||||
<Link href="#">
|
<Link href={`${ROUTE.RECIPE_DETAIL}/${slug}`}>
|
||||||
<div className={s.image}>
|
<a>
|
||||||
<img src={imageSrc} alt="image recipe" />
|
<div className={s.image}>
|
||||||
</div>
|
<img src={imageSrc} alt="image recipe" />
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
<Link href="#">
|
<Link href={`${ROUTE.RECIPE_DETAIL}/${slug}`}>
|
||||||
<div className={s.title}>{title}</div>
|
<a>
|
||||||
|
<div className={s.title}>{title}</div>
|
||||||
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
<div className={s.description}>{description}</div>
|
<div className={s.description}>{description}</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -9,12 +9,18 @@ export const SOCIAL_LINKS = {
|
|||||||
|
|
||||||
export const ROUTE = {
|
export const ROUTE = {
|
||||||
HOME: '/',
|
HOME: '/',
|
||||||
PRODUCTS: '/products',
|
|
||||||
PRODUCT_DETAIL: '/product',
|
|
||||||
ABOUT: '/about',
|
ABOUT: '/about',
|
||||||
ACCOUNT: '/account',
|
ACCOUNT: '/account',
|
||||||
|
|
||||||
|
PRODUCTS: '/products',
|
||||||
|
PRODUCT_DETAIL: '/product',
|
||||||
|
|
||||||
|
BLOGS: '/blogs',
|
||||||
BLOG_DETAIL: '/blog',
|
BLOG_DETAIL: '/blog',
|
||||||
|
|
||||||
RECIPES: '/recipes',
|
RECIPES: '/recipes',
|
||||||
|
RECIPE_DETAIL: '/recipe',
|
||||||
|
|
||||||
BUSSINESS: '/bussiness',
|
BUSSINESS: '/bussiness',
|
||||||
CONTACT: '/contact',
|
CONTACT: '/contact',
|
||||||
CHECKOUT: '/checkout',
|
CHECKOUT: '/checkout',
|
||||||
@@ -22,7 +28,6 @@ export const ROUTE = {
|
|||||||
CUSTOMER_SERVICE: '/customer-service',
|
CUSTOMER_SERVICE: '/customer-service',
|
||||||
TERM_CONDITION: '/term-condition',
|
TERM_CONDITION: '/term-condition',
|
||||||
PRIVACY_POLICY: '/privacy-policy',
|
PRIVACY_POLICY: '/privacy-policy',
|
||||||
BLOGS: '/blogs',
|
|
||||||
FORGOT_PASSWORD: '/forgot-password'
|
FORGOT_PASSWORD: '/forgot-password'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user