diff --git a/.gitignore b/.gitignore index 61386b73c..34232cff6 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,5 @@ yarn-error.log* # vercel .vercel + +.eslintrc diff --git a/codegen.bigcommerce.json b/codegen.bigcommerce.json deleted file mode 100644 index 1f14e88ac..000000000 --- a/codegen.bigcommerce.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "schema": { - "https://buybutton.store/graphql": { - "headers": { - "Authorization": "Bearer xzy" - } - } - }, - "documents": [ - { - "./framework/bigcommerce/api/**/*.ts": { - "noRequire": true - } - } - ], - "generates": { - "./framework/bigcommerce/schema.d.ts": { - "plugins": ["typescript", "typescript-operations"] - }, - "./framework/bigcommerce/schema.graphql": { - "plugins": ["schema-ast"] - } - }, - "hooks": { - "afterAllFileWrite": ["prettier --write"] - } -} diff --git a/next-env.d.ts b/next-env.d.ts index c6643fda1..9bc3dd46b 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,3 +1,6 @@ /// /// /// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/next.config.js b/next.config.js index d3ad64f4a..27bddfae6 100644 --- a/next.config.js +++ b/next.config.js @@ -13,6 +13,16 @@ const isVendure = provider === 'vendure' module.exports = withCommerceConfig({ commerce, + typescript: { // todo: remove it + // !! WARN !! + // Dangerously allow production builds to successfully complete even if + // your project has type errors. + // !! WARN !! + ignoreBuildErrors: true, + }, + eslint: { + ignoreDuringBuilds: true, + }, images: { // todo: replace domains for images domains: ['user-images.githubusercontent.com'], diff --git a/pages/blogs.tsx b/pages/blogs.tsx new file mode 100644 index 000000000..84e56b55d --- /dev/null +++ b/pages/blogs.tsx @@ -0,0 +1,14 @@ +import { Layout } from 'src/components/common'; +import { BlogsList, FeaturedCardBlog, BlogHeading, BlogBreadCrumb } from 'src/components/modules/blogs'; + +export default function BlogsPage() { + return( + <> + + + + + + ) +} +BlogsPage.Layout = Layout \ No newline at end of file diff --git a/pages/index.tsx b/pages/index.tsx index 7d23ebadd..e7b5cab7d 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -13,7 +13,7 @@ export default function Home() { - {/* // todo: uncomment */} + {/* // todo: uncomment {/* */} ) diff --git a/pages/privacy-policy.tsx b/pages/privacy-policy.tsx new file mode 100644 index 000000000..daf1b5fd0 --- /dev/null +++ b/pages/privacy-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/public/assets/images/author.png b/public/assets/images/author.png new file mode 100644 index 000000000..70c922bc6 Binary files /dev/null and b/public/assets/images/author.png differ diff --git a/public/assets/images/image20.png b/public/assets/images/image20.png new file mode 100644 index 000000000..548870b87 Binary files /dev/null and b/public/assets/images/image20.png differ diff --git a/public/assets/images/image21.png b/public/assets/images/image21.png new file mode 100644 index 000000000..6cb7b2b43 Binary files /dev/null and b/public/assets/images/image21.png differ diff --git a/public/assets/images/image22.png b/public/assets/images/image22.png new file mode 100644 index 000000000..c45a22c1c Binary files /dev/null and b/public/assets/images/image22.png differ diff --git a/public/assets/images/image23.png b/public/assets/images/image23.png new file mode 100644 index 000000000..928642628 Binary files /dev/null and b/public/assets/images/image23.png differ diff --git a/src/components/common/BreadcrumbCommon/BreadcrumbCommon.tsx b/src/components/common/BreadcrumbCommon/BreadcrumbCommon.tsx index be84dcb67..32ad88ab0 100644 --- a/src/components/common/BreadcrumbCommon/BreadcrumbCommon.tsx +++ b/src/components/common/BreadcrumbCommon/BreadcrumbCommon.tsx @@ -35,4 +35,4 @@ const BreadcrumbCommon = ({ crumbs, showHomePage = true }: BreadcrumbCommonProps ) } -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 diff --git a/src/components/common/BreadcrumbCommon/components/BreadcrumbSeparator/BreadcrumbSeparator.tsx b/src/components/common/BreadcrumbCommon/components/BreadcrumbSeparator/BreadcrumbSeparator.tsx index 370c342d8..f84bc3a51 100644 --- a/src/components/common/BreadcrumbCommon/components/BreadcrumbSeparator/BreadcrumbSeparator.tsx +++ b/src/components/common/BreadcrumbCommon/components/BreadcrumbSeparator/BreadcrumbSeparator.tsx @@ -1,7 +1,7 @@ import React from 'react' interface BreadcrumbSeparatorProps { - children?: React.ReactNode + children?: React.ReactNode; } const BreadcrumbSeparator = ({ children }: BreadcrumbSeparatorProps) => { diff --git a/src/components/common/CardBlog/CardBlog.module.scss b/src/components/common/CardBlog/CardBlog.module.scss index f0dc00b3a..6e62ed5ff 100644 --- a/src/components/common/CardBlog/CardBlog.module.scss +++ b/src/components/common/CardBlog/CardBlog.module.scss @@ -3,7 +3,6 @@ .cardBlogWarpper { @apply inline-flex flex-col justify-start; max-width: 39.2rem; - min-height: 34.4rem; .image { width: 100%; max-height: 22rem; @@ -11,6 +10,9 @@ &:hover { cursor: pointer; } + img{ + border-radius: 2.4rem; + } } .title { padding: 1.6rem 0.8rem 0.4rem 0.8rem; diff --git a/src/components/common/CollapseCommon/CollapseChild/CollapseChild.module.scss b/src/components/common/CollapseCommon/CollapseChild/CollapseChild.module.scss index e6a71e44e..839f4de65 100644 --- a/src/components/common/CollapseCommon/CollapseChild/CollapseChild.module.scss +++ b/src/components/common/CollapseCommon/CollapseChild/CollapseChild.module.scss @@ -52,7 +52,8 @@ } } .contentContainer { - @apply hidden pb-16; + @apply hidden pb-16 whitespace-pre-line; + 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 53cd70cf3..408b0c397 100644 --- a/src/components/common/CollapseCommon/CollapseChild/CollapseChild.tsx +++ b/src/components/common/CollapseCommon/CollapseChild/CollapseChild.tsx @@ -1,11 +1,10 @@ import s from './CollapseChild.module.scss' import { useState } from 'react' import classNames from 'classnames' -import CollapseContent from './CollapseContent/CollapseContent' interface CollapseProps{ title?: string, - content: Array, + content: string, isToggle?: boolean, } const CollapseChild = ({title, content, isToggle=false}: CollapseProps) => { @@ -26,9 +25,7 @@ const CollapseChild = ({title, content, isToggle=false}: 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 e695a6576..2e378abf9 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}[], + data: {title: string, content: string}[], } const CollapseCommon = ({data}: CollapseCommonProps) => { return (
{ - data.map(item => - + data.map((item,index) => + ) }
diff --git a/src/components/common/Footer/Footer.tsx b/src/components/common/Footer/Footer.tsx index a830c60ea..bf16bd3d7 100644 --- a/src/components/common/Footer/Footer.tsx +++ b/src/components/common/Footer/Footer.tsx @@ -48,11 +48,11 @@ const FOOTER_COLUMNS = [ }, { name: 'Privacy Policy', - link: ROUTE.TERM_CONDITION, + link: ROUTE.PRIVACY_POLICY, }, { name: 'Blog', - link: ROUTE.TERM_CONDITION, + link: ROUTE.BLOGS, }, ] } diff --git a/src/components/common/TabCommon/TabCommon.module.scss b/src/components/common/TabCommon/TabCommon.module.scss index 6dcb203c1..d8b5d0f9a 100644 --- a/src/components/common/TabCommon/TabCommon.module.scss +++ b/src/components/common/TabCommon/TabCommon.module.scss @@ -1,3 +1,4 @@ + @import '../../../styles/utilities'; .tabWapper{ @apply flex flex-col w-full; diff --git a/src/components/common/TabCommon/TabCommon.tsx b/src/components/common/TabCommon/TabCommon.tsx index afefb0da3..7214361f7 100644 --- a/src/components/common/TabCommon/TabCommon.tsx +++ b/src/components/common/TabCommon/TabCommon.tsx @@ -1,86 +1,85 @@ import React, { - Children, - PropsWithChildren, - ReactElement, - RefObject, - useEffect, - useRef, - useState, - cloneElement, -} from 'react' -import s from './TabCommon.module.scss' - -import TabItem from './components/TabItem/TabItem' -import { TabPaneProps } from './components/TabPane/TabPane' -import classNames from 'classnames' - -interface TabCommonProps { - defaultActiveTab?: number - children: React.ReactNode - center?:boolean -} - -const TabCommon = ({ - defaultActiveTab = 0, - children, - center -}: TabCommonProps) => { - const [active, setActive] = useState(0) - const slider = useRef(null) - const headerRef = useRef(null) - useEffect(() => { - setActive(defaultActiveTab) - }, []) - - useEffect(() => { - slide(active) - }, [active]) - - function slide(index: number) { - const active = headerRef.current?.children - .item(index) - ?.getBoundingClientRect() - const header = headerRef.current?.getBoundingClientRect() - const current = slider.current - if (current && active && header) { - let width = active.width - 24 <= 0 ? 24 : active.width - 24 - let left = active.left - header.left - current.style.width = width.toString() + 'px' - current.style.left = left.toString() + 'px' + Children, + PropsWithChildren, + ReactElement, + useEffect, + useRef, + useState, + cloneElement, + } from 'react' + import s from './TabCommon.module.scss' + + import TabItem from './components/TabItem/TabItem' + import { TabPaneProps } from './components/TabPane/TabPane' + import classNames from 'classnames' + + interface TabCommonProps { + defaultActiveTab?: number + children: React.ReactNode + center?:boolean + } + + const TabCommon = ({ + defaultActiveTab = 0, + children, + center + }: TabCommonProps) => { + const [active, setActive] = useState(0) + const slider = useRef(null) + const headerRef = useRef(null) + useEffect(() => { + setActive(defaultActiveTab) + }, []) + + useEffect(() => { + slide(active) + }, [active]) + + function slide(index: number) { + const active = headerRef.current?.children + .item(index) + ?.getBoundingClientRect() + const header = headerRef.current?.getBoundingClientRect() + const current = slider.current + if (current && active && header) { + let width = active.width - 24 <= 0 ? 24 : active.width - 24 + let left = active.left - header.left + current.style.width = width.toString() + 'px' + current.style.left = left.toString() + 'px' + } } + const onTabClick = (index: number) => { + setActive(index) + } + return ( +
+
+
    + {Children.map(children, (tab, index) => { + let item = tab as ReactElement> + return ( +
  • + + {item.props.tabName} + +
  • + ) + })} +
    +
+
+
+ {Children.map(children, (tab, index) => { + let item = tab as ReactElement> + return cloneElement(item, { active:index===active }); + }) + }
+
+ ) } - const onTabClick = (index: number) => { - setActive(index) - } - return ( -
-
-
    - {Children.map(children, (tab, index) => { - let item = tab as ReactElement> - return ( -
  • - - {item.props.tabName} - -
  • - ) - })} -
    -
-
-
- {Children.map(children, (tab, index) => { - let item = tab as ReactElement> - return cloneElement(item, { active:index===active }); - }) - }
-
- ) -} - -export default TabCommon + + export default TabCommon diff --git a/src/components/common/TabCommon/TabItem/TabItem.module.scss b/src/components/common/TabCommon/TabItem/TabItem.module.scss new file mode 100644 index 000000000..bdbb0b66a --- /dev/null +++ b/src/components/common/TabCommon/TabItem/TabItem.module.scss @@ -0,0 +1,22 @@ +@import '../../../../styles/utilities'; + +.tabItem { + margin-right: 4.8rem; + padding-top: 1.6rem; + padding-bottom: 1.6rem; + + &:hover { + @apply cursor-pointer; + } +} + +.tabItemActive { + @apply font-bold; + margin-right: 4.8rem; + padding-top: 1.6rem; + padding-bottom: 1.6rem; + + &:hover { + @apply cursor-pointer; + } +} diff --git a/src/components/common/TabCommon/TabItem/TabItem.tsx b/src/components/common/TabCommon/TabItem/TabItem.tsx new file mode 100644 index 000000000..ab9eb69f9 --- /dev/null +++ b/src/components/common/TabCommon/TabItem/TabItem.tsx @@ -0,0 +1,19 @@ +import React from "react" +import s from './TabItem.module.scss' + +interface TabItemProps { + active: boolean; + children: string; + onClick: (tabIndex: number, tabPane?: string) => void; +} + +const TabItem = ({ active = false, children, onClick } : TabItemProps) => { + + return ( + + {children} + + ) +} + +export default TabItem; \ No newline at end of file diff --git a/src/components/common/TabCommon/components/TabItem/TabItem.module.scss b/src/components/common/TabCommon/components/TabItem/TabItem.module.scss index 2b4f6af7f..159a38f57 100644 --- a/src/components/common/TabCommon/components/TabItem/TabItem.module.scss +++ b/src/components/common/TabCommon/components/TabItem/TabItem.module.scss @@ -11,4 +11,3 @@ @apply font-bold; } } - diff --git a/src/components/common/TabCommon/components/TabItem/TabItem.tsx b/src/components/common/TabCommon/components/TabItem/TabItem.tsx index 742c1e0dd..cc1737e44 100644 --- a/src/components/common/TabCommon/components/TabItem/TabItem.tsx +++ b/src/components/common/TabCommon/components/TabItem/TabItem.tsx @@ -1,5 +1,9 @@ import classNames from 'classnames' +<<<<<<< HEAD import React, { RefObject, useRef } from 'react' +======= +import React from 'react' +>>>>>>> 88f90912429447f6ae7bafa77484465965e0ee13 import s from './TabItem.module.scss' interface TabItemProps { @@ -21,7 +25,6 @@ const TabItem = ({ return ( {children} @@ -29,4 +32,8 @@ const TabItem = ({ ) } +<<<<<<< HEAD export default TabItem +======= +export default TabItem +>>>>>>> 88f90912429447f6ae7bafa77484465965e0ee13 diff --git a/src/components/common/index.ts b/src/components/common/index.ts index a6bbef517..7de333d3a 100644 --- a/src/components/common/index.ts +++ b/src/components/common/index.ts @@ -36,6 +36,7 @@ export { default as CardItemCheckout} from './CardItemCheckout/CardItemCheckout' export { default as CardBlog} from './CardBlog/CardBlog' export { default as RelevantBlogPosts} from './RelevantBlogPosts/RelevantBlogPosts' export { default as CollapseCommon} from './CollapseCommon/CollapseCommon' +export { default as BreadcrumbCommon } from './BreadcrumbCommon/BreadcrumbCommon' export { default as ImgWithLink} from './ImgWithLink/ImgWithLink' export { default as RecipeDetail} from './RecipeDetail/RecipeDetail' export { default as DrawerCommon} from './DrawerCommon/DrawerCommon' diff --git a/src/components/modules/account/AccountNavigation/AccountNavigation.module.scss b/src/components/modules/account/AccountNavigation/AccountNavigation.module.scss index 22c885238..8bece6668 100644 --- a/src/components/modules/account/AccountNavigation/AccountNavigation.module.scss +++ b/src/components/modules/account/AccountNavigation/AccountNavigation.module.scss @@ -1,5 +1,27 @@ @import '../../../../styles/utilities'; .accountNavigation { - @apply spacing-horizontal; + @apply flex; + width: 100%; + + .slider { + @apply inline-block; + width: 0.2rem; + height: 4.8rem; + border-radius: 3px; + background-color: var(--primary); + position: absolute; + left: 11.2rem; + transition: all .2s linear; + } + + .tabList { + margin-top: 3.8rem; + margin-right: 12.4rem; + } + + .tabBody { + margin-top: -4.7rem; + width: 100%; + } } \ No newline at end of file diff --git a/src/components/modules/account/AccountNavigation/AccountNavigation.tsx b/src/components/modules/account/AccountNavigation/AccountNavigation.tsx index 15ecd3a31..929f386f2 100644 --- a/src/components/modules/account/AccountNavigation/AccountNavigation.tsx +++ b/src/components/modules/account/AccountNavigation/AccountNavigation.tsx @@ -1,65 +1,67 @@ -import React, { useState, useRef, RefObject, useEffect } from "react" +import React, { useRef, useEffect, Children, ReactElement, PropsWithChildren, useState, cloneElement } from "react" import s from './AccountNavigation.module.scss' -import AccountNavigationItem from './components/AccountNavigationItem' +import AccountNavigationItem from './components/AccountNavigationItem/AccountNavigationItem' +import {TabPaneProps} from '../../../common/TabCommon/components/TabPane/TabPane' interface AccountNavigationProps { - + defaultActiveIndex: number; + children: React.ReactNode } -const AccountNavigation = ({ } : AccountNavigationProps) => { - const active = "active", unActive = ""; +const AccountNavigation = ({ defaultActiveIndex, children } : AccountNavigationProps) => { + const [active, setActive] = useState(defaultActiveIndex) + const sliderRef = useRef(null); + const headerRef = useRef(null) - const [item1Active, setItem1Active] = useState(unActive); - const [item2Active, setItem2Active] = useState(active); - const [item3Active, setItem3Active] = useState(unActive); - - const item1 = useRef(null); - const item2 = useRef(null); - const item3 = useRef(null); - const slider = useRef(null); - - function slide(ref: RefObject) { - const top = ref.current.offsetTop; - slider.current.style.top = top.toString()+"px"; + const onTabClick = (index: number) => { + setActive(index) } - function toggleItem1():void { - setItem1Active(active) + function slide(index: number) { + const active = headerRef.current?.children.item(index)?.getBoundingClientRect() + const header = headerRef.current?.getBoundingClientRect() + const current = sliderRef.current - setItem2Active(unActive) - setItem3Active(unActive) - slide(item1); - } - function toggleItem2():void { - setItem2Active(active) - - setItem1Active(unActive) - setItem3Active(unActive) - slide(item2); - } - function toggleItem3():void { - setItem3Active(active) - - setItem1Active(unActive) - setItem2Active(unActive) - slide(item3); + if (current && active && header) { + const top = active.top; + current.style.top = top.toString()+"px"; + } } useEffect(() => { - slide(item2); - }, []) + slide(active); + }, [active]) return (
-
- Customer Information -
-
- Your Orders -
-
- Favourites +
    + { + Children.map(children, (tab, index) => { + let item = tab as ReactElement> + return ( +
  • + + {item.props.tabName} + +
  • + ) + }) + } +
    +
+ +
+ { + Children.map(children, (tab, index) => { + let item = tab as ReactElement> + return cloneElement(item, { active: index === active }); + }) + }
diff --git a/src/components/modules/account/AccountNavigation/components/AccountNavigationItem.module.scss b/src/components/modules/account/AccountNavigation/components/AccountNavigationItem.module.scss index 01fc0e1cc..12d3e1f02 100644 --- a/src/components/modules/account/AccountNavigation/components/AccountNavigationItem.module.scss +++ b/src/components/modules/account/AccountNavigation/components/AccountNavigationItem.module.scss @@ -1,7 +1,6 @@ -@import '../../../../../styles/utilities'; +@import '../../../../../../styles/utilities'; .accountNavigationItem { - @apply bg-gray; width: 28rem; padding: 1.2rem 0 1.2rem 1.6rem; margin-bottom: 1.2rem; @@ -14,6 +13,5 @@ &.active { background-color: #FBFBFB; border-radius: 0 1.6rem 1.6rem 0; - border-left: 2px solid var(--primary); } } \ No newline at end of file diff --git a/src/components/modules/account/AccountNavigation/components/AccountNavigationItem.tsx b/src/components/modules/account/AccountNavigation/components/AccountNavigationItem.tsx index 8bb18cb58..9ac8a387f 100644 --- a/src/components/modules/account/AccountNavigation/components/AccountNavigationItem.tsx +++ b/src/components/modules/account/AccountNavigation/components/AccountNavigationItem.tsx @@ -4,15 +4,19 @@ import s from './AccountNavigationItem.module.scss' interface AccountNavigationItemProps { children?: string; - active?: string; - target?: string; - onClick: () => void; + active?: boolean; + tabIndex: number + onClick: (index: number) => void; } -const AccountNavigationItem = ({ children, active="", onClick } : AccountNavigationItemProps) => { +const AccountNavigationItem = ({ children, active, tabIndex, onClick } : AccountNavigationItemProps) => { + + const handleClick = () => { + onClick(tabIndex) + } return ( -
{children}
diff --git a/src/components/modules/account/AccountPage/AccountPage.module.scss b/src/components/modules/account/AccountPage/AccountPage.module.scss new file mode 100644 index 000000000..3f8307750 --- /dev/null +++ b/src/components/modules/account/AccountPage/AccountPage.module.scss @@ -0,0 +1,26 @@ +@import '../../../../styles/utilities'; + +.accountPage { + @apply spacing-horizontal; + background-color: #F5F4F2; + margin-top: -3.2rem; + padding-top: 3.2rem; + padding-bottom: 3.2rem; + + @screen md { + padding-left: 3.2rem; + padding-right: 3.2rem; + } + + @screen xl { + @apply spacing-horizontal + } + + .header { + margin-bottom: 1.2rem; + + @screen md { + margin-bottom: 3.8rem; + } + } +} \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/AccountPage.tsx b/src/components/modules/account/AccountPage/AccountPage.tsx new file mode 100644 index 000000000..a5a0ef79d --- /dev/null +++ b/src/components/modules/account/AccountPage/AccountPage.tsx @@ -0,0 +1,86 @@ +import React, { useState } from "react" +import s from './AccountPage.module.scss' + +import AccountNavigation from '../AccountNavigation/AccountNavigation' +import HeadingCommon from '../../../common/HeadingCommon/HeadingCommon' +import AccountInfomation from "./components/AccountInfomation/AccountInfomation" +import OrderInfomation from './components/OrderInformation/OrderInformation' +import EditInfoModal from './components/EditInfoModal/EditInfoModal' +import TabPane from "src/components/common/TabCommon/components/TabPane/TabPane" + +const waiting = [ + { + id: "NO 123456", + products: ["Tomato", "Fish", "Pork", "Onion"], + totalPrice : 1000 + } +] + +const delivering = [ + { + id: "NO 123456", + products: ["Tomato", "Fish", "Pork", "Onion", "Tomato", "Fish", "Pork", "Onion"], + totalPrice : 1000 + } +] + +const delivered = [ + { + id: "NO 123456", + products: ["Tomato", "Fish", "Pork", "Onion", "Tomato", "Fish", "Pork", "Onion"], + totalPrice : 1000 + } +] + +let account = { + name: "vu duong", + email: "vuduong@gmail.com", + address: "234 Dien Bien Phu Bis, Dakao ward", + state: "District 1", + city: "HCMC", + postalCode: "700000", + phoneNumber: "(+84) 937 937 195" +} + +interface AccountPageProps { + defaultActiveContent?: "info" | "orders" | "favorites" +} + +const AccountPage = ({defaultActiveContent="orders"} : AccountPageProps) => { + + const [activeTab] = useState(defaultActiveContent==="info" ? 0 : defaultActiveContent==="orders" ? 1 : 2) + const [modalVisible, setModalVisible] = useState(false); + + function showModal() { + setModalVisible(true); + } + + function closeModal() { + setModalVisible(false); + } + + return ( + <> +
+
+ Account +
+ + + + + + + + + + {/* */} + + +
+ + + ) +} + +export default AccountPage \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/assets/avatar.png b/src/components/modules/account/AccountPage/assets/avatar.png new file mode 100644 index 000000000..b12cabed4 Binary files /dev/null and b/src/components/modules/account/AccountPage/assets/avatar.png differ diff --git a/src/components/modules/account/AccountPage/components/AccountInfomation/AccountInfomation.module.scss b/src/components/modules/account/AccountPage/components/AccountInfomation/AccountInfomation.module.scss new file mode 100644 index 000000000..442dae2eb --- /dev/null +++ b/src/components/modules/account/AccountPage/components/AccountInfomation/AccountInfomation.module.scss @@ -0,0 +1,67 @@ +@import '../../../../../../styles/utilities'; + +.accountInfomation { + @apply flex justify-center items-center; + text-align: center; + margin-top: 1.6rem; + + @screen md { + @apply block; + text-align: left; + margin-top: 0; + } + + .avatar { + height: 22rem; + width: 22rem; + border-radius: 50%; + margin: auto; + margin-bottom: 4rem; + + + @screen md { + margin-left: 0 + } + } + + .accountName { + @apply heading-3 font-heading; + } + + .horizontalSeparator{ + border: 1px solid var(--disabled); + max-width: 39.2rem; + min-width: 30rem; + margin-top: 2.4rem; + margin-bottom: 2.4rem; + } + + .shippingInfo { + @apply heading-3 font-heading; + } + + .accountAddress { + max-width: 31rem; + min-width: none; + } + + .editInfoBtn { + @apply text-center font-bold custom-border-radius; + margin: auto; + margin-top: 2.4rem; + margin-bottom: 2.4rem; + padding: .8rem 1.6rem; + color: #141414; + border: 1px solid #141414; + max-width: 8.8rem; + + &:hover { + @apply cursor-pointer; + background-color: #FBFBFB; + } + + @screen md { + margin-left: 0; + } + } +} \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/components/AccountInfomation/AccountInfomation.tsx b/src/components/modules/account/AccountPage/components/AccountInfomation/AccountInfomation.tsx new file mode 100644 index 000000000..f24b36216 --- /dev/null +++ b/src/components/modules/account/AccountPage/components/AccountInfomation/AccountInfomation.tsx @@ -0,0 +1,56 @@ +import React from "react" +import s from './AccountInfomation.module.scss' + +import Image from "next/image" +import avatar from '../../assets/avatar.png'; + +interface AccountProps { + name: string, email: string, address: string, state: string, city: string, postalCode: string, phoneNumber: string +} + +interface AccountInfomationProps { + account: AccountProps; + onClick: () => void; +} + +const AccountInfomation = ({ account, onClick } : AccountInfomationProps) => { + + // need to handle call back when edit account information + + const showEditForm = () => onClick() + + return ( +
+ { +
+
+ avatar +
+ +
+ {account.name} +
+
+ {account.email} +
+ +
+ +
Shipping Infomation
+ +
+ {account.address + `, ${account.state}, ${account.city}, ${account.postalCode}`} +
+ +
+ {account.phoneNumber} +
+ +
Edit
+
+ } +
+ ) +} + +export default AccountInfomation \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/components/EditInfoModal/EditInfoModal.module.scss b/src/components/modules/account/AccountPage/components/EditInfoModal/EditInfoModal.module.scss new file mode 100644 index 000000000..be1384ab7 --- /dev/null +++ b/src/components/modules/account/AccountPage/components/EditInfoModal/EditInfoModal.module.scss @@ -0,0 +1,81 @@ +@import '../../../../../../styles/utilities'; + +.editInfoModal { + .input { + @apply bg-white; + margin-bottom: 1.6rem; + width: 100%; + border: 2px solid #EBEBEB; + border-radius: .8rem; + padding: 1.6rem; + } + + .inputDisable { + margin-bottom: 1.6rem; + width: 100%; + border: 2px solid #EBEBEB; + border-radius: .8rem; + padding: 1.6rem; + background-color: #EBEBEB; + color: #CCCCCC; + } + + .inputStateWrapper { + @apply bg-white; + margin-bottom: 1.6rem; + margin-right: 1.6rem; + border: 2px solid #EBEBEB; + border-radius: .8rem; + padding: 1.6rem; + + .inputState { + @apply bg-white cursor-pointer; + border: white; + } + } + + .inputPostalCode { + @apply bg-white; + margin-bottom: 1.6rem; + border: 2px solid #EBEBEB; + border-radius: .8rem; + padding: 1.6rem; + } + + .inputPhoneNumber { + @apply bg-white; + margin-bottom: 4rem; + width: 100%; + border: 2px solid #EBEBEB; + border-radius: .8rem; + padding: 1.6rem; + } + + .buttons { + @apply flex; + + .buttonCancel { + @apply bg-white text-center font-bold custom-border-radius-lg; + color: #141414; + border: 1px solid #141414; + padding: 1.6rem; + margin-right: 1.6rem; + width: 100%; + + &:hover { + @apply cursor-pointer; + } + } + + .buttonSave { + @apply text-center font-bold custom-border-radius-lg; + background-color: var(--primary); + color: white; + padding: 1.6rem; + width: 100%; + &:hover { + @apply cursor-pointer; + } + } + } +} \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/components/EditInfoModal/EditInfoModal.tsx b/src/components/modules/account/AccountPage/components/EditInfoModal/EditInfoModal.tsx new file mode 100644 index 000000000..d2be8b1a1 --- /dev/null +++ b/src/components/modules/account/AccountPage/components/EditInfoModal/EditInfoModal.tsx @@ -0,0 +1,83 @@ +import classNames from "classnames" +import React, { useState } from "react" +import s from './EditInfoModal.module.scss' + +import {ModalCommon, MenuDropdown} from '../../../../../common' + +import {ButtonCommon} from '../../../../../common' + +interface EditInfoModalProps { + accountInfo: {name: string, email: string, address: string, state: string, city: string, postalCode: string, phoneNumber: string}; + visible: boolean; + closeModal: () => void; +} + +const EditInfoModal = ({ accountInfo, visible = false, closeModal }: EditInfoModalProps) => { + + const [name, setName] = useState(accountInfo.name); + const [email, setEmail] = useState(accountInfo.email); + const [address, setAddress] = useState(accountInfo.address); + const [state, setState] = useState(accountInfo.state); + const [city, setCity] = useState(accountInfo.city); + const [postalCode, setPostalCode] = useState(accountInfo.postalCode); + const [phoneNumber, setPhoneNumber] = useState(accountInfo.phoneNumber); + + function saveInfo() { + console.log("saved !!!"); + + closeModal(); + } + + const states = [ + {name: "D1", onClick: () => {setState("D1")}}, + {name: "D2", onClick: () => {setState("D2")}}, + {name: "D3", onClick: () => {setState("D3")}} + ] + + return ( + +
+
+ {setName(e.target.value)}} /> +
+
+ {setEmail(e.target.value)}} /> +
+
+ {setAddress(e.target.value)}}/> +
+
+ {setCity(e.target.value)}} /> +
+ +
+
+ + + +
+ + {setPostalCode(e.target.value)}} /> +
+ +
+ {setPhoneNumber(e.target.value)}} /> +
+ +
+
Cancel
+
Save
+
+
+
+ ) +} + +export default EditInfoModal \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/components/OrderInformation/OrderInformation.module.scss b/src/components/modules/account/AccountPage/components/OrderInformation/OrderInformation.module.scss new file mode 100644 index 000000000..0096a67d7 --- /dev/null +++ b/src/components/modules/account/AccountPage/components/OrderInformation/OrderInformation.module.scss @@ -0,0 +1,16 @@ +@import '../../../../../../styles/utilities'; + +.orderInformation { + .title { + @apply heading-3 font-heading; + margin-top: 1.6rem; + } + + .tabs { + margin-top: 3.2rem; + + .blank { + margin-bottom: 2.4rem; + } + } +} \ No newline at end of file diff --git a/src/components/modules/account/AccountPage/components/OrderInformation/OrderInformation.tsx b/src/components/modules/account/AccountPage/components/OrderInformation/OrderInformation.tsx new file mode 100644 index 000000000..76985b9fd --- /dev/null +++ b/src/components/modules/account/AccountPage/components/OrderInformation/OrderInformation.tsx @@ -0,0 +1,66 @@ +import React from "react" +import s from './OrderInformation.module.scss' + +import { TabCommon } from '../../../../../common' +import TabPane from 'src/components/common/TabCommon/components/TabPane/TabPane' +import DeliveryItem from '../../../DeliveryItem/DeliveryItem' + + +interface OrderInformationProps { + waiting: {id: string, products: string[], totalPrice: number}[], + delivering: {id: string, products: string[], totalPrice: number}[], + delivered: {id: string, products: string[], totalPrice: number}[], + // active?: boolean +} + +const OrderInformation = ({ waiting, delivering, delivered} : OrderInformationProps) => { + + return ( +
+ { +
+
Order Information
+ +
+ + +
+ { + waiting.map((order, i) => { + return ( + + ) + }) + } +
+ + +
+ { + delivering.map((order, i) => { + return ( + + ) + }) + } +
+ + +
+ { + delivered.map((order, i) => { + return ( + + ) + }) + } +
+
+
+
+ } +
+ ) +} + +export default OrderInformation \ No newline at end of file diff --git a/src/components/modules/account/DeliveryItem/DeliveryItem.module.scss b/src/components/modules/account/DeliveryItem/DeliveryItem.module.scss new file mode 100644 index 000000000..b83b77fd3 --- /dev/null +++ b/src/components/modules/account/DeliveryItem/DeliveryItem.module.scss @@ -0,0 +1,26 @@ +@import '../../../../styles/utilities'; + +.deliveryItem { + @apply flex bg-white items-center custom-border-radius; + margin-bottom: 1.6rem; + border: 1px solid var(--primary) +} + +.separator { + border-left: 2px dashed #EBEBEB; + max-height: 9.2rem; + min-height: 8.6rem; + + margin-left: .6rem; + margin-right: .6rem; + + @screen md { + margin-left: .8rem; + margin-right: .8rem; + } + + @screen lg { + margin-left: 2.4rem; + margin-right: 2.4rem; + } +} \ No newline at end of file diff --git a/src/components/modules/account/DeliveryItem/DeliveryItem.tsx b/src/components/modules/account/DeliveryItem/DeliveryItem.tsx new file mode 100644 index 000000000..fe8f5cdef --- /dev/null +++ b/src/components/modules/account/DeliveryItem/DeliveryItem.tsx @@ -0,0 +1,30 @@ +import React from "react" +import s from './DeliveryItem.module.scss' + +import IdAndStatus from './components/IdAndStatus/IdAndStatus' +import Products from './components/Products/Products' +import TotalPrice from './components/TotalPrice/TotalPrice' +import ReOrder from './components/ReOrder/ReOrder' + + +interface DeliveryItemProps { + id: string; + status: "waiting" | "delivering" | "delivered"; + products: string[]; + totalPrice: number; + reOrderLink?: string; +} + +const DeliveryItem = ({ id, status, products, totalPrice, reOrderLink } : DeliveryItemProps) => { + return ( +
+ +
+ + + +
+ ) +} + +export default DeliveryItem \ No newline at end of file diff --git a/src/components/modules/account/DeliveryItem/components/IdAndStatus/IdAndStatus.module.scss b/src/components/modules/account/DeliveryItem/components/IdAndStatus/IdAndStatus.module.scss new file mode 100644 index 000000000..d50ecd115 --- /dev/null +++ b/src/components/modules/account/DeliveryItem/components/IdAndStatus/IdAndStatus.module.scss @@ -0,0 +1,75 @@ +@import '../../../../../../styles/utilities'; + +.idAndStatus { + @apply items-center; + padding: 2.4rem 0 2.4rem 1rem; + + @screen md { + padding: 2.4rem 0 2.4rem 1.2rem; + } + + @screen lg { + padding: 2.4rem 0 2.4rem 2.4rem; + } + + .id { + @apply font-bold; + margin-bottom: .8rem; + } + + .deliveryStatus { + @apply font-bold text-white; + font-size: 1.2rem; + line-height: 2rem; + padding: 0 .8rem; + border-radius: 0.5rem; + width: fit-content; + + &.waiting { + background-color: #D9A645; + } + &.delivering { + background-color: var(--info-dark); + } + &.delivered { + background-color: var(--primary); + } + } +}@import '../../../../../../styles/utilities'; + +.idAndStatus { + @apply items-center; + padding: 2.4rem 0 2.4rem 1rem; + + @screen md { + padding: 2.4rem 0 2.4rem 1.2rem; + } + + @screen lg { + padding: 2.4rem 0 2.4rem 2.4rem; + } + + .id { + @apply font-bold; + margin-bottom: .8rem; + } + + .deliveryStatus { + @apply font-bold text-white; + font-size: 1.2rem; + line-height: 2rem; + padding: 0 .8rem; + border-radius: 0.5rem; + width: fit-content; + + &.waiting { + background-color: #D9A645; + } + &.delivering { + background-color: var(--info-dark); + } + &.delivered { + background-color: var(--primary); + } + } +} \ No newline at end of file diff --git a/src/components/modules/account/DeliveryItem/components/IdAndStatus/IdAndStatus.tsx b/src/components/modules/account/DeliveryItem/components/IdAndStatus/IdAndStatus.tsx new file mode 100644 index 000000000..841dd530f --- /dev/null +++ b/src/components/modules/account/DeliveryItem/components/IdAndStatus/IdAndStatus.tsx @@ -0,0 +1,25 @@ +import classNames from "classnames" +import React from "react" +import s from './IdAndStatus.module.scss' + + +interface IdAndStatusProps { + id?: string; + status: "waiting" | "delivering" | "delivered"; +} + +const IdAndStatus = ({ id, status="waiting" } : IdAndStatusProps) => { + return ( +
+
+ {id} +
+
{status} +
+
+ ) +} + +export default IdAndStatus \ No newline at end of file diff --git a/src/components/modules/account/DeliveryItem/components/Products/Products.module.scss b/src/components/modules/account/DeliveryItem/components/Products/Products.module.scss new file mode 100644 index 000000000..f05d6395b --- /dev/null +++ b/src/components/modules/account/DeliveryItem/components/Products/Products.module.scss @@ -0,0 +1,12 @@ +@import '../../../../../../styles/utilities'; + +.products { + margin-top: .8rem; + max-width: 32%; + min-width: none; + + @screen lg { + margin-top: 0; + margin-bottom: 0; + } +} \ No newline at end of file diff --git a/src/components/modules/account/DeliveryItem/components/Products/Products.tsx b/src/components/modules/account/DeliveryItem/components/Products/Products.tsx new file mode 100644 index 000000000..fdbba2c73 --- /dev/null +++ b/src/components/modules/account/DeliveryItem/components/Products/Products.tsx @@ -0,0 +1,29 @@ +import React from "react" +import s from './Products.module.scss' + +interface ProductsProps { + products: string[]; +} + +const Products = ({ products } : ProductsProps) => { + + function toString(products:string[]): string { + let strProducts = ""; + products.map((prod, i) => { + if (i === 0) { + strProducts += prod; + } else { + strProducts += `, ${prod}` + } + }); + return strProducts; + } + + return ( +
+ {toString(products)} +
+ ) +} + +export default Products \ No newline at end of file diff --git a/src/components/modules/account/DeliveryItem/components/ReOrder/ReOrder.module.scss b/src/components/modules/account/DeliveryItem/components/ReOrder/ReOrder.module.scss new file mode 100644 index 000000000..b46b528e1 --- /dev/null +++ b/src/components/modules/account/DeliveryItem/components/ReOrder/ReOrder.module.scss @@ -0,0 +1,27 @@ +@import '../../../../../../styles/utilities'; + +.reOrder { + @apply text-white custom-border-radius hidden font-bold; + padding: .4rem .6rem; + margin-right: 1rem; + background-color: var(--primary); + + @screen md { + padding: .4rem .6rem; + margin-right: 1.2rem; + } + + @screen lg { + padding: .8rem 1.2rem; + margin-right: 2.4rem; + } + + &.show { + @apply block; + } + + &:hover { + @apply cursor-pointer; + } + +} \ No newline at end of file diff --git a/src/components/modules/account/DeliveryItem/components/ReOrder/ReOrder.tsx b/src/components/modules/account/DeliveryItem/components/ReOrder/ReOrder.tsx new file mode 100644 index 000000000..2fbc546f4 --- /dev/null +++ b/src/components/modules/account/DeliveryItem/components/ReOrder/ReOrder.tsx @@ -0,0 +1,23 @@ +import classNames from "classnames" +import React from "react" +import s from './ReOrder.module.scss' +import Link from 'next/link' + +interface ReOrderProps { + show: boolean; + href?: string; +} + +const ReOrder = ({ show=false, href="#" } : ReOrderProps) => { + return ( +
+ + Re-Order + +
+ ) +} + +export default ReOrder \ No newline at end of file diff --git a/src/components/modules/account/DeliveryItem/components/TotalPrice/TotalPrice.module.scss b/src/components/modules/account/DeliveryItem/components/TotalPrice/TotalPrice.module.scss new file mode 100644 index 000000000..9a4f795b3 --- /dev/null +++ b/src/components/modules/account/DeliveryItem/components/TotalPrice/TotalPrice.module.scss @@ -0,0 +1,26 @@ +@import '../../../../../../styles/utilities'; + +.totalPrice { + margin-left: auto; + margin-right: 1rem; + + @screen md { + margin-right: 1.2rem; + } + + @screen lg { + margin-right: 2.4rem; + } + + .price { + @apply font-bold ; + + @screen md { + @apply topline + } + + @screen lg { + @apply sub-headline; + } + } +} \ No newline at end of file diff --git a/src/components/modules/account/DeliveryItem/components/TotalPrice/TotalPrice.tsx b/src/components/modules/account/DeliveryItem/components/TotalPrice/TotalPrice.tsx new file mode 100644 index 000000000..153149e85 --- /dev/null +++ b/src/components/modules/account/DeliveryItem/components/TotalPrice/TotalPrice.tsx @@ -0,0 +1,18 @@ +import React from "react" +import s from './TotalPrice.module.scss' + + +interface TotalPriceProps { + totalPrice: number; +} + +const TotalPrice = ({ totalPrice } : TotalPriceProps) => { + return ( +
+
Total
+
Rp {totalPrice}
+
+ ) +} + +export default TotalPrice \ No newline at end of file diff --git a/src/components/modules/account/index.ts b/src/components/modules/account/index.ts new file mode 100644 index 000000000..42753b0b5 --- /dev/null +++ b/src/components/modules/account/index.ts @@ -0,0 +1,3 @@ +export { default as AccountNavigation } from './AccountNavigation/AccountNavigation' +export { default as DeliveryItem } from './DeliveryItem/DeliveryItem' +export { default as AccountPage } from './AccountPage/AccountPage' \ No newline at end of file diff --git a/src/components/modules/blogs/BlogBreadcrumb/BlogBreadCrumb.module.scss b/src/components/modules/blogs/BlogBreadcrumb/BlogBreadCrumb.module.scss new file mode 100644 index 000000000..d347ad872 --- /dev/null +++ b/src/components/modules/blogs/BlogBreadcrumb/BlogBreadCrumb.module.scss @@ -0,0 +1,7 @@ +@import "../../../../styles/utilities"; +.breadCrumbWrapper { + @apply py-12 spacing-horizontal; + @screen lg { + padding-left: 3.2rem; + } +} \ No newline at end of file diff --git a/src/components/modules/blogs/BlogBreadcrumb/BlogBreadcrumb.tsx b/src/components/modules/blogs/BlogBreadcrumb/BlogBreadcrumb.tsx new file mode 100644 index 000000000..bb2ea19ef --- /dev/null +++ b/src/components/modules/blogs/BlogBreadcrumb/BlogBreadcrumb.tsx @@ -0,0 +1,16 @@ +import { BreadcrumbCommon } from "src/components/common" +import s from './BlogBreadCrumb.module.scss' + +const BLOG_DATA = [ + {link: "/blogs", name: "Blog"}, +]; + +const BlogBreadCrumb = () => { + return ( +
+ +
+ ) +} + +export default BlogBreadCrumb \ No newline at end of file diff --git a/src/components/modules/blogs/BlogHeading/BlogHeading.module.scss b/src/components/modules/blogs/BlogHeading/BlogHeading.module.scss new file mode 100644 index 000000000..d562ce2ae --- /dev/null +++ b/src/components/modules/blogs/BlogHeading/BlogHeading.module.scss @@ -0,0 +1,9 @@ +@import "../../../../styles/utilities"; + +.headingWrapper { + @apply flex spacing-horizontal-left pb-16 justify-center; + .heading{ + max-width: 121.6rem; + flex-grow: 1; + } +} \ No newline at end of file diff --git a/src/components/modules/blogs/BlogHeading/BlogHeading.tsx b/src/components/modules/blogs/BlogHeading/BlogHeading.tsx new file mode 100644 index 000000000..e3f60c980 --- /dev/null +++ b/src/components/modules/blogs/BlogHeading/BlogHeading.tsx @@ -0,0 +1,18 @@ +import { HeadingCommon } from "src/components/common" +import s from './BlogHeading.module.scss' + +interface BlogHeadingProps { + children?: React.ReactNode, + heading?: string, +} + +const BlogHeading = ({heading = "BLOG"}: BlogHeadingProps) => { + return ( +
+
+ {heading} +
+
+ ) +} +export default BlogHeading \ No newline at end of file diff --git a/src/components/modules/blogs/BlogsList/BlogsList.module.scss b/src/components/modules/blogs/BlogsList/BlogsList.module.scss new file mode 100644 index 000000000..295cabc5a --- /dev/null +++ b/src/components/modules/blogs/BlogsList/BlogsList.module.scss @@ -0,0 +1,23 @@ +@import "../../../../styles/utilities"; + +.wrapper { + @apply flex flex-col spacing-horizontal items-center; + padding-bottom: 16.8rem; + .list { + @apply grid grid-cols-1 gap-8; + max-width: 121.6rem; + @screen md { + @apply grid-cols-2; + } + @screen lg { + @apply grid-cols-3; + } + } + .card { + @apply pb-16; + } + .pagination { + @apply flex justify-center items-center ; + padding-top: 0.8rem; + } +} \ No newline at end of file diff --git a/src/components/modules/blogs/BlogsList/BlogsList.tsx b/src/components/modules/blogs/BlogsList/BlogsList.tsx new file mode 100644 index 000000000..536aa4afd --- /dev/null +++ b/src/components/modules/blogs/BlogsList/BlogsList.tsx @@ -0,0 +1,157 @@ +import React, { useState } from 'react' +import CardBlog, { BlogCardProps } from 'src/components/common/CardBlog/CardBlog' +import PaginationCommon from 'src/components/common/PaginationCommon/PaginationCommon' +import s from "./BlogsList.module.scss" +import { DEFAULT_BLOG_PAGE_SIZE } from 'src/utils/constanst.utils' +import image15 from '../../../../../public/assets/images/image15.png' +import image16 from '../../../../../public/assets/images/image16.png' +import image17 from '../../../../../public/assets/images/image17.png' +import image21 from '../../../../../public/assets/images/image21.png' +import image22 from '../../../../../public/assets/images/image22.png' +import image23 from '../../../../../public/assets/images/image23.png' + +interface BlogsListProps { + data?: BlogCardProps[], +} + +const BLOGSLIST_DATA = [ + { + imageSrc: image15.src, + title: "1", + description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...", + slug: "happy-diet" + }, + { + imageSrc: image16.src, + title: "2", + description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...", + slug: "happy-diet" + }, + { + imageSrc: image17.src, + title: "3", + description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...", + slug: "happy-diet" + }, + { + imageSrc: image21.src, + title: "4", + description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...", + slug: "happy-diet" + }, + { + imageSrc: image22.src, + title: "5", + description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...", + slug: "happy-diet" + }, + { + imageSrc: image23.src, + title: "6", + description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...", + slug: "happy-diet" + }, + { + imageSrc: image15.src, + title: "7", + description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...", + slug: "happy-diet" + }, + { + imageSrc: image16.src, + title: "8", + description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...", + slug: "happy-diet" + }, + { + imageSrc: image17.src, + title: "9", + description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...", + slug: "happy-diet" + }, + { + imageSrc: image23.src, + title: "10", + description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...", + slug: "happy-diet" + }, + { + imageSrc: image21.src, + title: "11", + description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...", + slug: "happy-diet" + }, + { + imageSrc: image22.src, + title: "12", + description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...", + slug: "happy-diet" + }, + { + imageSrc: image15.src, + title: "13", + description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...", + slug: "happy-diet" + }, + { + imageSrc: image16.src, + title: "14", + description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...", + slug: "happy-diet" + }, + { + imageSrc: image17.src, + title: "15", + description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...", + slug: "happy-diet" + }, + { + imageSrc: image21.src, + title: "16", + description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...", + slug: "happy-diet" + }, + { + imageSrc: image23.src, + title: "17", + description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...", + slug: "happy-diet" + }, + { + imageSrc: image22.src, + title: "18", + description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...", + slug: "happy-diet" + }, + + ] + +const BlogsList = ({ data = BLOGSLIST_DATA }:BlogsListProps) => { + const [currentPage, setCurrentPage] = useState(0) + const onPageChange = (page:number) => { + setCurrentPage(page) + } + + return ( +
+
+
+ { + data.slice(currentPage*DEFAULT_BLOG_PAGE_SIZE,(currentPage+1)*DEFAULT_BLOG_PAGE_SIZE).map((product,index)=> { + return( +
+ +
+ ) + }) + } +
+
+ +
+
+
+ ) +} + +export default BlogsList \ No newline at end of file diff --git a/src/components/modules/blogs/FeaturedCardBlog/FeaturedCardBlog.module.scss b/src/components/modules/blogs/FeaturedCardBlog/FeaturedCardBlog.module.scss new file mode 100644 index 000000000..6fb16450c --- /dev/null +++ b/src/components/modules/blogs/FeaturedCardBlog/FeaturedCardBlog.module.scss @@ -0,0 +1,34 @@ +@import "../../../../styles/utilities"; + +.featuredCard { + @apply flex flex-row justify-center spacing-horizontal pb-16; + .featuredCardWrapper { + @apply flex flex-col; + @screen lg { + @apply flex-row justify-between; + } + max-width: 121.6rem; + } +} +.left { + max-width: 59.8rem; + img { + border-radius: 2.4rem; + } +} +.right { + flex-shrink: 3; + @screen lg { + margin-left: 6.4rem; + } +} +.titleWrapper { + @apply flex flex-col items-start font-heading heading-3; + margin-bottom: 1.6rem; + .title { + margin-top: 0.4rem; + } +} +.content { + margin-top: 1.6rem +} \ No newline at end of file diff --git a/src/components/modules/blogs/FeaturedCardBlog/FeaturedCardBlog.tsx b/src/components/modules/blogs/FeaturedCardBlog/FeaturedCardBlog.tsx new file mode 100644 index 000000000..2bd158d79 --- /dev/null +++ b/src/components/modules/blogs/FeaturedCardBlog/FeaturedCardBlog.tsx @@ -0,0 +1,52 @@ +import s from './FeaturedCardBlog.module.scss' +import { Author, DateTime } from 'src/components/common' +import Image from "next/image"; +import image20 from '../../../../../public/assets/images/image20.png' +import author from '../../../../../public/assets/images/author.png' + +interface FeaturedCardBlogProps{ + title?: string, + content?: string, + imgSrc?: any, + imgAuthor?: any, + date?: string, + authorName?: string, +} + +const FEATURED_DATA = { + title: "Flammekueche with green asparagus", + content: "Traditionally, the Flammekueche is made with rapeseed oil, which, contrary to popular belief, is indeed an oil that can be cooked hot and is not limited to seasoning. It is important to vary the oils in the kitchen to take advantage of the benefits of each. Rapeseed oil is an oil rich in omega 3 which participate in the proper functioning of the cardiovascular system as well as in vitamins E which contributes to the protection of cells against oxidative stress. In short, oils are your friends 😉", + imgSrc: image20, + imgAuthor: author.src, + date: "APRIL 30, 2021", + author: "Alessandro Del Piero" +} + +const FeaturedCardBlog = ({ + title = FEATURED_DATA.title, + content = FEATURED_DATA.content, + imgSrc = FEATURED_DATA.imgSrc, + imgAuthor = FEATURED_DATA.imgAuthor, + date = FEATURED_DATA.date, + authorName = FEATURED_DATA.author +}: FeaturedCardBlogProps) => { + return ( +
+
+
+ image feature card +
+
+
+ + {title} +
+ +
{content}
+
+
+
+ ) +} + +export default FeaturedCardBlog \ No newline at end of file diff --git a/src/components/modules/blogs/index.tsx b/src/components/modules/blogs/index.tsx new file mode 100644 index 000000000..0f8e1b281 --- /dev/null +++ b/src/components/modules/blogs/index.tsx @@ -0,0 +1,4 @@ +export { default as FeaturedCardBlog } from './FeaturedCardBlog/FeaturedCardBlog' +export { default as BlogsList } from './BlogsList/BlogsList' +export { default as BlogHeading } from './BlogHeading/BlogHeading' +export { default as BlogBreadCrumb } from './BlogBreadcrumb/BlogBreadcrumb' \ 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..abf7ef84f --- /dev/null +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.module.scss @@ -0,0 +1,8 @@ +@import "../../../../styles/utilities"; + +.breadCrumb { + @apply absolute z-10 pt-12 spacing-horizontal; + @screen lg{ + padding-left: 3.2rem; + } +} \ 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..992370ce5 --- /dev/null +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb.tsx @@ -0,0 +1,17 @@ +import { BreadcrumbCommon } from 'src/components/common' +import s from './DeliveryAndPolicyBreadCrumb.module.scss' + +const CRUMB_DATA = [ + { + link: "/delivery-policy", + name: "Delivery And Policy" + } +] +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 new file mode 100644 index 000000000..be88621b5 --- /dev/null +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.module.scss @@ -0,0 +1,26 @@ +@import "../../../../styles/utilities"; + +.wrapper { + @apply flex justify-center pt-20 pb-28 spacing-horizontal; + .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; + } + } + } + .content { + @apply pb-16 whitespace-pre-line; + padding-top: 1.6rem; + } + } +} diff --git a/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx new file mode 100644 index 000000000..6045288f6 --- /dev/null +++ b/src/components/modules/delivery-policy/DeliveryAndPolicyContent/DeliveryAndPolicyContent.tsx @@ -0,0 +1,81 @@ +import { CollapseCommon, DateTime, HeadingCommon } from 'src/components/common' +import s from './DeliveryAndPolicyContent.module.scss' + +interface DeliveryAndPolicyContentProps{ + title?: string, + date?: string, + 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 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.`, + }, + { + 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.`, + }, + { + 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.`, + }, + { + 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.`, + }, + { + 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.`, + }, +] + +const DeliveryAndPolicyContent = ( { title="Delivery & Policy", date="APRIL 30, 2021", content = HEADER_CONTENT } : DeliveryAndPolicyContentProps) => { + return ( +
+ +
+
+
+
LASTEST UPDATED: 
+ +
+ {title} +
+
+ {content} +
+ +
+ +
+ ) +} + +export default DeliveryAndPolicyContent \ No newline at end of file diff --git a/src/components/modules/delivery-policy/index.tsx b/src/components/modules/delivery-policy/index.tsx new file mode 100644 index 000000000..bb23bd6c8 --- /dev/null +++ b/src/components/modules/delivery-policy/index.tsx @@ -0,0 +1,2 @@ +export { default as DeliveryAndPolicyContent } from './DeliveryAndPolicyContent/DeliveryAndPolicyContent' +export { default as DeliveryAndPolicyBreadCrumb } from './DeliveryAndPolicyBreadCrumb/DeliveryAndPolicyBreadCrumb' \ No newline at end of file diff --git a/src/utils/constanst.utils.ts b/src/utils/constanst.utils.ts index 95493aadb..3757feb1e 100644 --- a/src/utils/constanst.utils.ts +++ b/src/utils/constanst.utils.ts @@ -116,3 +116,4 @@ export const FEATURED = [ }, ] +export const DEFAULT_BLOG_PAGE_SIZE=6; diff --git a/tsconfig.json b/tsconfig.json index 6a08e59f8..316d817b7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,6 @@ "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, - "isolatedModules": true, "jsx": "preserve", "incremental": true, "noUnusedLocals": true, @@ -26,7 +25,8 @@ "@commerce/*": ["framework/commerce/*"], "@framework": ["framework/vendure"], "@framework/*": ["framework/vendure/*"] - } + }, + "isolatedModules": true }, "include": ["next-env.d.ts", "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"], "exclude": [