ordering-ui-react-native 0.21.72 → 0.21.73
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
|
@@ -33,6 +33,7 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
33
33
|
const [state, setState] = useState({
|
|
34
34
|
selectedPrinter: { url: undefined },
|
|
35
35
|
});
|
|
36
|
+
const paymethodsLength = order?.payment_events?.filter((item: any) => item.event === 'payment')?.length
|
|
36
37
|
|
|
37
38
|
const getFormattedSubOptionName = ({ quantity, name, position, price }: any) => {
|
|
38
39
|
if (name !== 'No') {
|
|
@@ -83,6 +84,24 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
83
84
|
const customerName = `${order?.customer?.name ?? ''} ${order?.customer?.middle_name ?? ''} ${order?.customer?.lastname ?? ''} ${order?.customer?.second_lastname ?? ''
|
|
84
85
|
}`?.replace(' ', ' ')?.trim() ?? ''
|
|
85
86
|
|
|
87
|
+
const walletName: any = {
|
|
88
|
+
cash: {
|
|
89
|
+
name: t('CASH_WALLET', 'Cash Wallet')
|
|
90
|
+
},
|
|
91
|
+
credit_point: {
|
|
92
|
+
name: t('POINTS_WALLET', 'Points Wallet')
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const handlePaymethodsListString = () => {
|
|
97
|
+
const paymethodsList = order?.payment_events?.filter((item: any) => item.event === 'payment').map((paymethod: any) => {
|
|
98
|
+
return paymethod?.wallet_event
|
|
99
|
+
? walletName[paymethod?.wallet_event?.wallet?.type]?.name
|
|
100
|
+
: t(paymethod?.paymethod?.gateway?.toUpperCase(), paymethod?.paymethod?.name)
|
|
101
|
+
})
|
|
102
|
+
return paymethodsList.join(', ')
|
|
103
|
+
}
|
|
104
|
+
|
|
86
105
|
const orderSummary = () => {
|
|
87
106
|
return `
|
|
88
107
|
<div>
|
|
@@ -99,7 +118,7 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
99
118
|
: parseDate(order?.delivery_datetime, { utc: false })
|
|
100
119
|
}
|
|
101
120
|
</br>
|
|
102
|
-
${
|
|
121
|
+
${paymethodsLength > 1 ? 'PAYMENT_METHODS' : 'PAYMENT_METHOD'}: ${handlePaymethodsListString()}
|
|
103
122
|
</p>
|
|
104
123
|
|
|
105
124
|
<h1>${t('CUSTOMER_DETAILS', 'Customer details')}</h1>
|
|
@@ -114,8 +133,8 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
114
133
|
} </br>`
|
|
115
134
|
: ''
|
|
116
135
|
}
|
|
117
|
-
${t('FULL_ADDRESS', 'Full Addres')}: ${order?.customer?.address}
|
|
118
|
-
</br>
|
|
136
|
+
${t('FULL_ADDRESS', 'Full Addres')}: ${order?.customer?.address}
|
|
137
|
+
</br>
|
|
119
138
|
${!!order?.customer?.internal_number
|
|
120
139
|
? `${t('INTERNAL_NUMBER', 'Internal Number')}: ${order?.customer?.internal_number
|
|
121
140
|
} </br>`
|
|
@@ -379,10 +398,7 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
379
398
|
}`}
|
|
380
399
|
</OText>
|
|
381
400
|
|
|
382
|
-
<OText style={{ marginBottom: 5 }}>{`${t('PAYMENT_METHOD')}: ${
|
|
383
|
-
order?.paymethod?.name.toUpperCase(),
|
|
384
|
-
order?.paymethod?.name,
|
|
385
|
-
)}`}</OText>
|
|
401
|
+
<OText style={{ marginBottom: 5 }}>{`${t(`${paymethodsLength > 1 ? 'PAYMENT_METHODS' : 'PAYMENT_METHOD'}`, `${paymethodsLength > 1 ? 'Payment methods' : 'Payment method'}`)}: ${handlePaymethodsListString()}`}</OText>
|
|
386
402
|
</OrderHeader>
|
|
387
403
|
|
|
388
404
|
<OrderCustomer>
|
|
@@ -27,9 +27,9 @@ const StyledButton = styled.View<Props>`
|
|
|
27
27
|
padding-left: 20px;
|
|
28
28
|
padding-right: 20px;
|
|
29
29
|
position: relative;
|
|
30
|
-
${(props: any) => props?.
|
|
31
|
-
border-radius: ${props?.
|
|
32
|
-
|
|
30
|
+
${(props: any) => props?.borderRadius && css`
|
|
31
|
+
border-radius: ${typeof props?.borderRadius === 'string' ? props?.borderRadius : `${props?.borderRadius}px`};
|
|
32
|
+
`}
|
|
33
33
|
`
|
|
34
34
|
const StyledButtonDisabled = styled(StyledButton)`
|
|
35
35
|
background-color: ${(props: any) => props.theme.colors.disabled};
|
|
@@ -53,9 +53,9 @@ const Wrapper = styled.Pressable`
|
|
|
53
53
|
align-items: center;
|
|
54
54
|
justify-content: center;
|
|
55
55
|
width: 100%;
|
|
56
|
-
${(props: any) => props
|
|
57
|
-
border-radius: ${props?.
|
|
58
|
-
|
|
56
|
+
${(props: any) => props?.borderRadius && css`
|
|
57
|
+
border-radius: ${typeof props?.borderRadius === 'string' ? props?.borderRadius : `${props?.borderRadius}px`};
|
|
58
|
+
`}
|
|
59
59
|
`;
|
|
60
60
|
|
|
61
61
|
const OInput = (props: Props): React.ReactElement => {
|
|
@@ -70,6 +70,7 @@ const OInput = (props: Props): React.ReactElement => {
|
|
|
70
70
|
? props.borderColor
|
|
71
71
|
: inputFocused ? theme.colors.primary : theme.colors.border,
|
|
72
72
|
...props.style,
|
|
73
|
+
borderRadius: parseInt(theme?.general?.components?.inputs?.borderRadius) || props.style?.borderRadius
|
|
73
74
|
}}>
|
|
74
75
|
{props.icon ? (
|
|
75
76
|
<OIcon
|
|
@@ -104,9 +105,9 @@ const OInput = (props: Props): React.ReactElement => {
|
|
|
104
105
|
props.forwardRef && (props.forwardRef.current = e)
|
|
105
106
|
}}
|
|
106
107
|
style={{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
...(theme?.general?.components?.inputs?.color && {
|
|
109
|
+
color: theme?.general?.components?.inputs?.color
|
|
110
|
+
}),
|
|
110
111
|
...props?.inputStyle
|
|
111
112
|
}}
|
|
112
113
|
onFocus={() => setInputFocused(true)}
|