From 5933732a74ae1ca4124ddd4e8265b1f443234736 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 21 Feb 2023 21:51:51 +0700 Subject: fix --- src/lib/transaction/components/Transaction.jsx | 79 ++++++++++++++------------ 1 file changed, 43 insertions(+), 36 deletions(-) (limited to 'src/lib/transaction/components') 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 }) => (