From 9a52d9f835e2f30480142c6197fdf14b3fee5ead Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Tue, 12 Mar 2024 09:17:01 +0700 Subject: feedback kerajang di mobile --- .../modules/cart/components/CartSummaryMobile.tsx | 111 +++++++++++++++++++++ src-migrate/modules/cart/components/Summary.tsx | 110 +++++++++----------- 2 files changed, 160 insertions(+), 61 deletions(-) create mode 100644 src-migrate/modules/cart/components/CartSummaryMobile.tsx (limited to 'src-migrate/modules') diff --git a/src-migrate/modules/cart/components/CartSummaryMobile.tsx b/src-migrate/modules/cart/components/CartSummaryMobile.tsx new file mode 100644 index 00000000..d9f72e0e --- /dev/null +++ b/src-migrate/modules/cart/components/CartSummaryMobile.tsx @@ -0,0 +1,111 @@ +import style from '../styles/summary.module.css'; + +import React, { useState } from 'react'; +import formatCurrency from '~/libs/formatCurrency'; +import clsxm from '~/libs/clsxm'; +import { Button, Skeleton } from '@chakra-ui/react'; +import _ from 'lodash'; +import { ChevronDownIcon } from '@heroicons/react/24/outline'; +import BottomPopup from '@/core/components/elements/Popup/BottomPopup'; +import useDevice from '@/core/hooks/useDevice'; + +type Props = { + total?: number; + discount?: number; + subtotal?: number; + tax?: number; + shipping?: number; + grandTotal?: number; + isLoaded: boolean; +}; + +const CartSummaryMobile = ({ + total, + discount, + subtotal, + tax, + shipping, + grandTotal, + isLoaded = false, +}: Props) => { + const [showPopup, setShowPopup] = useState(false); + return ( + <> + setShowPopup(false)} + > +
+
+ + Total Belanja + + Rp {formatCurrency(subtotal || 0)} + + + + + Total Diskon + + - Rp {formatCurrency(discount || 0)} + + + +
+ + + Subtotal + + Rp {formatCurrency(total || 0)} + + + + + Tax 11% + Rp {formatCurrency(tax || 0)} + + + + Biaya Kirim + + Rp {formatCurrency(shipping || 0)} + + + +
+ + + Grand Total + + + Rp {formatCurrency(grandTotal || 0)} + + +
+
+ +
+ + + Grand Total + + + + + + Rp {formatCurrency(grandTotal || 0)} + + +
+ + ); +}; + +export default CartSummaryMobile; diff --git a/src-migrate/modules/cart/components/Summary.tsx b/src-migrate/modules/cart/components/Summary.tsx index 1e76d4fa..2e55c8df 100644 --- a/src-migrate/modules/cart/components/Summary.tsx +++ b/src-migrate/modules/cart/components/Summary.tsx @@ -1,20 +1,20 @@ -import style from '../styles/summary.module.css'; +import style from '../styles/summary.module.css' -import React from 'react'; -import formatCurrency from '~/libs/formatCurrency'; -import clsxm from '~/libs/clsxm'; -import { Skeleton } from '@chakra-ui/react'; -import _ from 'lodash'; +import React from 'react' +import formatCurrency from '~/libs/formatCurrency' +import clsxm from '~/libs/clsxm' +import { Skeleton } from '@chakra-ui/react' +import _ from 'lodash' type Props = { - total?: number; - discount?: number; - subtotal?: number; - tax?: number; - shipping?: number; - grandTotal?: number; - isLoaded: boolean; -}; + total?: number + discount?: number + subtotal?: number + tax?: number + shipping?: number + grandTotal?: number + isLoaded: boolean +} const CartSummary = ({ total, @@ -27,61 +27,49 @@ const CartSummary = ({ }: Props) => { return ( <> -
- Ringkasan Pesanan -
+
Ringkasan Pesanan
-
+
-
-
- - Total Belanja - - Rp {formatCurrency(subtotal || 0)} - - +
+ + Total Belanja + Rp {formatCurrency(subtotal || 0)} + - - Total Diskon - - - Rp {formatCurrency(discount || 0)} - - + + Total Diskon + - Rp {formatCurrency(discount || 0)} + -
+
- - Subtotal - Rp {formatCurrency(total || 0)} - + + Subtotal + Rp {formatCurrency(total || 0)} + - - Tax 11% - Rp {formatCurrency(tax || 0)} - + + Tax 11% + Rp {formatCurrency(tax || 0)} + - - Biaya Kirim - - Rp {formatCurrency(shipping || 0)} - - + + Biaya Kirim + Rp {formatCurrency(shipping || 0)} + -
-
-
+
- - - Grand Total - - - Rp {formatCurrency(grandTotal || 0)} - - + + + Grand Total + + Rp {formatCurrency(grandTotal || 0)} + +
- ); -}; + ) +} -export default CartSummary; +export default CartSummary \ No newline at end of file -- cgit v1.2.3