From 5933732a74ae1ca4124ddd4e8265b1f443234736 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 21 Feb 2023 21:51:51 +0700 Subject: fix --- src/core/components/elements/Image/Image.jsx | 16 ++--- src/core/components/elements/Sidebar/Sidebar.jsx | 4 +- src/lib/transaction/components/Transaction.jsx | 79 +++++++++++++----------- src/lib/wishlist/api/wishlistsApi.js | 10 +++ src/lib/wishlist/components/Wishlists.jsx | 41 ++++++++++++ src/lib/wishlist/hooks/useWishlists.js | 14 +++++ src/pages/my/wishlist.jsx | 10 +++ 7 files changed, 129 insertions(+), 45 deletions(-) create mode 100644 src/lib/wishlist/api/wishlistsApi.js create mode 100644 src/lib/wishlist/components/Wishlists.jsx create mode 100644 src/lib/wishlist/hooks/useWishlists.js create mode 100644 src/pages/my/wishlist.jsx diff --git a/src/core/components/elements/Image/Image.jsx b/src/core/components/elements/Image/Image.jsx index 579660a4..a6f0b00c 100644 --- a/src/core/components/elements/Image/Image.jsx +++ b/src/core/components/elements/Image/Image.jsx @@ -2,13 +2,15 @@ import { LazyLoadImage } from "react-lazy-load-image-component" import "react-lazy-load-image-component/src/effects/opacity.css" const Image = ({ ...props }) => ( - + <> + + ) Image.defaultProps = LazyLoadImage.defaultProps diff --git a/src/core/components/elements/Sidebar/Sidebar.jsx b/src/core/components/elements/Sidebar/Sidebar.jsx index 88de1c1c..c840a688 100644 --- a/src/core/components/elements/Sidebar/Sidebar.jsx +++ b/src/core/components/elements/Sidebar/Sidebar.jsx @@ -44,8 +44,8 @@ const Sidebar = ({
{ !auth && ( <> - Daftar - Masuk + Daftar + Masuk ) } { auth && ( diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index e049a9ac..0759dbf8 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -46,15 +46,6 @@ const Transaction = ({ id }) => { toast.error('Terjadi kesalahan internal, coba lagi nanti atau hubungi kami') } - const [ section, setSection ] = useState({ - customer: false, - invoice: false, - shipping: false - }) - const toggleSection = (name) => { - setSection({ ...section, [name]: !section[name] }) - } - const [ cancelTransaction, setCancelTransaction ] = useState(false) const openCancelTransaction = () => setCancelTransaction(true) const closeCancelTransaction = () => setCancelTransaction(false) @@ -142,33 +133,7 @@ const Transaction = ({ id }) => { - toggleSection('customer')} - /> - - { section.customer && } - - - - toggleSection('shipping')} - /> - - { section.shipping && } - - - - toggleSection('invoice')} - /> - - { section.invoice && } + @@ -288,6 +253,48 @@ const Transaction = ({ id }) => { ) } +const SectionAddress = ({ address }) => { + const [ section, setSection ] = useState({ + customer: false, + invoice: false, + shipping: false + }) + const toggleSection = (name) => { + setSection({ ...section, [name]: !section[name] }) + } + + return ( + <> + toggleSection('customer')} + /> + + { section.customer && } + + + + toggleSection('shipping')} + /> + + { section.shipping && } + + + + toggleSection('invoice')} + /> + { section.invoice && } + + ) +} + const SectionButton = ({ label, active, toggle }) => (