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/pages/test.tsx b/pages/test.tsx index 0ec1c8136..a16ef6ed1 100644 --- a/pages/test.tsx +++ b/pages/test.tsx @@ -6,6 +6,7 @@ import MenuNavigationProductList from 'src/components/common/MenuNavigationProdu // import { RecipeListPage } from 'src/components/modules/recipes'; import { OPTION_ALL, QUERY_KEY, ROUTE } from 'src/utils/constanst.utils'; import { useModalCommon } from 'src/components/hooks'; + const CATEGORY = [ { name: 'All', @@ -33,7 +34,6 @@ const CATEGORY = [ }, ] const BRAND = [ - { name: 'Maggi', link: `${ROUTE.PRODUCTS}/?${QUERY_KEY.BRAND}=veggie`, @@ -67,15 +67,14 @@ const FEATURED = [ link: `${ROUTE.PRODUCTS}/?${QUERY_KEY.BRAND}=viewed`, } ]; + + +import CheckoutSuccess from 'src/components/modules/checkout/CheckoutSuccess/CheckoutSuccess' +import LoadingCommon from 'src/components/common/LoadingCommon/LoadingCommon' +import SkeletonParagraph from 'src/components/common/SkeletonCommon/SkeletonParagraph/SkeletonParagraph' +import SkeletonImage from 'src/components/common/SkeletonCommon/SkeletonImage/SkeletonImage' + export default function Test() { - const { visible: visibleMenuFilter, openModal, closeModal: closeMenuFilter } = useModalCommon({ initialValue: false }) - const toggle = () => { - if (visibleMenuFilter) { - closeMenuFilter() - } else { - openModal() - } -} return ( <>
diff --git a/src/components/common/LoadingCommon/LoadingCommon.module.scss b/src/components/common/LoadingCommon/LoadingCommon.module.scss new file mode 100644 index 000000000..f17d4aa9c --- /dev/null +++ b/src/components/common/LoadingCommon/LoadingCommon.module.scss @@ -0,0 +1,24 @@ +@import '../../../styles/utilities'; + +.wrapper { + @apply text-center; + + .loadingCommon { + @apply bg-white; + height: 7rem; + width: 7rem; + animation: spin 2s linear infinite; + margin: auto; + background: url('./assets/carrot.png') top 50% left 50% no-repeat; + } + + .text { + @apply font-bold; + color: var(--primary); + } +} + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} \ No newline at end of file diff --git a/src/components/common/LoadingCommon/LoadingCommon.tsx b/src/components/common/LoadingCommon/LoadingCommon.tsx new file mode 100644 index 000000000..1e8ffe340 --- /dev/null +++ b/src/components/common/LoadingCommon/LoadingCommon.tsx @@ -0,0 +1,15 @@ +import React from "react"; +import s from './LoadingCommon.module.scss' + +const LoadingCommon = () => { + + return ( +
+
+
+

Loading...

+
+ ) +} + +export default LoadingCommon \ No newline at end of file diff --git a/src/components/common/LoadingCommon/assets/carrot.png b/src/components/common/LoadingCommon/assets/carrot.png new file mode 100644 index 000000000..60a89d625 Binary files /dev/null and b/src/components/common/LoadingCommon/assets/carrot.png differ diff --git a/src/components/common/SkeletonCommon/SkeletonImage/SkeletonImage.module.scss b/src/components/common/SkeletonCommon/SkeletonImage/SkeletonImage.module.scss new file mode 100644 index 000000000..d9607adec --- /dev/null +++ b/src/components/common/SkeletonCommon/SkeletonImage/SkeletonImage.module.scss @@ -0,0 +1,53 @@ +@import '../../../../styles/utilities'; + +.skeletonImage { + @apply relative; + background: #DDDBDD; + + &.small { + width: 10rem; + height: 10rem; + } + + &.default { + width: 15rem; + height: 15rem; + } + + &.large { + width: 20rem; + height: 20rem; + } + + &.left { + margin-left: 0; + } + + &.center { + margin: auto; + } + + &::after { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + transform: translateX(-100%); + background-image: linear-gradient( + 90deg, + rgba(#fff, 0) 0, + rgba(#fff, 0.2) 20%, + rgba(#fff, 0.5) 60%, + rgba(#fff, 0) + ); + animation: shimmer 2s infinite; + content: ''; + } +} + +@keyframes shimmer { + 100% { + transform: translateX(100%); + } +} diff --git a/src/components/common/SkeletonCommon/SkeletonImage/SkeletonImage.tsx b/src/components/common/SkeletonCommon/SkeletonImage/SkeletonImage.tsx new file mode 100644 index 000000000..e2c7c5e0f --- /dev/null +++ b/src/components/common/SkeletonCommon/SkeletonImage/SkeletonImage.tsx @@ -0,0 +1,20 @@ +import classNames from "classnames"; +import React from "react"; +import s from './SkeletonImage.module.scss' + +interface SkeletonImageProps { + align?: "left" | "center" + size?: "small" | "default" | "large" +} + +const SkeletonImage = ({ align="center", size="default" }: SkeletonImageProps) => { + return ( +
+
+ ) +} + +export default SkeletonImage \ No newline at end of file diff --git a/src/components/common/SkeletonCommon/SkeletonParagraph/SkeletonParagraph.module.scss b/src/components/common/SkeletonCommon/SkeletonParagraph/SkeletonParagraph.module.scss new file mode 100644 index 000000000..1ebd6e413 --- /dev/null +++ b/src/components/common/SkeletonCommon/SkeletonParagraph/SkeletonParagraph.module.scss @@ -0,0 +1,65 @@ +@import '../../../../styles/utilities'; + +.skeletonParagraph { + margin: 0 1.6rem; + + .row { + display: inline-block; + height: 2rem; + width: 100%; + position: relative; + overflow: hidden; + background-color: #DDDBDD; + + &::after { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + transform: translateX(-100%); + background-image: linear-gradient( + 90deg, + rgba(#fff, 0) 0, + rgba(#fff, 0.2) 20%, + rgba(#fff, 0.5) 60%, + rgba(#fff, 0) + ); + animation: shimmer 2s infinite; + content: ''; + } + } + + .lastRow { + display: inline-block; + height: 2rem; + width: 80%; + position: relative; + overflow: hidden; + background-color: #DDDBDD; + + &::after { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + transform: translateX(-100%); + background-image: linear-gradient( + 90deg, + rgba(#fff, 0) 0, + rgba(#fff, 0.2) 20%, + rgba(#fff, 0.5) 60%, + rgba(#fff, 0) + ); + animation: shimmer 2s infinite; + content: ''; + } + } +} + +@keyframes shimmer { + 100% { + transform: translateX(100%); + } +} diff --git a/src/components/common/SkeletonCommon/SkeletonParagraph/SkeletonParagraph.tsx b/src/components/common/SkeletonCommon/SkeletonParagraph/SkeletonParagraph.tsx new file mode 100644 index 000000000..eadcff724 --- /dev/null +++ b/src/components/common/SkeletonCommon/SkeletonParagraph/SkeletonParagraph.tsx @@ -0,0 +1,23 @@ +import React from "react"; +import s from './SkeletonParagraph.module.scss' + +interface SkeletonParagraphProps { + rows?: number // number of rows in paragraph +} + +const SkeletonParagraph = ({ rows=2 }: SkeletonParagraphProps) => { + return ( +
+ { + [...Array(rows)].map((e, i) => { + if (i === rows-1) { + return
+ } + return
+ }) + } +
+ ) +} + +export default SkeletonParagraph \ No newline at end of file diff --git a/src/components/modules/checkout/CheckoutSuccess/CheckoutSuccess.module.scss b/src/components/modules/checkout/CheckoutSuccess/CheckoutSuccess.module.scss new file mode 100644 index 000000000..c7d4b2859 --- /dev/null +++ b/src/components/modules/checkout/CheckoutSuccess/CheckoutSuccess.module.scss @@ -0,0 +1,38 @@ +@import '../../../../styles/utilities'; + +.checkoutSuccessWrapper { + @apply flex items-center justify-center; + margin-top: -3.2rem; + + .checkoutSuccess { + border-radius: 80% 90% 18% 10% / 20% 10% 27% 20%; + max-width: 77.6rem; + height: fit-content; + background: + url('./assets/veget.png') left 0 top 0 no-repeat, + url('./assets/fish.png') right 0 top 0 no-repeat, + url('./assets/freezeShrimp.png') right 0 bottom 0 no-repeat, + url('./assets/coffeeBean.png') left 0 bottom 0 no-repeat; + background-color: #E3F2E9; + + .checkoutContent { + @apply text-center; + margin: 7.2rem 4.8rem 6.4rem 4.8rem; + + .checkoutMsg { + @apply heading-1 font-heading; + margin-top: 3.2rem; + margin-bottom: 1.6rem; + } + + .checkoutSubMsg { + @apply sub-headline; + margin-bottom: 4rem; + } + + .backToHomeBtn { + @apply flex justify-center; + } + } + } +} \ No newline at end of file diff --git a/src/components/modules/checkout/CheckoutSuccess/CheckoutSuccess.tsx b/src/components/modules/checkout/CheckoutSuccess/CheckoutSuccess.tsx new file mode 100644 index 000000000..277cd5e30 --- /dev/null +++ b/src/components/modules/checkout/CheckoutSuccess/CheckoutSuccess.tsx @@ -0,0 +1,34 @@ +import React from "react"; +import s from './CheckoutSuccess.module.scss'; + +import Link from "next/link"; + +import checkIcon from './assets/checkIcon.png'; + +import { ButtonCommon, StaticImage } from "src/components/common"; +import { IconArrowRight } from "src/components/icons"; + +const CheckoutSuccess = () => { + return ( +
+
+
+ + +
Your purchase has been successed!
+
Last call! Shop deep deals on 100+ bulk picks while you can.
+ + +
+
+
+ ) +} + +export default CheckoutSuccess \ No newline at end of file diff --git a/src/components/modules/checkout/CheckoutSuccess/assets/checkIcon.png b/src/components/modules/checkout/CheckoutSuccess/assets/checkIcon.png new file mode 100644 index 000000000..9d97234fb Binary files /dev/null and b/src/components/modules/checkout/CheckoutSuccess/assets/checkIcon.png differ diff --git a/src/components/modules/checkout/CheckoutSuccess/assets/coffeeBean.png b/src/components/modules/checkout/CheckoutSuccess/assets/coffeeBean.png new file mode 100644 index 000000000..742f30b68 Binary files /dev/null and b/src/components/modules/checkout/CheckoutSuccess/assets/coffeeBean.png differ diff --git a/src/components/modules/checkout/CheckoutSuccess/assets/fish.png b/src/components/modules/checkout/CheckoutSuccess/assets/fish.png new file mode 100644 index 000000000..14f676f64 Binary files /dev/null and b/src/components/modules/checkout/CheckoutSuccess/assets/fish.png differ diff --git a/src/components/modules/checkout/CheckoutSuccess/assets/freezeShrimp.png b/src/components/modules/checkout/CheckoutSuccess/assets/freezeShrimp.png new file mode 100644 index 000000000..5b3a501ac Binary files /dev/null and b/src/components/modules/checkout/CheckoutSuccess/assets/freezeShrimp.png differ diff --git a/src/components/modules/checkout/CheckoutSuccess/assets/veget.png b/src/components/modules/checkout/CheckoutSuccess/assets/veget.png new file mode 100644 index 000000000..83b8f51cc Binary files /dev/null and b/src/components/modules/checkout/CheckoutSuccess/assets/veget.png differ