diff --git a/grocery-vercel-commerce b/grocery-vercel-commerce new file mode 160000 index 000000000..3c7aa8e86 --- /dev/null +++ b/grocery-vercel-commerce @@ -0,0 +1 @@ +Subproject commit 3c7aa8e862bfd8d44719be44c6c0a31ab01524a3 diff --git a/pages/index.tsx b/pages/index.tsx index 1f438f12f..702aee564 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,6 +1,16 @@ import { CarouselCommon, LabelCommon, Layout, QuanittyInput,CheckboxCommon ,Author,DateTime} from 'src/components/common' +import { HomeCategories } from 'src/components/modules/home'; import imgAuthor from '../src/components/common/Author/img/author.png'; + +import veggle from '../src/components/modules/home/homeCategories/img/veggle.png'; +import seafood from '../src/components/modules/home/homeCategories/img/seafood.png'; +import frozen from '../src/components/modules/home/homeCategories/img/frozen.png'; +import coffeebean from '../src/components/modules/home/homeCategories/img/coffeebean.png'; +import sauce from '../src/components/modules/home/homeCategories/img/sauce.png'; + + + const dataTest = [{ text: 1 }, { @@ -15,12 +25,44 @@ const dataTest = [{ text: 6 }] const test = (props: { text: string }) =>
{props.text}
+const categories = [ + { + id:1, + image:veggle, + name:"Veggie", + link:"veggie.html" + }, { + id:2, + image:seafood, + name:"Seafood", + link:"seafood.html" + } + , { + id:3, + image:frozen, + name:"Frozen", + link:"frozen.html" + } + , { + id:4, + image:coffeebean, + name:"Coffe Bean", + link:"frozen.html" + } + , { + id:5, + image:sauce, + name:"Sauce", + link:"frozen.html" + } +] export default function Home() { return ( <> - + {/* - + */} + ) } diff --git a/src/components/common/HeadingCommon/HeadingCommon.module.scss b/src/components/common/HeadingCommon/HeadingCommon.module.scss new file mode 100644 index 000000000..c2329d2fd --- /dev/null +++ b/src/components/common/HeadingCommon/HeadingCommon.module.scss @@ -0,0 +1,23 @@ +@import '../../../styles/utilities'; + +.headingCommon { + @apply font-heading uppercase text-left spacing-horizontal-left; + font-size: 3.2rem; + line-height: 4rem; + + &.highlight { + color: var(--negative); + } + &.light { + color: var(--disabled); + } + &.center { + @apply text-center; + } + + @screen md { + @apply spacing-horizontal; + font-size: 4.8rem; + line-height: 5.6rem; + } +} diff --git a/src/components/common/HeadingCommon/HeadingCommon.tsx b/src/components/common/HeadingCommon/HeadingCommon.tsx new file mode 100644 index 000000000..cd6946f25 --- /dev/null +++ b/src/components/common/HeadingCommon/HeadingCommon.tsx @@ -0,0 +1,23 @@ +import React from 'react' +import classNames from 'classnames' +import s from './HeadingCommon.module.scss' + +interface HeadingCommonProps { + type?: 'highlight' | 'light' | 'default'; + align?: 'center' | 'left'; + children: string; +} + +const HeadingCommon = ({ type='default', align='left', children }: HeadingCommonProps) => { + + return ( +
{children}
+ ) + +} + +export default HeadingCommon diff --git a/src/components/modules/home/HomeCategories/CategoriesItem/CategoryItem.module.scss b/src/components/modules/home/HomeCategories/CategoriesItem/CategoryItem.module.scss new file mode 100644 index 000000000..a769202ab --- /dev/null +++ b/src/components/modules/home/HomeCategories/CategoriesItem/CategoryItem.module.scss @@ -0,0 +1,80 @@ +@import '../../../../../styles/_utilities'; + +.categoryItem{ + + @screen md{ + font-size:1.6rem; + } + .categoryItemImage{ + width: 10.6rem; + margin: 0 auto; + max-height: 14rem; + object-fit: cover; + cursor: pointer; + @screen md{ + width: 100%; + } + img{ + width:100%; + height: 100%; + } + } + .categoryItemText{ + + font-size: 1.6rem; + line-height: 2.4rem; + text-align: center; + color: #000000; + font-feature-settings: 'salt' on; + cursor: pointer; + @screen md{ + font-family: var(--font-sans); + font-size:2.4rem; + line-height: 3.2rem; + } + } + // @screen md { + // width:33%; + + // } +} + + + +// @import '../../../../styles/utilities'; +// .homeFeature { +// @apply spacing-horizontal-left; +// vertical-align: middle; +// @screen md { +// @apply spacing-horizontal grid grid-cols-3; + +// } +// } +// .homeFeatureItem { +// @apply inline-block; + +// .itemImg { +// @apply float-left clear-both; +// width: 5.6rem; +// height: 5.6rem; +// @screen md { +// @apply float-left clear-both; +// width: 11.2rem; +// height: 11.2rem; +// vertical-align: middle; +// } +// } +// .itemText { +// @apply collection-subtitle; +// width: 28rem; +// height: 9.6rem; +// margin-left: 2.4rem; +// @screen md { +// @apply collection-subtitle text-justify; +// width: 28rem; +// height: 9.6rem; +// margin-left: 2.4rem; +// color: red; +// } +// } +// } \ No newline at end of file diff --git a/src/components/modules/home/HomeCategories/CategoriesItem/CategoryItem.tsx b/src/components/modules/home/HomeCategories/CategoriesItem/CategoryItem.tsx new file mode 100644 index 000000000..dbedf8ef4 --- /dev/null +++ b/src/components/modules/home/HomeCategories/CategoriesItem/CategoryItem.tsx @@ -0,0 +1,29 @@ +import React from 'react'; + +import s from './CategoryItem.module.scss' +import classNames from 'classnames'; +import Image from "next/image"; +import Link from 'next/link'; + +interface CategoryItem { + image: string, + name: string, + link: string +} + +const CategoryItem = ({image,name,link}:CategoryItem) => { + return ( +
+
+ + + +
+ +
{name}
+ +
+ ) +} + +export default CategoryItem diff --git a/src/components/modules/home/HomeCategories/HomeCategories.module.scss b/src/components/modules/home/HomeCategories/HomeCategories.module.scss new file mode 100644 index 000000000..8fb8149f8 --- /dev/null +++ b/src/components/modules/home/HomeCategories/HomeCategories.module.scss @@ -0,0 +1,41 @@ +@import '../../../../styles/_utilities'; +.homeCategoriesWrapper{ + @apply flex flex-col items-center justify-center ; + width: 100%; + background-color:white; + + @screen md{ + background-color:var(--background); + height: 36.531rem; + } + + .homeCategoriesHeading{ + width: 100%; + font-weight: bold; + line-height: 0.64rem; + @screen md{ + width:auto; + } + .headingCommon{ + font-size: 3.2rem; + } + } + + + .homeCategoryList { + @apply spacing-horizontal flex justify-start items-center flex-wrap ; + margin: 1rem 0; + @screen md{ + @apply flex-nowrap ; + } + .homeCategoriesItem{ + width: calc(100% / 3); + @screen md{ + margin-top:2rem; + width:100%; + } + } + } + + +} diff --git a/src/components/modules/home/HomeCategories/HomeCategories.tsx b/src/components/modules/home/HomeCategories/HomeCategories.tsx new file mode 100644 index 000000000..3393b6916 --- /dev/null +++ b/src/components/modules/home/HomeCategories/HomeCategories.tsx @@ -0,0 +1,32 @@ +import React from 'react'; + +import s from './HomeCategories.module.scss' +import classNames from 'classnames'; +import CategoryItem from './CategoriesItem/CategoryItem'; +import HeadingCommon from "../../../common/HeadingCommon/HeadingCommon"; + +interface HomeCategories { + categories: any[] +} + +const HomeCategories = ({categories}:HomeCategories) => { + return ( + +
+
+ +
+ +
+ {categories?.map((props,index)=>( +
+ +
+ ))} +
+
+ + ) +} + +export default HomeCategories diff --git a/src/components/modules/home/HomeCategories/img/coffeebean.png b/src/components/modules/home/HomeCategories/img/coffeebean.png new file mode 100644 index 000000000..a84f9f5e0 Binary files /dev/null and b/src/components/modules/home/HomeCategories/img/coffeebean.png differ diff --git a/src/components/modules/home/HomeCategories/img/frozen.png b/src/components/modules/home/HomeCategories/img/frozen.png new file mode 100644 index 000000000..d7f45f173 Binary files /dev/null and b/src/components/modules/home/HomeCategories/img/frozen.png differ diff --git a/src/components/modules/home/HomeCategories/img/sauce.png b/src/components/modules/home/HomeCategories/img/sauce.png new file mode 100644 index 000000000..cd3c270b4 Binary files /dev/null and b/src/components/modules/home/HomeCategories/img/sauce.png differ diff --git a/src/components/modules/home/HomeCategories/img/seafood.png b/src/components/modules/home/HomeCategories/img/seafood.png new file mode 100644 index 000000000..f5f72e17b Binary files /dev/null and b/src/components/modules/home/HomeCategories/img/seafood.png differ diff --git a/src/components/modules/home/HomeCategories/img/veggle.png b/src/components/modules/home/HomeCategories/img/veggle.png new file mode 100644 index 000000000..ea1a55620 Binary files /dev/null and b/src/components/modules/home/HomeCategories/img/veggle.png differ diff --git a/src/components/modules/home/index.ts b/src/components/modules/home/index.ts index a83854f9f..3bdb7b1dd 100644 --- a/src/components/modules/home/index.ts +++ b/src/components/modules/home/index.ts @@ -1 +1,2 @@ export { default as HomeBanner } from './HomeBanner/HomeBanner' +export { default as HomeCategories } from './HomeCategories/HomeCategories' \ No newline at end of file