🐛 bug: fix bug before merge to common

:%s
This commit is contained in:
unknown 2021-08-27 15:08:32 +07:00
parent c27fbef46b
commit 077020f450
25 changed files with 149 additions and 143 deletions

View File

@ -1,42 +1,8 @@
import { FeaturedProductCard, Layout, ProductCaroucel, RecipeCard } from 'src/components/common' import { Layout } from 'src/components/common'
import { HomeBanner, HomeCollection, HomeCTA, HomeSubscribe, HomeVideo } from 'src/components/modules/home'; import { HomeBanner, HomeCollection, HomeCTA, HomeSubscribe, HomeVideo } from 'src/components/modules/home';
import HomeRecipe from 'src/components/modules/home/HomeRecipe/HomeRecipe';
// import image9 from "../public/assets/images/image9.png"
// import image10 from "../public/assets/images/image10.png"
// import image11 from "../public/assets/images/image11.png"
import image12 from "../public/assets/images/image12.png"
// import { CollectionCarcoucel } from 'src/components/modules/home'
import HomeRecipe from 'src/components/modules/home/HomeRecipe/HomeRecipe'
import image13 from "../public/assets/images/image13.png"
import image14 from "../public/assets/images/image14.png"
import { RecipeCardProps } from '../src/components/common/RecipeCard/RecipeCard';
const recipe:RecipeCardProps[] = [{
title: "Special Recipe of Vietnamese Phở",
description:"Alright, before we get to the actual recipe, lets chat for a sec about the ingredients. To make this pho soup recipe, you will need:",
imageSrc: image12.src
},{
title: "Original Recipe of Curry",
description:"Chicken curry is common to several countries including India, countries in Asia and the Caribbean. My favorite of them though is this aromatic Indian...",
imageSrc: image13.src
},{
title: "The Best Recipe of Beef Noodle Soup",
description:"The broth for Bun Bo Hue is prepared by slowly simmering various types of beef and pork bones (ox tail, beef shank, pork neck bones, pork feet,...",
imageSrc: image14.src
},{
title: "Special Recipe of Vietnamese Phở",
description:"Alright, before we get to the actual recipe, lets chat for a sec about the ingredients. To make this pho soup recipe, you will need:",
imageSrc: image12.src
},{
title: "Original Recipe of Curry",
description:"Chicken curry is common to several countries including India, countries in Asia and the Caribbean. My favorite of them though is this aromatic Indian...",
imageSrc: image13.src
},{
title: "The Best Recipe of Beef Noodle Soup",
description:"The broth for Bun Bo Hue is prepared by slowly simmering various types of beef and pork bones (ox tail, beef shank, pork neck bones, pork feet,...",
imageSrc: image14.src
}]
export default function Home() { export default function Home() {
@ -46,7 +12,7 @@ export default function Home() {
<HomeCollection/> <HomeCollection/>
<HomeVideo /> <HomeVideo />
<HomeCTA /> <HomeCTA />
<HomeRecipe data={recipe} itemKey="product-2" title="Special Recipes"/> <HomeRecipe />
<HomeSubscribe /> <HomeSubscribe />
</> </>
) )

View File

@ -5,7 +5,7 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 1.2rem 3.2rem; padding: 0.8rem 3.2rem;
&:disabled { &:disabled {
filter: brightness(0.9); filter: brightness(0.9);
cursor: not-allowed; cursor: not-allowed;

View File

@ -25,18 +25,18 @@
:global { :global {
.dots { .dots {
display: flex; display: flex;
padding: 10px 0; padding: 1rem 0;
justify-content: center; justify-content: center;
} }
.dot { .dot {
border: none; border: none;
width: 10px; width: 1rem;
height: 10px; height: 1rem;
background: #c5c5c5; background: #c5c5c5;
border-radius: 50%; border-radius: 50%;
margin: 0 5px; margin: 0 0.5rem;
padding: 5px; padding: 0.5rem;
cursor: pointer; cursor: pointer;
} }

View File

@ -2,7 +2,7 @@ import { useKeenSlider } from 'keen-slider/react'
import React, { useEffect } from 'react' import React, { useEffect } from 'react'
import 'keen-slider/keen-slider.min.css' import 'keen-slider/keen-slider.min.css'
import { CustomCarouselArrow } from './CustomArrow/CustomCarouselArrow' import { CustomCarouselArrow } from './CustomArrow/CustomCarouselArrow'
import s from './CaroucelCommon.module.scss' import s from './CarouselCommon.module.scss'
import { TOptionsEvents } from 'keen-slider' import { TOptionsEvents } from 'keen-slider'
import classNames from 'classnames' import classNames from 'classnames'
import CustomDot from './CustomDot/CustomDot' import CustomDot from './CustomDot/CustomDot'
@ -47,7 +47,6 @@ const CarouselCommon = <T,>({
useEffect(() => { useEffect(() => {
if(isDot && slider){ if(isDot && slider){
// console.log('f',Math.ceil(data.length/(Number(slider.details().slidesPerView)||1)))
let array:number[] let array:number[]
array = [...Array(Math.ceil(data.length/(Number(slider.details().slidesPerView)||1))).keys()].map((i)=>{ array = [...Array(Math.ceil(data.length/(Number(slider.details().slidesPerView)||1))).keys()].map((i)=>{
return (Number(slider.details().slidesPerView)||1)*i return (Number(slider.details().slidesPerView)||1)*i
@ -67,7 +66,6 @@ const CarouselCommon = <T,>({
const onDotClick = (index:number) => { const onDotClick = (index:number) => {
slider.moveToSlideRelative(Math.floor(index)) slider.moveToSlideRelative(Math.floor(index))
// setDotActive(index)
} }
return ( return (
<div className={s.navigationWrapper}> <div className={s.navigationWrapper}>
@ -88,12 +86,10 @@ const CarouselCommon = <T,>({
<CustomCarouselArrow <CustomCarouselArrow
side="right" side="right"
onClick={handleRightArrowClick} onClick={handleRightArrowClick}
// isDisabled={currentSlide === slider.details().size - 1}
/> />
<CustomCarouselArrow <CustomCarouselArrow
side="left" side="left"
onClick={handleLeftArrowClick} onClick={handleLeftArrowClick}
// isDisabled={currentSlide === 0}
/> />
</> </>
)} )}

View File

@ -1,20 +1,3 @@
// .customArrow{
// width: 64px;
// height: 64px;
// &:focus{
// outline: none;
// }
// @apply absolute top-1/2 bg-background-arrow transform -translate-y-1/2 flex justify-center items-center transition duration-100;
// &.leftArrow{
// @apply left-0;
// }
// &.rightArrow{
// @apply right-0;
// }
// &.isDisabled{
// @apply hidden ;
// }
// }
.navigationWrapper{ .navigationWrapper{
:global(.customArrow) { :global(.customArrow) {
width: 64px; width: 64px;

View File

@ -3,7 +3,6 @@ import React from 'react'
import ArrowLeft from 'src/components/icons/ArrowLeft' import ArrowLeft from 'src/components/icons/ArrowLeft'
import ArrowRight from 'src/components/icons/ArrowRight' import ArrowRight from 'src/components/icons/ArrowRight'
import "./CustomCarouselArrow.module.scss" import "./CustomCarouselArrow.module.scss"
// import s from "../CaroucelCommon.module.scss"
interface CustomCarouselArrowProps interface CustomCarouselArrowProps
extends React.ButtonHTMLAttributes<HTMLButtonElement> { extends React.ButtonHTMLAttributes<HTMLButtonElement> {
@ -18,7 +17,6 @@ export const CustomCarouselArrow = ({
return ( return (
<button <button
{...props} {...props}
// className={classNames(`${s.customArrow}`, { [`${s[`${side}Arrow`]}`]: side,[`${s.isDisabled}`]:isDisabled })}
className={classNames("customArrow", { [`${side}Arrow`]: side,"isDisabledArrow":isDisabled})} className={classNames("customArrow", { [`${side}Arrow`]: side,"isDisabledArrow":isDisabled})}
> >
{side==='left'?(<ArrowLeft/>):(<ArrowRight/>)} {side==='left'?(<ArrowLeft/>):(<ArrowRight/>)}

View File

@ -5,7 +5,6 @@
.warpper{ .warpper{
@apply flex justify-center items-center min-h-screen; @apply flex justify-center items-center min-h-screen;
.modal{ .modal{
// @apply bg-white inline-block;
@apply inline-block align-bottom bg-white relative; @apply inline-block align-bottom bg-white relative;
max-width: 50%; max-width: 50%;
padding: 3.2rem; padding: 3.2rem;

View File

@ -15,13 +15,15 @@
img{ img{
@apply inline; @apply inline;
} }
&:hover{
cursor: pointer;
}
} }
.productLabel{ .productLabel{
@apply absolute left-0 bottom-0; @apply absolute left-0 bottom-0;
} }
} }
.cardMid{ .cardMid{
// padding: 1.6rem 0;
min-height: 10.4rem; min-height: 10.4rem;
@apply flex flex-col justify-between; @apply flex flex-col justify-between;
.cardMidTop{ .cardMidTop{
@ -30,6 +32,9 @@
line-height: 2.4rem; line-height: 2.4rem;
font-size: 1.6rem; font-size: 1.6rem;
color: var(--text-active); color: var(--text-active);
&:hover{
cursor: pointer;
}
} }
.productWeight{ .productWeight{
font-size: 1.2rem; font-size: 1.2rem;
@ -39,6 +44,7 @@
} }
} }
.cardMidBot{ .cardMidBot{
padding-top: 0.8rem;
@apply flex justify-between items-center border-t border-solid border-line; @apply flex justify-between items-center border-t border-solid border-line;
.productPrice{ .productPrice{
@apply font-bold; @apply font-bold;
@ -52,7 +58,6 @@
min-height: 4rem; min-height: 4rem;
@apply flex justify-between items-center; @apply flex justify-between items-center;
.cardButton{ .cardButton{
// width: 13.6rem;
} }
} }
} }

View File

@ -1,3 +1,4 @@
import Link from 'next/link'
import React from 'react' import React from 'react'
import { ProductProps } from 'src/utils/types.utils' import { ProductProps } from 'src/utils/types.utils'
import ButtonCommon from '../ButtonCommon/ButtonCommon' import ButtonCommon from '../ButtonCommon/ButtonCommon'
@ -21,16 +22,20 @@ const ProductCard = ({
return ( return (
<div className={s.productCardWarpper}> <div className={s.productCardWarpper}>
<div className={s.cardTop}> <div className={s.cardTop}>
<div className={s.productImage}> <Link href="#">
<img src={imageSrc} alt="image" /> <div className={s.productImage}>
</div> <img src={imageSrc} alt="image" />
<div className={s.productLabel}>
<LabelCommon shape="half">{category}</LabelCommon>
</div> </div>
</Link>
<div className={s.productLabel}>
<LabelCommon shape="half">{category}</LabelCommon>
</div>
</div> </div>
<div className={s.cardMid}> <div className={s.cardMid}>
<div className={s.cardMidTop}> <div className={s.cardMidTop}>
<div className={s.productname}>{name} </div> <Link href="#">
<div className={s.productname}>{name} </div>
</Link>
<div className={s.productWeight}>{weight}</div> <div className={s.productWeight}>{weight}</div>
</div> </div>
<div className={s.cardMidBot}> <div className={s.cardMidBot}>
@ -42,10 +47,10 @@ const ProductCard = ({
</div> </div>
<div className={s.cardBot}> <div className={s.cardBot}>
<div className={s.cardIcon}> <div className={s.cardIcon}>
<ButtonIconBuy/> <ButtonIconBuy />
</div> </div>
<div className={s.cardButton}> <div className={s.cardButton}>
<ButtonCommon type="ghost">{buttonText}</ButtonCommon> <ButtonCommon type="light">{buttonText}</ButtonCommon>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,15 +0,0 @@
@import "../../../styles/utilities";
.productCardWarpper{
@apply spacing-horizontal;
@screen xl {
:global(.customArrow) {
&:global(.leftArrow){
left: calc(-6.4rem - 0rem);
}
&:global(.rightArrow){
right: calc(-6.4rem - 0rem);
}
}
}
}

View File

@ -0,0 +1,16 @@
@import '../../../styles/utilities';
.productCardWarpper {
@apply spacing-horizontal;
@screen xl {
:global(.customArrow) {
@screen lg {
&:global(.leftArrow) {
left: calc(-6.4rem - 2rem);
}
&:global(.rightArrow) {
right: calc(-6.4rem - 2rem);
}
}
}
}
}

View File

@ -4,9 +4,9 @@ import CarouselCommon, {
CarouselCommonProps, CarouselCommonProps,
} from '../CarouselCommon/CarouselCommon' } from '../CarouselCommon/CarouselCommon'
import ProductCard, { ProductCardProps } from '../ProductCard/ProductCard' import ProductCard, { ProductCardProps } from '../ProductCard/ProductCard'
import s from "./ProductCaroucel.module.scss" import s from "./ProductCarousel.module.scss"
interface ProductCaroucelProps interface ProductCarouselProps
extends Omit<CarouselCommonProps<ProductCardProps>, 'Component'|"option"> { extends Omit<CarouselCommonProps<ProductCardProps>, 'Component'|"option"> {
option?:TOptionsEvents option?:TOptionsEvents
} }
@ -19,16 +19,16 @@ const OPTION_DEFAULT: TOptionsEvents = {
slidesPerView: 3, slidesPerView: 3,
}, },
'(min-width: 768px)': { '(min-width: 768px)': {
slidesPerView: 3, slidesPerView: 4,
}, },
'(min-width: 1024px)': { '(min-width: 1024px)': {
slidesPerView: 4.5, slidesPerView: 4.5,
},'(min-width: 1280px)': { },'(min-width: 1280px)': {
slidesPerView: 6, slidesPerView: 5.5,
}, },
}, },
} }
const ProductCaroucel = ({ option, data, ...props }: ProductCaroucelProps) => { const ProductCarousel = ({ option, data, ...props }: ProductCarouselProps) => {
return ( return (
<div className={s.productCardWarpper}> <div className={s.productCardWarpper}>
<CarouselCommon<ProductCardProps> <CarouselCommon<ProductCardProps>
@ -41,4 +41,4 @@ const ProductCaroucel = ({ option, data, ...props }: ProductCaroucelProps) => {
) )
} }
export default ProductCaroucel export default ProductCarousel

View File

@ -6,15 +6,20 @@
width: 100%; width: 100%;
max-height: 22rem; max-height: 22rem;
border-radius: 2.4rem; border-radius: 2.4rem;
&:hover{
cursor: pointer;
}
} }
.title{ .title{
padding: 1.6rem 0.8rem 0.4rem 0.8rem; padding: 1.6rem 0.8rem 0.4rem 0.8rem;
// padding: 0 0.8rem;
@apply font-bold; @apply font-bold;
font-size: 2rem; font-size: 2rem;
line-height: 2.8rem; line-height: 2.8rem;
letter-spacing: -0.01em; letter-spacing: -0.01em;
color: var(--text-active); color: var(--text-active);
&:hover{
cursor: pointer;
}
} }
.description{ .description{
padding: 0 0.8rem; padding: 0 0.8rem;

View File

@ -1,3 +1,4 @@
import Link from 'next/link'
import React from 'react' import React from 'react'
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'
@ -6,10 +7,14 @@ export interface RecipeCardProps extends RecipeProps {}
const RecipeCard = ({ imageSrc, title, description }: RecipeCardProps) => { const RecipeCard = ({ imageSrc, title, description }: RecipeCardProps) => {
return ( return (
<div className={s.recipeCardWarpper}> <div className={s.recipeCardWarpper}>
<div className={s.image}> <Link href="#">
<img src={imageSrc} alt="image recipe" /> <div className={s.image}>
</div> <img src={imageSrc} alt="image recipe" />
<div className={s.title}>{title}</div> </div>
</Link>
<Link href="#">
<div className={s.title}>{title}</div>
</Link>
<div className={s.description}>{description}</div> <div className={s.description}>{description}</div>
</div> </div>
) )

View File

@ -1,14 +0,0 @@
@import '../../../styles/utilities';
.recipeCardWarpper {
@apply spacing-horizontal;
@screen xl {
:global(.customArrow) {
&:global(.leftArrow) {
left: calc(-6.4rem - 0rem);
}
&:global(.rightArrow) {
right: calc(-6.4rem - 0rem);
}
}
}
}

View File

@ -0,0 +1,16 @@
@import '../../../styles/utilities';
.recipeCardWarpper {
@apply spacing-horizontal;
@screen xl {
:global(.customArrow) {
@screen lg {
&:global(.leftArrow) {
left: calc(-6.4rem - 2rem);
}
&:global(.rightArrow) {
right: calc(-6.4rem - 2rem);
}
}
}
}
}

View File

@ -4,9 +4,9 @@ import CarouselCommon, {
CarouselCommonProps, CarouselCommonProps,
} from '../CarouselCommon/CarouselCommon' } from '../CarouselCommon/CarouselCommon'
import RecipeCard, { RecipeCardProps } from '../RecipeCard/RecipeCard' import RecipeCard, { RecipeCardProps } from '../RecipeCard/RecipeCard'
import s from "./RecipeCaroucel.module.scss" import s from "./RecipeCarousel.module.scss"
interface RecipeCaroucelProps interface RecipeCarouselProps
extends Omit<CarouselCommonProps<RecipeCardProps>, 'Component'|"option"> { extends Omit<CarouselCommonProps<RecipeCardProps>, 'Component'|"option"> {
option?:TOptionsEvents option?:TOptionsEvents
} }
@ -30,7 +30,7 @@ const OPTION_DEFAULT: TOptionsEvents = {
}, },
}, },
} }
const RecipeCaroucel = ({ option, data, ...props }: RecipeCaroucelProps) => { const RecipeCarousel = ({ option, data, ...props }: RecipeCarouselProps) => {
return ( return (
<div className={s.recipeCardWarpper}> <div className={s.recipeCardWarpper}>
<CarouselCommon<RecipeCardProps> <CarouselCommon<RecipeCardProps>
@ -43,4 +43,4 @@ const RecipeCaroucel = ({ option, data, ...props }: RecipeCaroucelProps) => {
) )
} }
export default RecipeCaroucel export default RecipeCarousel

View File

@ -4,7 +4,7 @@ export { default as CarouselCommon } from './CarouselCommon/CarouselCommon'
export { default as QuanittyInput } from './QuanittyInput/QuanittyInput' export { default as QuanittyInput } from './QuanittyInput/QuanittyInput'
export { default as LabelCommon } from './LabelCommon/LabelCommon' export { default as LabelCommon } from './LabelCommon/LabelCommon'
export { default as ProductCard } from './ProductCard/ProductCard' export { default as ProductCard } from './ProductCard/ProductCard'
export { default as ProductCaroucel } from './ProductCaroucel/ProductCaroucel' export { default as ProductCarousel } from './ProductCarousel/ProductCarousel'
export { default as FeaturedProductCard } from './FeaturedProductCard/FeaturedProductCard' export { default as FeaturedProductCard } from './FeaturedProductCard/FeaturedProductCard'
export { default as RecipeCard } from './RecipeCard/RecipeCard' export { default as RecipeCard } from './RecipeCard/RecipeCard'
export { default as Head } from './Head/Head' export { default as Head } from './Head/Head'

View File

@ -1,16 +1,18 @@
import React from 'react' import React from 'react'
import { import {
CollectionHeading, CollectionHeading,
ProductCaroucel, ProductCarousel,
ViewAllItem, ViewAllItem,
} from 'src/components/common' } from 'src/components/common'
import { CollectionHeadingProps } from 'src/components/common/CollectionHeading/CollectionHeading' import { CollectionHeadingProps } from 'src/components/common/CollectionHeading/CollectionHeading'
import { ProductCardProps } from 'src/components/common/ProductCard/ProductCard' import { ProductCardProps } from 'src/components/common/ProductCard/ProductCard'
import { QUERY_KEY, ROUTE } from 'src/utils/constanst.utils'
import s from './CollectionCarcoucel.module.scss' import s from './CollectionCarcoucel.module.scss'
interface ColectionCarcoucelProps extends CollectionHeadingProps { interface ColectionCarcoucelProps extends CollectionHeadingProps {
data: ProductCardProps[] data: ProductCardProps[]
itemKey: string itemKey: string
viewAllLink?: string viewAllLink?: string,
category:string
} }
const ColectionCarcoucel = ({ const ColectionCarcoucel = ({
@ -18,7 +20,8 @@ const ColectionCarcoucel = ({
itemKey, itemKey,
title, title,
subtitle, subtitle,
type type,
category
}: ColectionCarcoucelProps) => { }: ColectionCarcoucelProps) => {
return ( return (
<div className={s.colectionCarcoucelWarpper}> <div className={s.colectionCarcoucelWarpper}>
@ -31,11 +34,11 @@ const ColectionCarcoucel = ({
></CollectionHeading> ></CollectionHeading>
</div> </div>
<div className={s.right}> <div className={s.right}>
<ViewAllItem link="#"/> <ViewAllItem link={`${ROUTE.PRODUCTS}/?${QUERY_KEY.BRAND}=${category}`}/>
</div> </div>
</div> </div>
<div className={s.bot}> <div className={s.bot}>
<ProductCaroucel data={data} itemKey={itemKey} /> <ProductCarousel data={data} itemKey={itemKey} />
</div> </div>
</div> </div>
) )

View File

@ -96,40 +96,47 @@ const HomeCollection = (props: HomeCollectionProps) => {
return ( return (
<div className="w-full"> <div className="w-full">
<CollectionCarcoucel <CollectionCarcoucel
type="highlight"
data={dataTest} data={dataTest}
itemKey="product-1" itemKey="product-1"
title="VEGGIE" title="Fresh Products Today"
subtitle="Last call! Shop deep deals on 100+ bulk picks while you can." subtitle="Last call! Shop deep deals on 100+ bulk picks while you can."
category={"veggie"}
/> />
<CollectionCarcoucel <CollectionCarcoucel
data={dataTest} data={dataTest}
itemKey="product-2" itemKey="product-2"
title="VEGGIE" title="VEGGIE"
subtitle="Last call! Shop deep deals on 100+ bulk picks while you can." subtitle="Last call! Shop deep deals on 100+ bulk picks while you can."
category={"veggie"}
/> />
<CollectionCarcoucel <CollectionCarcoucel
data={dataTest} data={dataTest}
itemKey="product-3" itemKey="product-3"
title="VEGGIE" title="VEGGIE"
subtitle="Last call! Shop deep deals on 100+ bulk picks while you can." subtitle="Last call! Shop deep deals on 100+ bulk picks while you can."
category={"veggie"}
/> />
<CollectionCarcoucel <CollectionCarcoucel
data={dataTest} data={dataTest}
itemKey="product-4" itemKey="product-4"
title="VEGGIE" title="VEGGIE"
subtitle="Last call! Shop deep deals on 100+ bulk picks while you can." subtitle="Last call! Shop deep deals on 100+ bulk picks while you can."
category={"veggie"}
/> />
<CollectionCarcoucel <CollectionCarcoucel
data={dataTest} data={dataTest}
itemKey="product-5" itemKey="product-5"
title="VEGGIE" title="VEGGIE"
subtitle="Last call! Shop deep deals on 100+ bulk picks while you can." subtitle="Last call! Shop deep deals on 100+ bulk picks while you can."
category={"veggie"}
/> />
<CollectionCarcoucel <CollectionCarcoucel
data={dataTest} data={dataTest}
itemKey="product-6" itemKey="product-6"
title="VEGGIE" title="VEGGIE"
subtitle="Last call! Shop deep deals on 100+ bulk picks while you can." subtitle="Last call! Shop deep deals on 100+ bulk picks while you can."
category={"veggie"}
/> />
</div> </div>
) )

View File

@ -17,6 +17,7 @@
padding-bottom: 3.2rem; padding-bottom: 3.2rem;
@apply flex justify-start spacing-horizontal; @apply flex justify-start spacing-horizontal;
.tab{ .tab{
font-family: var(--font-heading);
padding: 1.6rem 1.6rem 0.8rem 1.6rem; padding: 1.6rem 1.6rem 0.8rem 1.6rem;
font-size: 2.4rem; font-size: 2.4rem;
line-height: 2.8rem; line-height: 2.8rem;
@ -31,9 +32,4 @@
} }
} }
// :global(.keen-slider__slide){
// @screen 2xl{
// margin-right: 2rem;
// }
// }
} }

View File

@ -1,17 +1,50 @@
import React from 'react' import React from 'react'
import { HeadingCommon, ViewAllItem } from 'src/components/common' import { HeadingCommon, ViewAllItem } from 'src/components/common'
import { RecipeCardProps } from 'src/components/common/RecipeCard/RecipeCard' import { RecipeCardProps } from 'src/components/common/RecipeCard/RecipeCard'
import RecipeCaroucel from 'src/components/common/RecipeCaroucel/RecipeCaroucel' import RecipeCarousel from 'src/components/common/RecipeCarousel/RecipeCarousel'
import s from './HomeRecipe.module.scss' import s from './HomeRecipe.module.scss'
import classNames from 'classnames'; import classNames from 'classnames';
import image13 from "../../../../../public/assets/images/image13.png"
import image14 from "../../../../../public/assets/images/image14.png"
import image12 from "../../../../../public/assets/images/image12.png"
interface HomeRecipeProps { interface HomeRecipeProps {
data: RecipeCardProps[] data?: RecipeCardProps[]
itemKey: string itemKey?: string
title: string title?: string
viewAllLink?: string viewAllLink?: string
} }
const HomeRecipe = ({ data, itemKey, title }: HomeRecipeProps) => {
const recipe:RecipeCardProps[] = [{
title: "Special Recipe of Vietnamese Phở",
description:"Alright, before we get to the actual recipe, lets chat for a sec about the ingredients. To make this pho soup recipe, you will need:",
imageSrc: image12.src
},{
title: "Original Recipe of Curry",
description:"Chicken curry is common to several countries including India, countries in Asia and the Caribbean. My favorite of them though is this aromatic Indian...",
imageSrc: image13.src
},{
title: "The Best Recipe of Beef Noodle Soup",
description:"The broth for Bun Bo Hue is prepared by slowly simmering various types of beef and pork bones (ox tail, beef shank, pork neck bones, pork feet,...",
imageSrc: image14.src
},{
title: "Special Recipe of Vietnamese Phở",
description:"Alright, before we get to the actual recipe, lets chat for a sec about the ingredients. To make this pho soup recipe, you will need:",
imageSrc: image12.src
},{
title: "Original Recipe of Curry",
description:"Chicken curry is common to several countries including India, countries in Asia and the Caribbean. My favorite of them though is this aromatic Indian...",
imageSrc: image13.src
},{
title: "The Best Recipe of Beef Noodle Soup",
description:"The broth for Bun Bo Hue is prepared by slowly simmering various types of beef and pork bones (ox tail, beef shank, pork neck bones, pork feet,...",
imageSrc: image14.src
}]
const HomeRecipe = ({ data =recipe, itemKey="home-recipe", title="Special Recipes" }: HomeRecipeProps) => {
return ( return (
<div className={s.homeRecipeWarpper}> <div className={s.homeRecipeWarpper}>
<div className={s.top}> <div className={s.top}>
@ -28,7 +61,7 @@ const HomeRecipe = ({ data, itemKey, title }: HomeRecipeProps) => {
<button className={s.tab}>Special Recipes</button> <button className={s.tab}>Special Recipes</button>
</div> </div>
<div className={s.bot}> <div className={s.bot}>
<RecipeCaroucel data={data} itemKey={itemKey} /> <RecipeCarousel data={data} itemKey={itemKey} />
</div> </div>
</div> </div>
) )

View File

@ -4,3 +4,4 @@ export { default as HomeCTA } from './HomeCTA/HomeCTA'
export { default as HomeSubscribe } from './HomeSubscribe/HomeSubscribe' export { default as HomeSubscribe } from './HomeSubscribe/HomeSubscribe'
export { default as HomeVideo } from './HomeVideo/HomeVideo' export { default as HomeVideo } from './HomeVideo/HomeVideo'
export { default as HomeCollection } from './HomeCollection/HomeCollection' export { default as HomeCollection } from './HomeCollection/HomeCollection'
export { default as HomeRecipe } from './HomeRecipe/HomeRecipe'

View File

@ -39,9 +39,6 @@
--font-size: 1.6rem; --font-size: 1.6rem;
--line-height: 2.4rem; --line-height: 2.4rem;
// --font-size: 16px;
// --line-height: 24px;
--font-sans: "Nunito", -apple-system, system-ui, BlinkMacSystemFont, "Helvetica Neue", "Helvetica", sans-serif; --font-sans: "Nunito", -apple-system, system-ui, BlinkMacSystemFont, "Helvetica Neue", "Helvetica", sans-serif;
--font-heading: "Righteous", -apple-system, system-ui, BlinkMacSystemFont, "Helvetica Neue", "Helvetica", sans-serif; --font-heading: "Righteous", -apple-system, system-ui, BlinkMacSystemFont, "Helvetica Neue", "Helvetica", sans-serif;
--font-logo: "Poppins", -apple-system, system-ui, BlinkMacSystemFont, "Helvetica Neue", "Helvetica", sans-serif; --font-logo: "Poppins", -apple-system, system-ui, BlinkMacSystemFont, "Helvetica Neue", "Helvetica", sans-serif;

View File

@ -88,6 +88,10 @@
padding-left: 6.4rem; padding-left: 6.4rem;
padding-right: 6.4rem; padding-right: 6.4rem;
} }
@screen lg {
padding-left: 11.2rem;
padding-right: 11.2rem;
}
} }
.spacing-horizontal-left { .spacing-horizontal-left {
padding-left: 2rem; padding-left: 2rem;