diff --git a/pages/index.tsx b/pages/index.tsx index 7ed22f1bc..0ddbcfe80 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -5,7 +5,7 @@ import { HomeBanner, HomeCategories, HomeCollection, HomeCTA, HomeFeature, HomeR export default function Home() { return ( <> - + diff --git a/src/components/common/Banner/Banner.module.scss b/src/components/common/Banner/Banner.module.scss index f4b374dd0..e69de29bb 100644 --- a/src/components/common/Banner/Banner.module.scss +++ b/src/components/common/Banner/Banner.module.scss @@ -1,52 +0,0 @@ -@import "../../../styles/utilities"; - -.banner { - @apply bg-primary-light custom-border-radius-lg overflow-hidden; - @screen md { - border: 1px solid var(--primary); - } - &.large { - margin-bottom: 2.8rem; - .inner { - @screen xl { - @apply bg-right-bottom; - background-size: unset; - } - } - } - .inner { - @apply bg-no-repeat; - background-size: 90%; - background-position: right -500% bottom 0%; - .content { - background-image: linear-gradient( - to right, - rgb(227, 242, 233, 0.9), - rgb(227, 242, 233, 0.5) 80%, - rgb(227, 242, 233, 0) - ); - padding: 1.6rem; - max-width: 37rem; - @screen md { - max-width: 49.6rem; - padding: 4.8rem; - } - .top { - .heading { - @apply heading-1 font-heading; - margin-bottom: 1.6rem; - } - .subHeading { - @apply sub-headline; - @screen md { - @apply caption; - } - } - } - - .bottom { - margin-top: 4rem; - } - } - } -} diff --git a/src/components/common/Banner/Banner.tsx b/src/components/common/Banner/Banner.tsx index a953052b6..1dbc04d9f 100644 --- a/src/components/common/Banner/Banner.tsx +++ b/src/components/common/Banner/Banner.tsx @@ -1,47 +1,24 @@ -import classNames from 'classnames' -import Link from 'next/link' import React, { memo } from 'react' -import { IconArrowRight } from 'src/components/icons' -import { ROUTE } from 'src/utils/constanst.utils' -import { LANGUAGE } from 'src/utils/language.utils' -import ButtonCommon from '../ButtonCommon/ButtonCommon' -import s from './Banner.module.scss' +import CarouselCommon from '../CarouselCommon/CarouselCommon' +import BannerItem, { BannerItemProps } from './BannerItem/BannerItem' interface Props { - imgLink: string, - title: string, - subtitle: string, - buttonLabel?: string, - linkButton?: string, - size?: 'small' | 'large', + data: BannerItemProps[], } -const Banner = memo(({ imgLink, title, subtitle, buttonLabel = LANGUAGE.BUTTON_LABEL.SHOP_NOW, linkButton = ROUTE.HOME, size = 'large' }: Props) => { +const option = { + slidesPerView: 1, + breakpoints: {} +} +const Banner = memo(({ data }: Props) => { return ( -
-
-
-
-

- {title} -

-
- {subtitle} -
-
- -
-
-
+ + data={data} + itemKey="banner" + Component={BannerItem} + option={option} + isDot = {true} + /> ) }) diff --git a/src/components/common/Banner/BannerItem/BannerItem.module.scss b/src/components/common/Banner/BannerItem/BannerItem.module.scss new file mode 100644 index 000000000..72690f92d --- /dev/null +++ b/src/components/common/Banner/BannerItem/BannerItem.module.scss @@ -0,0 +1,52 @@ +@import "../../../../styles/utilities"; + +.bannerItem { + @apply bg-primary-light custom-border-radius-lg overflow-hidden; + @screen md { + border: 1px solid var(--primary); + } + &.large { + margin-bottom: 2.8rem; + .inner { + @screen xl { + @apply bg-right-bottom; + background-size: unset; + } + } + } + .inner { + @apply bg-no-repeat; + background-size: 90%; + background-position: right -500% bottom 0%; + .content { + background-image: linear-gradient( + to right, + rgb(227, 242, 233, 0.9), + rgb(227, 242, 233, 0.5) 80%, + rgb(227, 242, 233, 0) + ); + padding: 1.6rem; + max-width: 37rem; + @screen md { + max-width: 49.6rem; + padding: 4.8rem; + } + .top { + .heading { + @apply heading-1 font-heading; + margin-bottom: 1.6rem; + } + .subHeading { + @apply sub-headline; + @screen md { + @apply caption; + } + } + } + + .bottom { + margin-top: 4rem; + } + } + } +} diff --git a/src/components/common/Banner/BannerItem/BannerItem.tsx b/src/components/common/Banner/BannerItem/BannerItem.tsx new file mode 100644 index 000000000..c7516d362 --- /dev/null +++ b/src/components/common/Banner/BannerItem/BannerItem.tsx @@ -0,0 +1,48 @@ +import classNames from 'classnames' +import Link from 'next/link' +import React, { memo } from 'react' +import { IconArrowRight } from 'src/components/icons' +import { ROUTE } from 'src/utils/constanst.utils' +import { LANGUAGE } from 'src/utils/language.utils' +import ButtonCommon from '../../ButtonCommon/ButtonCommon' +import s from './BannerItem.module.scss' + +export interface BannerItemProps { + imgLink: string, + title: string, + subtitle: string, + buttonLabel?: string, + linkButton?: string, + size?: 'small' | 'large', +} + +const BannerItem = memo(({ imgLink, title, subtitle, buttonLabel = LANGUAGE.BUTTON_LABEL.SHOP_NOW, linkButton = ROUTE.HOME, size = 'large' }: BannerItemProps) => { + return ( +
+
+
+
+

+ {title} +

+
+ {subtitle} +
+
+ +
+
+
+ ) +}) + +export default BannerItem diff --git a/src/components/common/Header/Header.tsx b/src/components/common/Header/Header.tsx index 4b2cf43c6..e9a06b9a8 100644 --- a/src/components/common/Header/Header.tsx +++ b/src/components/common/Header/Header.tsx @@ -13,7 +13,7 @@ import s from './Header.module.scss' const Header = memo(() => { const [isFullHeader, setIsFullHeader] = useState(true) - const { visible: visibleModalAuthen, closeModal: closeModalAuthen, openModal: openModalAuthen } = useModalCommon({ initialValue: true }) + const { visible: visibleModalAuthen, closeModal: closeModalAuthen, openModal: openModalAuthen } = useModalCommon({ initialValue: false }) const { visible: visibleModalInfo, closeModal: closeModalInfo, openModal: openModalInfo } = useModalCommon({ initialValue: false }) useEffect(() => { diff --git a/src/components/common/ModalAuthenticate/components/FormLogin/FormLogin.tsx b/src/components/common/ModalAuthenticate/components/FormLogin/FormLogin.tsx index 20a1a60ad..bedb993f4 100644 --- a/src/components/common/ModalAuthenticate/components/FormLogin/FormLogin.tsx +++ b/src/components/common/ModalAuthenticate/components/FormLogin/FormLogin.tsx @@ -26,8 +26,9 @@ const FormLogin = ({ onSwitch, isHide }: Props) => {
- + + {/* */}
diff --git a/src/components/common/ModalAuthenticate/components/FormRegister/FormRegister.tsx b/src/components/common/ModalAuthenticate/components/FormRegister/FormRegister.tsx index 40d4ef355..d03dbc39e 100644 --- a/src/components/common/ModalAuthenticate/components/FormRegister/FormRegister.tsx +++ b/src/components/common/ModalAuthenticate/components/FormRegister/FormRegister.tsx @@ -28,7 +28,7 @@ const FormRegister = ({ onSwitch, isHide }: Props) => {
- +
Must contain 8 characters with at least 1 uppercase and 1 lowercase letter and either 1 number or 1 special character.
diff --git a/src/components/modules/home/HomeBanner/HomeBanner.module.scss b/src/components/modules/home/HomeBanner/HomeBanner.module.scss index 3f41797d0..507558cad 100644 --- a/src/components/modules/home/HomeBanner/HomeBanner.module.scss +++ b/src/components/modules/home/HomeBanner/HomeBanner.module.scss @@ -5,6 +5,7 @@ margin-bottom: 2.8rem; .left { @apply hidden; + margin-bottom: 3rem; } @screen xl { @apply grid; diff --git a/src/components/modules/home/HomeBanner/HomeBanner.tsx b/src/components/modules/home/HomeBanner/HomeBanner.tsx index 8bbf75138..2a3a632fb 100644 --- a/src/components/modules/home/HomeBanner/HomeBanner.tsx +++ b/src/components/modules/home/HomeBanner/HomeBanner.tsx @@ -2,6 +2,7 @@ import React from 'react' import { Banner } from 'src/components/common' import s from './HomeBanner.module.scss' import BannerImgRight from './assets/banner_full.png' +import BannerImgRight2 from './assets/banner_product.png' interface Props { className?: string @@ -13,14 +14,25 @@ const HomeBanner = ({ }: Props) => {
- Freshness
guaranteed + Freshness
guaranteed
) diff --git a/src/components/modules/home/HomeBanner/assets/banner_product.png b/src/components/modules/home/HomeBanner/assets/banner_product.png new file mode 100644 index 000000000..82f1b7fee Binary files /dev/null and b/src/components/modules/home/HomeBanner/assets/banner_product.png differ