🔨 refactor: checkout

:%s
This commit is contained in:
unknown
2021-09-07 14:41:53 +07:00
parent 267d7918fa
commit 859f645c03
15 changed files with 69 additions and 54 deletions

View File

@@ -1,23 +1,26 @@
import { useState } from 'react'
import {
CardItemCheckout,
CheckoutBill,
CustomerInfoForm,
Layout,
ShippingInfoForm,
} from 'src/components/common'
import { CardItemCheckoutProps } from 'src/components/common/CardItemCheckout/CardItemCheckout'
import CheckoutCollapse from 'src/components/common/CheckoutCollapse/CheckoutCollapse'
import PaginationCommon from 'src/components/common/PaginationCommon/PaginationCommon'
import CheckoutCollapse from 'src/components/modules/checkout/components/CheckoutCollapse/CheckoutCollapse'
import CustomerInfoForm from 'src/components/modules/checkout/components/CustomerInfoForm/CustomerInfoForm'
import ShippingInfoForm from 'src/components/modules/checkout/components/ShippingInfoForm/ShippingInfoForm'
import image5 from '../public/assets/images/image5.png'
import image6 from '../public/assets/images/image6.png'
import image7 from '../public/assets/images/image7.png'
import image8 from '../public/assets/images/image8.png'
const dataTest = [
const dataTest:CardItemCheckoutProps[] = [
{
name: 'Tomato',
weight: '250g',
category: 'VEGGIE',
price: 'Rp 27.500',
imageSrc: image7.src,
quantity:10
},
{
name: 'Carrot',
@@ -25,6 +28,7 @@ const dataTest = [
category: 'VEGGIE',
price: 'Rp 27.500',
imageSrc: image7.src,
quantity:1
},
{
name: 'Salad',
@@ -32,6 +36,7 @@ const dataTest = [
category: 'VEGGIE',
price: 'Rp 27.500',
imageSrc: image8.src,
quantity:2
},
{
name: 'Tomato',
@@ -39,20 +44,7 @@ const dataTest = [
category: 'VEGGIE',
price: 'Rp 27.500',
imageSrc: image5.src,
},
{
name: 'Carrot',
weight: '250g',
category: 'VEGGIE',
price: 'Rp 27.500',
imageSrc: image7.src,
},
{
name: 'Salad',
weight: '250g',
category: 'VEGGIE',
price: 'Rp 27.500',
imageSrc: image8.src,
quantity:9
},
]
export default function Test() {
@@ -72,14 +64,16 @@ export default function Test() {
}
return (
<>
<CardItemCheckout {...dataTest[0]} quantity={2}/>
<div className="w-full" style={{padding: "0 3.2rem"}} >
<CheckoutCollapse id={1} visible={visible} onOpen={onOpen} onClose={onClose} title="Customer Information" isEdit={true}>
<CustomerInfoForm/>
</CheckoutCollapse>
<CheckoutCollapse id={2} visible={visible2} onOpen={onOpen2} onClose={onClose2} title="Shipping Information" isEdit={true}>
<ShippingInfoForm/>
</CheckoutCollapse>
<div className="w-full flex" style={{padding: "0 3.2rem"}} >
<div className="">
<CheckoutCollapse id={1} visible={visible} onOpen={onOpen} onClose={onClose} title="Customer Information" isEdit={true}>
<CustomerInfoForm/>
</CheckoutCollapse>
<CheckoutCollapse id={2} visible={visible2} onOpen={onOpen2} onClose={onClose2} title="Shipping Information" isEdit={true}>
<ShippingInfoForm/>
</CheckoutCollapse>
</div>
<CheckoutBill data={dataTest}/>
</div>
</>
)