Repository URL to install this package:
|
Version:
0.14.1 ▾
|
ui-component-library
/
src
/
components
/
presets
/
Checkout
/
GuestUser
/
MultipleShipping
/
renderProps.tsx
|
|---|
import React from 'react'
import { ShippingAddress } from 'src/forms/views'
import { ShippingMethodOption, DeliveryInstruction } from 'presets/Checkout'
import { ProductItem } from 'presets/ProductPieces'
import { MultipleShippingProps } from './typings'
function defaultRenderProductItem(props: MultipleShippingProps) {
const { productItem } = props
return <ProductItem item={productItem} />
}
function defaultRenderShippingAddress(props: MultipleShippingProps) {
return <ShippingAddress />
}
function defaultRenderShippingMethod(props: MultipleShippingProps) {
const { shippingMethodOptionList, handleShippingMethodChange } = props
return <ShippingMethodOption list={shippingMethodOptionList} onChange={handleShippingMethodChange} />
}
function defaultRenderDeliveryInstruction(props: MultipleShippingProps) {
const {
deliveryInstructionConfig,
handleAddDeliveryInstruction,
handleRemoveDeliveryInstruction,
} = props
return (
<DeliveryInstruction
{...deliveryInstructionConfig}
onSubmit={handleAddDeliveryInstruction}
onCancel={handleRemoveDeliveryInstruction}
/>
)
}
export {
defaultRenderProductItem,
defaultRenderShippingAddress,
defaultRenderShippingMethod,
defaultRenderDeliveryInstruction,
}