ordering-ui-react-native 0.16.61 → 0.16.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -141,9 +141,9 @@ const CheckoutUI = (props: any) => {
|
|
|
141
141
|
const [showGateway, setShowGateway] = useState<any>({ closedByUsed: false, open: false });
|
|
142
142
|
const [webviewPaymethod, setWebviewPaymethod] = useState<any>(null)
|
|
143
143
|
const [isOpen, setIsOpen] = useState(false)
|
|
144
|
-
|
|
144
|
+
const [requiredFields, setRequiredFields] = useState<any>([])
|
|
145
145
|
|
|
146
|
-
const placeSpotTypes = [
|
|
146
|
+
const placeSpotTypes = [4]
|
|
147
147
|
const businessConfigs = businessDetails?.business?.configs ?? []
|
|
148
148
|
const isWalletCashEnabled = businessConfigs.find((config: any) => config.key === 'wallet_cash_enabled')?.value === '1'
|
|
149
149
|
const isWalletCreditPointsEnabled = businessConfigs.find((config: any) => config.key === 'wallet_credit_point_enabled')?.value === '1'
|
|
@@ -178,15 +178,15 @@ const CheckoutUI = (props: any) => {
|
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
const handlePlaceOrder = (confirmPayment
|
|
181
|
+
const handlePlaceOrder = (confirmPayment: any) => {
|
|
182
182
|
if (!userErrors.length && !requiredFields?.length) {
|
|
183
183
|
handlerClickPlaceOrder && handlerClickPlaceOrder(null, null, confirmPayment)
|
|
184
184
|
return
|
|
185
185
|
}
|
|
186
186
|
if (requiredFields?.length) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
187
|
+
setIsOpen(true)
|
|
188
|
+
return
|
|
189
|
+
}
|
|
190
190
|
let stringError = ''
|
|
191
191
|
Object.values(userErrors).map((item: any, i: number) => {
|
|
192
192
|
stringError += (i + 1) === userErrors.length ? `- ${item?.message || item}` : `- ${item?.message || item}\n`
|
|
@@ -646,6 +646,7 @@ const CheckoutUI = (props: any) => {
|
|
|
646
646
|
cart={cart}
|
|
647
647
|
isCartPending={cart?.status === 2}
|
|
648
648
|
onNavigationRedirect={onNavigationRedirect}
|
|
649
|
+
placeSpotTypes={placeSpotTypes}
|
|
649
650
|
/>
|
|
650
651
|
</>
|
|
651
652
|
)}
|
|
@@ -39,7 +39,8 @@ const OrderSummaryUI = (props: any) => {
|
|
|
39
39
|
commentState,
|
|
40
40
|
handleChangeComment,
|
|
41
41
|
onNavigationRedirect,
|
|
42
|
-
handleRemoveOfferClick
|
|
42
|
+
handleRemoveOfferClick,
|
|
43
|
+
placeSpotTypes
|
|
43
44
|
} = props;
|
|
44
45
|
|
|
45
46
|
const theme = useTheme()
|
|
@@ -52,7 +53,6 @@ const OrderSummaryUI = (props: any) => {
|
|
|
52
53
|
const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
|
|
53
54
|
const [openPlaceModal, setOpenPlaceModal] = useState(false)
|
|
54
55
|
const isCouponEnabled = validationFields?.fields?.checkout?.coupon?.enabled;
|
|
55
|
-
const placeSpotTypes = [3, 4]
|
|
56
56
|
|
|
57
57
|
const handleDeleteClick = (product: any) => {
|
|
58
58
|
removeProduct(product, cart)
|
|
@@ -304,7 +304,7 @@ const OrderSummaryUI = (props: any) => {
|
|
|
304
304
|
</OSTable>
|
|
305
305
|
</View>
|
|
306
306
|
)}
|
|
307
|
-
{placeSpotTypes.includes(orderState?.options?.type) && (
|
|
307
|
+
{placeSpotTypes && placeSpotTypes.includes(orderState?.options?.type) && (
|
|
308
308
|
<OSTable style={{ marginTop: 15 }}>
|
|
309
309
|
<OText size={14} lineHeight={21} weight={'600'}>
|
|
310
310
|
{t('SPOT', 'Spot')}: {cart?.place?.name || t('NO_SELECTED', 'No selected')}
|