From a5f6cbbf241a8efecd86e9a2fd13c6e83c87af2c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Sep 2021 00:00:36 +0700 Subject: [PATCH 01/16] feat: DeliveryAndPolicyContent --- pages/index.tsx | 8 ++--- .../DeliveryAndPolicyContent.module.scss | 26 +++++++++++++++ .../DeliveryAndPolicyContent.tsx | 32 ++++++++++++++----- 3 files changed, 52 insertions(+), 14 deletions(-) diff --git a/pages/index.tsx b/pages/index.tsx index c193554a9..18028f88a 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -3,6 +3,7 @@ import { CardBlog, CollapseCommon, Layout, RelevantBlogPosts } from 'src/compone import { HomeBanner, HomeCategories, HomeCollection, HomeCTA, HomeFeature, HomeRecipe, HomeSubscribe, HomeVideo } from 'src/components/modules/home'; import {SelectCommon} from 'src/components/common' import card from "../public/assets/images/card.png" +import { DeliveryAndPolicyContent } from 'src/components/modules/delivery-policy'; const CONTENT = [ "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", @@ -24,12 +25,7 @@ export default function Home() { {/* */} {/* Sort By Sort By */} - - - - - - + {/* todo: uncomment */} {/* */} diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss index e69de29bb..8b7e42bf6 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss @@ -0,0 +1,26 @@ +.deliveryAndPolicyContentWrapper{ + max-width: 80.4rem; + min-height: 4rem; + margin-left: 31.8rem; + margin-right: 31.8rem; +} + +.titleWrapper{ + @apply flex flex-col items-start; +} + +.date{ + @apply inline flex flex-row; + margin-bottom: 0.4rem; +} + +.update{ + @apply uppercase leading-8; + color:var(--text-label); + font-size: 1.2rem; + letter-spacing: 0.01em; +} + +.contentContainer{ + @apply pb-16; +} \ No newline at end of file diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx index 7403a813a..a5c411b42 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx @@ -1,24 +1,40 @@ -import { DateTime } from 'src/components/common' +import { CollapseCommon, DateTime, HeadingCommon } from 'src/components/common' +import CollapseContent from 'src/components/common/CollapseCommon/CollapseContent/CollapseContent' import s from './DeliveryAndPolicyContent.module.scss' interface DeliveryAndPolicyContentProps{ - title?: string, + title: string, date: string, - content: string[], + content: Array, } +const CONTENT = [ + "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", + "Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", + "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", +] + const DeliveryAndPolicyContent = ( { title, date, content } : DeliveryAndPolicyContentProps) => { return ( -
+
-
LASTEST UPDATED: +
+
LASTEST UPDATED: 
-
- {title} -
+ {title}
+
+ { + content.map(item => ) + } +
+ + + + +
) From b944736868d382f4e065dd04e2a1e0eabc00ca27 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Sep 2021 09:25:31 +0700 Subject: [PATCH 02/16] styles: add flex, justify body --- .../DeliveryAndPolicyContent.module.scss | 6 ++-- .../DeliveryAndPolicyContent.tsx | 34 ++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss index 8b7e42bf6..3ea5108e5 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss @@ -1,8 +1,10 @@ +.wrapper{ + @apply flex justify-center; +} + .deliveryAndPolicyContentWrapper{ max-width: 80.4rem; min-height: 4rem; - margin-left: 31.8rem; - margin-right: 31.8rem; } .titleWrapper{ diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx index a5c411b42..0709257fc 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx @@ -16,25 +16,27 @@ const CONTENT = [ const DeliveryAndPolicyContent = ( { title, date, content } : DeliveryAndPolicyContentProps) => { return ( -
+
-
-
-
LASTEST UPDATED: 
- +
+
+
+
LASTEST UPDATED: 
+ +
+ {title}
- {title} +
+ { + content.map(item => ) + } +
+ + + + +
-
- { - content.map(item => ) - } -
- - - - -
) From 51a0a36974dff40d7ed6dbc79d1642b69d814138 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Sep 2021 22:27:24 +0700 Subject: [PATCH 03/16] feat: DeliveryAndPolicyPage --- src/components/common/index.ts | 1 + .../DeliveryAndPolicyBreadCrumb.module.scss | 5 +++++ .../DeliveryAndPolicyBreadCrumb.tsx | 21 +++++++++++++++++++ .../DeliveryAndPolicyPage.tsx | 13 ++++++++++++ .../modules/delivery-policy/index.tsx | 3 ++- 5 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.module.scss create mode 100644 src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx create mode 100644 src/components/modules/delivery-policy/DeliveryAndPolicyPage/DeliveryAndPolicyPage.tsx diff --git a/src/components/common/index.ts b/src/components/common/index.ts index d7095de6f..c73b5cb1d 100644 --- a/src/components/common/index.ts +++ b/src/components/common/index.ts @@ -38,3 +38,4 @@ export { default as ImgWithLink} from './ImgWithLink/ImgWithLink' export { default as RecipeDetail} from './RecipeDetail/RecipeDetail' export { default as DrawerCommon} from './DrawerCommon/DrawerCommon' export { default as CartDrawer} from './CartDrawer/CartDrawer' +export { default as BreadcrumbCommon} from './BreadcrumbCommon/BreadcrumbCommon' \ No newline at end of file diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.module.scss b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.module.scss new file mode 100644 index 000000000..f852cc60a --- /dev/null +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.module.scss @@ -0,0 +1,5 @@ +.breadCrumb{ + @apply absolute z-10; + padding-left: 3.2rem; + padding-top: 3rem; +} \ No newline at end of file diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx new file mode 100644 index 000000000..89cbb6cfa --- /dev/null +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx @@ -0,0 +1,21 @@ +import { BreadcrumbCommon } from 'src/components/common' +import s from './DeliveryAndPolicyBreadCrumb.module.scss' + +const CRUMB_DATA = [ + { + link: "/", + name: "Home" + }, + { + link: "/blog", + name: "Blog" + } +] +const DeliveryAndPolicyBreadCrumb = () => { + return ( +
+ +
+ ) +} +export default DeliveryAndPolicyBreadCrumb \ No newline at end of file diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyPage/DeliveryAndPolicyPage.tsx b/src/components/modules/delivery-policy/DeliveryAndPolicyPage/DeliveryAndPolicyPage.tsx new file mode 100644 index 000000000..8fc9542fd --- /dev/null +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyPage/DeliveryAndPolicyPage.tsx @@ -0,0 +1,13 @@ +import DeliveryAndPolicyBreadCrumb from "../DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb" +import DeliveryAndPolicyContent from "../DeliveryAndPolicyContent/DeliveryAndPolicyContent" + + +const DeliveryAndPolicyPage = () => { + return ( + <> + + + + ) +} +export default DeliveryAndPolicyPage \ No newline at end of file diff --git a/src/components/modules/delivery-policy/index.tsx b/src/components/modules/delivery-policy/index.tsx index 7062c369f..bb23bd6c8 100644 --- a/src/components/modules/delivery-policy/index.tsx +++ b/src/components/modules/delivery-policy/index.tsx @@ -1 +1,2 @@ -export { default as DeliveryAndPolicyContent} from './DeliveryAndPolicyContent/DeliveryAndPolicyContent' \ No newline at end of file +export { default as DeliveryAndPolicyContent } from './DeliveryAndPolicyContent/DeliveryAndPolicyContent' +export { default as DeliveryAndPolicyBreadCrumb } from './DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb' \ No newline at end of file From 7fa5e6cd3a3469ea4c93a3bda1bb3e46c5c16b03 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Sep 2021 23:22:09 +0700 Subject: [PATCH 04/16] refactor: format code and add data test --- pages/test.tsx | 142 +----------------- .../BreadcrumbCommon/BreadcrumbCommon.tsx | 58 +++++-- src/components/common/index.ts | 7 +- src/components/icons/index.ts | 7 - .../DeliveryAndPolicyBreadCrumb.module.scss | 5 +- .../DeliveryAndPolicyBreadCrumb.tsx | 2 +- .../DeliveryAndPolicyContent.module.scss | 49 +++--- .../DeliveryAndPolicyContent.tsx | 56 +++++-- .../DeliveryAndPolicyPage.tsx | 1 - .../modules/delivery-policy/index.tsx | 3 +- 10 files changed, 122 insertions(+), 208 deletions(-) diff --git a/pages/test.tsx b/pages/test.tsx index 5afc61235..c21f4cd6c 100644 --- a/pages/test.tsx +++ b/pages/test.tsx @@ -1,146 +1,14 @@ import { useState } from 'react' import { - ButtonCommon, - Layout, - ModalCommon, - ProductCarousel, - RelevantBlogPosts, - CollapseCommon, + Layout } from 'src/components/common' -import { CollectionCarcousel } from 'src/components/modules/home' -import image5 from '../public/assets/images/image5.png' -import image6 from '../public/assets/images/image6.png' -import image7 from '../public/assets/images/image7.png' -import image8 from '../public/assets/images/image8.png' -const dataTest = [ - { - name: 'Tomato', - weight: '250g', - category: 'VEGGIE', - price: 'Rp 27.500', - imageSrc: image5.src, - }, - { - name: 'Cucumber', - weight: '250g', - category: 'VEGGIE', - price: 'Rp 27.500', - imageSrc: image6.src, - }, - { - name: 'Carrot', - weight: '250g', - category: 'VEGGIE', - price: 'Rp 27.500', - imageSrc: image7.src, - }, - { - name: 'Salad', - weight: '250g', - category: 'VEGGIE', - price: 'Rp 27.500', - imageSrc: image8.src, - }, - { - name: 'Tomato', - weight: '250g', - category: 'VEGGIE', - price: 'Rp 27.500', - imageSrc: image5.src, - }, - { - name: 'Cucumber', - weight: '250g', - category: 'VEGGIE', - price: 'Rp 27.500', - imageSrc: image6.src, - }, - { - name: 'Tomato', - weight: '250g', - category: 'VEGGIE', - price: 'Rp 27.500', - imageSrc: image5.src, - }, - { - name: 'Cucumber', - weight: '250g', - category: 'VEGGIE', - price: 'Rp 27.500', - imageSrc: image6.src, - }, - { - name: 'Carrot', - weight: '250g', - category: 'VEGGIE', - price: 'Rp 27.500', - imageSrc: image7.src, - }, - { - name: 'Salad', - weight: '250g', - category: 'VEGGIE', - price: 'Rp 27.500', - imageSrc: image8.src, - }, - { - name: 'Tomato', - weight: '250g', - category: 'VEGGIE', - price: 'Rp 27.500', - imageSrc: image5.src, - }, - { - name: 'Cucumber', - weight: '250g', - category: 'VEGGIE', - price: 'Rp 27.500', - imageSrc: image6.src, - }, -] -const COLLAPSE_DATA = [ - { - title: "This is a subtitle", - content: [ - "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", - "Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", - "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", - ], - link: "/title" - }, - { - title: "This is a subtitle", - content: [ - "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", - "Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", - "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", - ], - link: "/title" - }, - { - title: "This is a subtitle", - content: [ - "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", - "Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", - "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", - ], - link: "/title" - }, - { - title: "This is a subtitle", - content: [ - "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", - "Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", - "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", - ], - link: "/title" - }, -] +import { DeliveryAndPolicyPage } from 'src/components/modules/delivery-policy' + + export default function Test() { return ( <> - - + ) } diff --git a/src/components/common/BreadcrumbCommon/BreadcrumbCommon.tsx b/src/components/common/BreadcrumbCommon/BreadcrumbCommon.tsx index 6ad2e6817..ef82ad16c 100644 --- a/src/components/common/BreadcrumbCommon/BreadcrumbCommon.tsx +++ b/src/components/common/BreadcrumbCommon/BreadcrumbCommon.tsx @@ -1,5 +1,4 @@ import React from 'react' -import { ROUTE } from 'src/utils/constanst.utils' import s from './BreadcrumbCommon.module.scss' import BreadcrumbItem from './components/BreadcrumbItem/BreadcrumbItem' import BreadcrumbSeparator from './components/BreadcrumbSeparator/BreadcrumbSeparator' @@ -9,28 +8,55 @@ interface BreadcrumbCommonProps { showHomePage?: boolean; } -const BreadcrumbCommon = ({ crumbs, showHomePage = true }: BreadcrumbCommonProps) => { +const BreadcrumbCommon = ({ crumbs, showHomePage=true } : BreadcrumbCommonProps) => { return (
{ - - showHomePage && + showHomePage && crumbs[0].link==="/" && crumbs.map((crumb, i) => { + if (i === 0) { + return ( + + ) + } + if (i === crumbs.length-1) { + return ( + + {crumb.name} + + ) + } + return ( + + + + ) + }) } { - crumbs.length > 0 && <> - - { - crumbs.slice(0, crumbs.length - 1).map((crumb) => ( - < BreadcrumbSeparator key={crumb.name}> - + !showHomePage && crumbs.map((crumb, i) => { + if (i === 0) { + return + } + if (i === 1) { + return ( + + ) + } + if (i === crumbs.length-1) { + return ( + + {crumb.name} - ))} - < BreadcrumbSeparator> - {crumbs[crumbs.length - 1].name} - - + ) + } + return ( + + + + ) + }) } -
+
) } diff --git a/src/components/common/index.ts b/src/components/common/index.ts index da24e7eee..d10f17f8c 100644 --- a/src/components/common/index.ts +++ b/src/components/common/index.ts @@ -36,9 +36,4 @@ export { default as RelevantBlogPosts} from './RelevantBlogPosts/RelevantBlogPos export { default as CollapseCommon} from './CollapseCommon/CollapseCommon' export { default as ImgWithLink} from './ImgWithLink/ImgWithLink' export { default as RecipeDetail} from './RecipeDetail/RecipeDetail' -<<<<<<< HEAD -export { default as DrawerCommon} from './DrawerCommon/DrawerCommon' -export { default as CartDrawer} from './CartDrawer/CartDrawer' -export { default as BreadcrumbCommon} from './BreadcrumbCommon/BreadcrumbCommon' -======= ->>>>>>> 0f6cdc9f66ceaf2b0aec38d0d6444de902b69bfe +export { default as BreadcrumbCommon} from './BreadcrumbCommon/BreadcrumbCommon' \ No newline at end of file diff --git a/src/components/icons/index.ts b/src/components/icons/index.ts index f0e3d74ce..1cdb56079 100644 --- a/src/components/icons/index.ts +++ b/src/components/icons/index.ts @@ -23,10 +23,3 @@ export { default as IconCheck } from './IconCheck' export { default as IconTime } from './IconTime' export { default as IconPeople } from './IconPeople' export { default as IconLocation } from './IconLocation' -<<<<<<< HEAD -export { default as IconClose } from './IconClose' -export { default as IconDelete } from './IconDelete' -export { default as IconPlus } from './IconPlus' -export { default as IconMinus } from './IconMinus' -======= ->>>>>>> 0f6cdc9f66ceaf2b0aec38d0d6444de902b69bfe diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.module.scss b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.module.scss index f852cc60a..0ef4cbc45 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.module.scss +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.module.scss @@ -1,5 +1,4 @@ -.breadCrumb{ - @apply absolute z-10; +.breadCrumb { + @apply absolute z-10 pt-12; padding-left: 3.2rem; - padding-top: 3rem; } \ No newline at end of file diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx index 89cbb6cfa..767045fff 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx @@ -15,7 +15,7 @@ const DeliveryAndPolicyBreadCrumb = () => { return (
-
+
) } export default DeliveryAndPolicyBreadCrumb \ No newline at end of file diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss index 3ea5108e5..87fae1224 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss @@ -1,28 +1,23 @@ -.wrapper{ - @apply flex justify-center; +.wrapper { + @apply flex justify-center pt-20 pb-28; + .deliveryAndPolicyContentWrapper { + max-width: 80.4rem; + min-height: 4rem; + .titleWrapper { + @apply flex flex-col items-start; + .date { + @apply inline flex flex-row; + margin-bottom: 0.4rem; + .update { + @apply uppercase leading-8; + color:var(--text-label); + font-size: 1.2rem; + letter-spacing: 0.01em; + } + } + } + .contentContainer { + @apply pb-16; + } + } } - -.deliveryAndPolicyContentWrapper{ - max-width: 80.4rem; - min-height: 4rem; -} - -.titleWrapper{ - @apply flex flex-col items-start; -} - -.date{ - @apply inline flex flex-row; - margin-bottom: 0.4rem; -} - -.update{ - @apply uppercase leading-8; - color:var(--text-label); - font-size: 1.2rem; - letter-spacing: 0.01em; -} - -.contentContainer{ - @apply pb-16; -} \ No newline at end of file diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx index d9368ae87..9faa5f81f 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx @@ -1,20 +1,58 @@ import { CollapseCommon, DateTime, HeadingCommon } from 'src/components/common' -import CollapseContent from 'src/components/common/CollapseCommon/CollapseContent/CollapseContent' +import CollapseContent from 'src/components/common/CollapseCommon/CollapseChild/CollapseContent/CollapseContent' import s from './DeliveryAndPolicyContent.module.scss' interface DeliveryAndPolicyContentProps{ - title: string, - date: string, - content: Array, + title?: string, + date?: string, + content?: Array, } - -const CONTENT = [ +const HEADER_CONTENT = [ "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", "Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", ] -const DeliveryAndPolicyContent = ( { title, date, content } : DeliveryAndPolicyContentProps) => { +const DELIVERYANDPOLICY_DATA = [ + { + title: "This is a subtitle", + content: [ + "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", + "Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", + "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", + ], + link: "/title" + }, + { + title: "This is a subtitle", + content: [ + "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", + "Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", + "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", + ], + link: "/title" + }, + { + title: "This is a subtitle", + content: [ + "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", + "Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", + "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", + ], + link: "/title" + }, + { + title: "This is a subtitle", + content: [ + "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", + "Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", + "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", + ], + link: "/title" + } +] + +const DeliveryAndPolicyContent = ( { title="Delivery & Policy", date="APRIL 30", content = HEADER_CONTENT } : DeliveryAndPolicyContentProps) => { return (
@@ -28,10 +66,10 @@ const DeliveryAndPolicyContent = ( { title, date, content } : DeliveryAndPolicyC
{ - content.map(item => ) + content.map(item => ) }
- \ +
diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyPage/DeliveryAndPolicyPage.tsx b/src/components/modules/delivery-policy/DeliveryAndPolicyPage/DeliveryAndPolicyPage.tsx index 8fc9542fd..4ff3c7237 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyPage/DeliveryAndPolicyPage.tsx +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyPage/DeliveryAndPolicyPage.tsx @@ -1,7 +1,6 @@ import DeliveryAndPolicyBreadCrumb from "../DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb" import DeliveryAndPolicyContent from "../DeliveryAndPolicyContent/DeliveryAndPolicyContent" - const DeliveryAndPolicyPage = () => { return ( <> diff --git a/src/components/modules/delivery-policy/index.tsx b/src/components/modules/delivery-policy/index.tsx index bb23bd6c8..776889f36 100644 --- a/src/components/modules/delivery-policy/index.tsx +++ b/src/components/modules/delivery-policy/index.tsx @@ -1,2 +1,3 @@ export { default as DeliveryAndPolicyContent } from './DeliveryAndPolicyContent/DeliveryAndPolicyContent' -export { default as DeliveryAndPolicyBreadCrumb } from './DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb' \ No newline at end of file +export { default as DeliveryAndPolicyBreadCrumb } from './DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb' +export { default as DeliveryAndPolicyPage } from './DeliveryAndPolicyPage/DeliveryAndPolicyPage' \ No newline at end of file From 023087048e0099efe2bdd7e5d108425d92f8d35c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Sep 2021 20:00:35 +0700 Subject: [PATCH 05/16] remove: DeliveryAndPolicyPage --- pages/delivery-policy.tsx | 12 ++++++++++++ .../DeliveryAndPolicyBreadCrumb.tsx | 4 ++-- .../DeliveryAndPolicyPage/DeliveryAndPolicyPage.tsx | 12 ------------ 3 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 pages/delivery-policy.tsx delete mode 100644 src/components/modules/delivery-policy/DeliveryAndPolicyPage/DeliveryAndPolicyPage.tsx diff --git a/pages/delivery-policy.tsx b/pages/delivery-policy.tsx new file mode 100644 index 000000000..daf1b5fd0 --- /dev/null +++ b/pages/delivery-policy.tsx @@ -0,0 +1,12 @@ +import { Layout } from "src/components/common" +import { DeliveryAndPolicyContent, DeliveryAndPolicyBreadCrumb } from "src/components/modules/delivery-policy" + +export default function DeliveryAndPolicyPage () { + return ( + <> + + + + ) +} +DeliveryAndPolicyPage.Layout = Layout \ No newline at end of file diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx index 767045fff..c55105e23 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx @@ -7,8 +7,8 @@ const CRUMB_DATA = [ name: "Home" }, { - link: "/blog", - name: "Blog" + link: "/delivery-policy", + name: "Delivery And Policy" } ] const DeliveryAndPolicyBreadCrumb = () => { diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyPage/DeliveryAndPolicyPage.tsx b/src/components/modules/delivery-policy/DeliveryAndPolicyPage/DeliveryAndPolicyPage.tsx deleted file mode 100644 index 4ff3c7237..000000000 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyPage/DeliveryAndPolicyPage.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import DeliveryAndPolicyBreadCrumb from "../DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb" -import DeliveryAndPolicyContent from "../DeliveryAndPolicyContent/DeliveryAndPolicyContent" - -const DeliveryAndPolicyPage = () => { - return ( - <> - - - - ) -} -export default DeliveryAndPolicyPage \ No newline at end of file From 51c8642d246ca533eb276a76aa546fb694712dc5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Sep 2021 20:08:26 +0700 Subject: [PATCH 06/16] styles: add padding DeliveryAndPolicyContent --- .../DeliveryAndPolicyContent.module.scss | 4 +++- src/components/modules/delivery-policy/index.tsx | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss index 87fae1224..d122ecae2 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss @@ -1,5 +1,7 @@ +@import "../../../../styles/utilities"; + .wrapper { - @apply flex justify-center pt-20 pb-28; + @apply flex justify-center pt-20 pb-28 spacing-horizontal; .deliveryAndPolicyContentWrapper { max-width: 80.4rem; min-height: 4rem; diff --git a/src/components/modules/delivery-policy/index.tsx b/src/components/modules/delivery-policy/index.tsx index 776889f36..bb23bd6c8 100644 --- a/src/components/modules/delivery-policy/index.tsx +++ b/src/components/modules/delivery-policy/index.tsx @@ -1,3 +1,2 @@ export { default as DeliveryAndPolicyContent } from './DeliveryAndPolicyContent/DeliveryAndPolicyContent' -export { default as DeliveryAndPolicyBreadCrumb } from './DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb' -export { default as DeliveryAndPolicyPage } from './DeliveryAndPolicyPage/DeliveryAndPolicyPage' \ No newline at end of file +export { default as DeliveryAndPolicyBreadCrumb } from './DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb' \ No newline at end of file From 1d833a3a7badc1b79950687865d4dd24110fa787 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Sep 2021 20:43:49 +0700 Subject: [PATCH 07/16] remove: remove CollapseContent --- .../CollapseChild/CollapseChild.module.scss | 1 + .../CollapseChild/CollapseChild.tsx | 7 +- .../CollapseContent.module.scss | 3 - .../CollapseContent/CollapseContent.tsx | 15 ---- .../common/CollapseCommon/CollapseCommon.tsx | 6 +- .../DeliveryAndPolicyContent.module.scss | 3 +- .../DeliveryAndPolicyContent.tsx | 73 ++++++++++--------- 7 files changed, 48 insertions(+), 60 deletions(-) delete mode 100644 src/components/common/CollapseCommon/CollapseChild/CollapseContent/CollapseContent.module.scss delete mode 100644 src/components/common/CollapseCommon/CollapseChild/CollapseContent/CollapseContent.tsx diff --git a/src/components/common/CollapseCommon/CollapseChild/CollapseChild.module.scss b/src/components/common/CollapseCommon/CollapseChild/CollapseChild.module.scss index e6a71e44e..0a0b3b665 100644 --- a/src/components/common/CollapseCommon/CollapseChild/CollapseChild.module.scss +++ b/src/components/common/CollapseCommon/CollapseChild/CollapseChild.module.scss @@ -53,6 +53,7 @@ } .contentContainer { @apply hidden pb-16; + padding-top: 1.6rem; } @keyframes ContentAnimationIn { 0% { diff --git a/src/components/common/CollapseCommon/CollapseChild/CollapseChild.tsx b/src/components/common/CollapseCommon/CollapseChild/CollapseChild.tsx index 22cbcda10..397b0dcda 100644 --- a/src/components/common/CollapseCommon/CollapseChild/CollapseChild.tsx +++ b/src/components/common/CollapseCommon/CollapseChild/CollapseChild.tsx @@ -1,12 +1,11 @@ import s from './CollapseChild.module.scss' import { useState } from 'react' import classNames from 'classnames' -import CollapseContent from './CollapseContent/CollapseContent' import Link from 'next/link' interface CollapseProps{ title?: string, - content: Array, + content: string, isToggle?: boolean, link?: string, } @@ -30,9 +29,7 @@ const CollapseChild = ({title, content, isToggle=false, link="/"}: CollapseProps
- { - content.map(item => ) - } + {content}
) diff --git a/src/components/common/CollapseCommon/CollapseChild/CollapseContent/CollapseContent.module.scss b/src/components/common/CollapseCommon/CollapseChild/CollapseContent/CollapseContent.module.scss deleted file mode 100644 index 9e5cfba30..000000000 --- a/src/components/common/CollapseCommon/CollapseChild/CollapseContent/CollapseContent.module.scss +++ /dev/null @@ -1,3 +0,0 @@ -.content { - margin-top: 1.6rem; -} \ No newline at end of file diff --git a/src/components/common/CollapseCommon/CollapseChild/CollapseContent/CollapseContent.tsx b/src/components/common/CollapseCommon/CollapseChild/CollapseContent/CollapseContent.tsx deleted file mode 100644 index e18e19c0a..000000000 --- a/src/components/common/CollapseCommon/CollapseChild/CollapseContent/CollapseContent.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import s from './CollapseContent.module.scss' - -interface CollapseContentProps{ - content: string -} - -const CollapseContent = ({content}: CollapseContentProps) => { - return ( -
- {content} -
- ) -} - -export default CollapseContent \ No newline at end of file diff --git a/src/components/common/CollapseCommon/CollapseCommon.tsx b/src/components/common/CollapseCommon/CollapseCommon.tsx index 98030ffce..4f020ae90 100644 --- a/src/components/common/CollapseCommon/CollapseCommon.tsx +++ b/src/components/common/CollapseCommon/CollapseCommon.tsx @@ -1,15 +1,15 @@ import CollapseChild from './CollapseChild/CollapseChild' interface CollapseCommonProps{ - data: {title: string, content: Array, link: string}[], + data: {title: string, content: string, link: string}[], } const CollapseCommon = ({data}: CollapseCommonProps) => { return (
{ - data.map(item => - + data.map((item,index) => + ) }
diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss index d122ecae2..d793dc3c7 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss @@ -18,8 +18,9 @@ } } } - .contentContainer { + .content { @apply pb-16; + padding-top: 1.6rem; } } } diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx index 9faa5f81f..5a98e8853 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx @@ -1,58 +1,67 @@ import { CollapseCommon, DateTime, HeadingCommon } from 'src/components/common' -import CollapseContent from 'src/components/common/CollapseCommon/CollapseChild/CollapseContent/CollapseContent' import s from './DeliveryAndPolicyContent.module.scss' interface DeliveryAndPolicyContentProps{ title?: string, date?: string, - content?: Array, + content?: string, } -const HEADER_CONTENT = [ - "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", - "Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", - "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", -] +const HEADER_CONTENT = +`When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces. + +Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. + +This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`; const DELIVERYANDPOLICY_DATA = [ { title: "This is a subtitle", - content: [ - "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", - "Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", - "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", - ], + content: `When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces. + + Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. + + This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`, link: "/title" }, { title: "This is a subtitle", - content: [ - "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", - "Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", - "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", - ], + content: `When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces. + + Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. + + This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`, link: "/title" }, { title: "This is a subtitle", - content: [ - "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", - "Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", - "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", - ], + content: `When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces. + + Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. + + This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`, link: "/title" }, { title: "This is a subtitle", - content: [ - "When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces.", - "Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", - "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", - ], + content: `When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces. + + Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. + + This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`, link: "/title" - } + }, + { + title: "This is a subtitle", + content: `When you’re trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when it’s cut up into bite size spoonable pieces. + + Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. + + This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`, + link: "/title" + }, ] -const DeliveryAndPolicyContent = ( { title="Delivery & Policy", date="APRIL 30", content = HEADER_CONTENT } : DeliveryAndPolicyContentProps) => { +const DeliveryAndPolicyContent = ( { title="Delivery & Policy", date="APRIL 30, 2021", content = HEADER_CONTENT } : DeliveryAndPolicyContentProps) => { return (
@@ -64,10 +73,8 @@ const DeliveryAndPolicyContent = ( { title="Delivery & Policy", date="APRIL 30", {title} -
- { - content.map(item => ) - } +
+ {content}
From 0699b0dfd71ed597aa43a3c656fd7c2cf24a4f9e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Sep 2021 21:24:48 +0700 Subject: [PATCH 08/16] merge: fix conflict --- .../common/BreadcrumbCommon/BreadcrumbCommon.module.scss | 3 --- src/components/common/Layout/Layout.tsx | 4 ---- 2 files changed, 7 deletions(-) diff --git a/src/components/common/BreadcrumbCommon/BreadcrumbCommon.module.scss b/src/components/common/BreadcrumbCommon/BreadcrumbCommon.module.scss index 95c8526e1..8f6c05bf7 100644 --- a/src/components/common/BreadcrumbCommon/BreadcrumbCommon.module.scss +++ b/src/components/common/BreadcrumbCommon/BreadcrumbCommon.module.scss @@ -2,10 +2,7 @@ .breadcrumbCommon { color: var(--text-base); -<<<<<<< HEAD -======= .currentItem { cursor: default; } ->>>>>>> a9f9f06eb9dee2a1ddefe907ff804237a78c5210 } diff --git a/src/components/common/Layout/Layout.tsx b/src/components/common/Layout/Layout.tsx index 17f520185..adf7c3d7b 100644 --- a/src/components/common/Layout/Layout.tsx +++ b/src/components/common/Layout/Layout.tsx @@ -2,7 +2,6 @@ import { CommerceProvider } from '@framework' import { useRouter } from 'next/router' import { FC } from 'react' import { useModalCommon } from 'src/components/hooks' -import { CartDrawer } from '..' import Footer from '../Footer/Footer' import Header from '../Header/Header' import s from './Layout.module.scss' @@ -30,9 +29,6 @@ const Layout: FC = ({ children }) => {
{children}
-
From d79e971bed97e753d28545a4165bbd39c247a5ed Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Sep 2021 21:32:26 +0700 Subject: [PATCH 09/16] refactor: update link --- .../DeliveryAndPolicyContent.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx index 5a98e8853..84307deaf 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx @@ -1,5 +1,6 @@ import { CollapseCommon, DateTime, HeadingCommon } from 'src/components/common' import s from './DeliveryAndPolicyContent.module.scss' +import { ROUTE } from 'src/utils/constanst.utils' interface DeliveryAndPolicyContentProps{ title?: string, @@ -21,7 +22,7 @@ const DELIVERYANDPOLICY_DATA = [ Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`, - link: "/title" + link: `${ROUTE.PRIVACY_POLICY}/title` }, { title: "This is a subtitle", @@ -30,7 +31,7 @@ const DELIVERYANDPOLICY_DATA = [ Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`, - link: "/title" + link: `${ROUTE.PRIVACY_POLICY}/title` }, { title: "This is a subtitle", @@ -39,7 +40,7 @@ const DELIVERYANDPOLICY_DATA = [ Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`, - link: "/title" + link: `${ROUTE.PRIVACY_POLICY}/title` }, { title: "This is a subtitle", @@ -48,7 +49,7 @@ const DELIVERYANDPOLICY_DATA = [ Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`, - link: "/title" + link: `${ROUTE.PRIVACY_POLICY}/title` }, { title: "This is a subtitle", @@ -57,7 +58,7 @@ const DELIVERYANDPOLICY_DATA = [ Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`, - link: "/title" + link: `${ROUTE.PRIVACY_POLICY}/title` }, ] From 69d5e64deaacd460c1bd3f600bf86147e1800c1b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Sep 2021 21:34:36 +0700 Subject: [PATCH 10/16] remove: remove link CollapseCommon --- src/components/common/CollapseCommon/CollapseCommon.tsx | 4 ++-- .../DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/common/CollapseCommon/CollapseCommon.tsx b/src/components/common/CollapseCommon/CollapseCommon.tsx index 4f020ae90..2e378abf9 100644 --- a/src/components/common/CollapseCommon/CollapseCommon.tsx +++ b/src/components/common/CollapseCommon/CollapseCommon.tsx @@ -1,7 +1,7 @@ import CollapseChild from './CollapseChild/CollapseChild' interface CollapseCommonProps{ - data: {title: string, content: string, link: string}[], + data: {title: string, content: string}[], } const CollapseCommon = ({data}: CollapseCommonProps) => { @@ -9,7 +9,7 @@ const CollapseCommon = ({data}: CollapseCommonProps) => {
{ data.map((item,index) => - + ) }
diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx index 84307deaf..6045288f6 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx @@ -1,6 +1,5 @@ import { CollapseCommon, DateTime, HeadingCommon } from 'src/components/common' import s from './DeliveryAndPolicyContent.module.scss' -import { ROUTE } from 'src/utils/constanst.utils' interface DeliveryAndPolicyContentProps{ title?: string, @@ -22,7 +21,6 @@ const DELIVERYANDPOLICY_DATA = [ Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`, - link: `${ROUTE.PRIVACY_POLICY}/title` }, { title: "This is a subtitle", @@ -31,7 +29,6 @@ const DELIVERYANDPOLICY_DATA = [ Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`, - link: `${ROUTE.PRIVACY_POLICY}/title` }, { title: "This is a subtitle", @@ -40,7 +37,6 @@ const DELIVERYANDPOLICY_DATA = [ Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`, - link: `${ROUTE.PRIVACY_POLICY}/title` }, { title: "This is a subtitle", @@ -49,7 +45,6 @@ const DELIVERYANDPOLICY_DATA = [ Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`, - link: `${ROUTE.PRIVACY_POLICY}/title` }, { title: "This is a subtitle", @@ -58,7 +53,6 @@ const DELIVERYANDPOLICY_DATA = [ Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to. This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.`, - link: `${ROUTE.PRIVACY_POLICY}/title` }, ] From 98c08910adc1662a3d00db0e83e8601125b42a30 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Sep 2021 21:58:35 +0700 Subject: [PATCH 11/16] styles: add white-spaces --- .../CollapseCommon/CollapseChild/CollapseChild.module.scss | 2 +- .../DeliveryAndPolicyContent.module.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/common/CollapseCommon/CollapseChild/CollapseChild.module.scss b/src/components/common/CollapseCommon/CollapseChild/CollapseChild.module.scss index 0a0b3b665..839f4de65 100644 --- a/src/components/common/CollapseCommon/CollapseChild/CollapseChild.module.scss +++ b/src/components/common/CollapseCommon/CollapseChild/CollapseChild.module.scss @@ -52,7 +52,7 @@ } } .contentContainer { - @apply hidden pb-16; + @apply hidden pb-16 whitespace-pre-line; padding-top: 1.6rem; } @keyframes ContentAnimationIn { diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss index d793dc3c7..be88621b5 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss @@ -19,7 +19,7 @@ } } .content { - @apply pb-16; + @apply pb-16 whitespace-pre-line; padding-top: 1.6rem; } } From 0299c3082990e2b27ecc4ab12267d4c39e0cf235 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Sep 2021 10:00:03 +0700 Subject: [PATCH 12/16] styles: change padding --- .../DeliveryAndPolicyBreadCrumb.module.scss | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.module.scss b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.module.scss index 0ef4cbc45..abf7ef84f 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.module.scss +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.module.scss @@ -1,4 +1,8 @@ +@import "../../../../styles/utilities"; + .breadCrumb { - @apply absolute z-10 pt-12; - padding-left: 3.2rem; + @apply absolute z-10 pt-12 spacing-horizontal; + @screen lg{ + padding-left: 3.2rem; + } } \ No newline at end of file From 8848065674d53c314f89b1f1203f4fe2c8c24908 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Sep 2021 11:48:42 +0700 Subject: [PATCH 13/16] merge: override BreadCrumb Common --- .../BreadcrumbCommon/BreadcrumbCommon.tsx | 60 ++++++------------- .../BreadcrumbItem/BreadcrumbItem.tsx | 2 +- 2 files changed, 18 insertions(+), 44 deletions(-) diff --git a/src/components/common/BreadcrumbCommon/BreadcrumbCommon.tsx b/src/components/common/BreadcrumbCommon/BreadcrumbCommon.tsx index ef82ad16c..cc5733342 100644 --- a/src/components/common/BreadcrumbCommon/BreadcrumbCommon.tsx +++ b/src/components/common/BreadcrumbCommon/BreadcrumbCommon.tsx @@ -1,4 +1,5 @@ import React from 'react' +import { ROUTE } from 'src/utils/constanst.utils' import s from './BreadcrumbCommon.module.scss' import BreadcrumbItem from './components/BreadcrumbItem/BreadcrumbItem' import BreadcrumbSeparator from './components/BreadcrumbSeparator/BreadcrumbSeparator' @@ -8,56 +9,29 @@ interface BreadcrumbCommonProps { showHomePage?: boolean; } -const BreadcrumbCommon = ({ crumbs, showHomePage=true } : BreadcrumbCommonProps) => { +const BreadcrumbCommon = ({ crumbs, showHomePage = true }: BreadcrumbCommonProps) => { return (
{ - showHomePage && crumbs[0].link==="/" && crumbs.map((crumb, i) => { - if (i === 0) { - return ( - - ) - } - if (i === crumbs.length-1) { - return ( - - {crumb.name} - - ) - } - return ( - - - - ) - }) + + showHomePage && } { - !showHomePage && crumbs.map((crumb, i) => { - if (i === 0) { - return - } - if (i === 1) { - return ( - - ) - } - if (i === crumbs.length-1) { - return ( - - {crumb.name} + crumbs.length > 0 && <> + + { + crumbs.slice(0, crumbs.length - 1).map((crumb) => ( + < BreadcrumbSeparator key={crumb.name}> + - ) - } - return ( - - - - ) - }) + ))} + < BreadcrumbSeparator> + {crumbs[crumbs.length - 1].name} + + } -
+
) } -export default BreadcrumbCommon +export default BreadcrumbCommon \ No newline at end of file diff --git a/src/components/common/BreadcrumbCommon/components/BreadcrumbItem/BreadcrumbItem.tsx b/src/components/common/BreadcrumbCommon/components/BreadcrumbItem/BreadcrumbItem.tsx index 13f980ea9..24f58a066 100644 --- a/src/components/common/BreadcrumbCommon/components/BreadcrumbItem/BreadcrumbItem.tsx +++ b/src/components/common/BreadcrumbCommon/components/BreadcrumbItem/BreadcrumbItem.tsx @@ -15,4 +15,4 @@ const BreadcrumbItem = ({ text, href }: BreadcrumbItemProps) => { ) } -export default BreadcrumbItem +export default BreadcrumbItem \ No newline at end of file From 2f4f19414e425b1134cb2859ee6adfa5916be202 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Sep 2021 12:00:43 +0700 Subject: [PATCH 14/16] refactor: change data test --- .../DeliveryAndPolicyBreadCrumb.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx index c55105e23..992370ce5 100644 --- a/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx @@ -2,10 +2,6 @@ import { BreadcrumbCommon } from 'src/components/common' import s from './DeliveryAndPolicyBreadCrumb.module.scss' const CRUMB_DATA = [ - { - link: "/", - name: "Home" - }, { link: "/delivery-policy", name: "Delivery And Policy" From 3e4b056ee81d1bcca34356c58c02b810fd62857f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Sep 2021 15:21:34 +0700 Subject: [PATCH 15/16] refactor: change link --- src/components/common/Footer/Footer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/Footer/Footer.tsx b/src/components/common/Footer/Footer.tsx index a830c60ea..2bbc9cf06 100644 --- a/src/components/common/Footer/Footer.tsx +++ b/src/components/common/Footer/Footer.tsx @@ -48,7 +48,7 @@ const FOOTER_COLUMNS = [ }, { name: 'Privacy Policy', - link: ROUTE.TERM_CONDITION, + link: ROUTE.PRIVACY_POLICY, }, { name: 'Blog', From f649fbf83c6d9c4828c298184a361746e2492f32 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Sep 2021 15:36:07 +0700 Subject: [PATCH 16/16] refactor: change file name --- pages/{delivery-policy.tsx => privacy-policy.tsx} | 0 src/components/icons/index.ts | 4 ++++ 2 files changed, 4 insertions(+) rename pages/{delivery-policy.tsx => privacy-policy.tsx} (100%) diff --git a/pages/delivery-policy.tsx b/pages/privacy-policy.tsx similarity index 100% rename from pages/delivery-policy.tsx rename to pages/privacy-policy.tsx diff --git a/src/components/icons/index.ts b/src/components/icons/index.ts index 523b9c488..477d8863c 100644 --- a/src/components/icons/index.ts +++ b/src/components/icons/index.ts @@ -25,3 +25,7 @@ export { default as IconCheck } from './IconCheck' export { default as IconTime } from './IconTime' export { default as IconPeople } from './IconPeople' export { default as IconLocation } from './IconLocation' +export { default as IconClose } from './IconClose' +export { default as IconDelete } from './IconDelete' +export { default as IconPlus } from './IconPlus' +export { default as IconMinus } from './IconMinus' \ No newline at end of file