ordering-ui-react-native 0.16.11 → 0.16.12
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 +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +8 -2
- package/themes/original/src/components/OrderDetails/index.tsx +1 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/shared/OModal.tsx +3 -1
package/package.json
CHANGED
|
@@ -118,7 +118,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
|
|
|
118
118
|
!subcategoriesSelected.find((subcategory: any) => subcategory?.parent_category_id === category?.id) ||
|
|
119
119
|
subcategoriesSelected?.some((subcategory: any) => subcategory.id === product?.category_id))
|
|
120
120
|
?.sort((a: any, b: any) => a.rank - b.rank)
|
|
121
|
-
?.map((product: any, i
|
|
121
|
+
?.map((product: any, i: number) => (
|
|
122
122
|
<SingleProductCard
|
|
123
123
|
key={'prod_' + product.id + `_${i}`}
|
|
124
124
|
isSoldOut={product.inventoried && !product.quantity}
|
|
@@ -320,8 +320,14 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
|
|
|
320
320
|
<OModal
|
|
321
321
|
open={!!openDescription}
|
|
322
322
|
onClose={() => setOpenDescription(null)}
|
|
323
|
+
styleContainerCloseButton={{
|
|
324
|
+
marginLeft: -30,
|
|
325
|
+
width: 55,
|
|
326
|
+
height: 55,
|
|
327
|
+
marginTop: 2
|
|
328
|
+
}}
|
|
323
329
|
>
|
|
324
|
-
<OText size={20} style={{paddingLeft: 70, paddingRight: 20, bottom: 25}}>{openDescription?.name}</OText>
|
|
330
|
+
<OText size={20} style={{ paddingLeft: 70, paddingRight: 20, bottom: 25 }}>{openDescription?.name}</OText>
|
|
325
331
|
<ScrollView style={{ padding: 20 }}>
|
|
326
332
|
{!!openDescription?.image && (
|
|
327
333
|
<OIcon
|
|
@@ -45,7 +45,7 @@ const PaymentOptionWalletUI = (props: any) => {
|
|
|
45
45
|
new Array(walletsState.result?.length).fill(false)
|
|
46
46
|
);
|
|
47
47
|
|
|
48
|
-
const creditBalance: any = (wallet: any) => ` = ${parsePrice(wallet.balance / wallet.redemption_rate)}`
|
|
48
|
+
const creditBalance: any = (wallet: any) => ` = ${parsePrice(wallet.balance / wallet.redemption_rate, { isTruncable: true })}`
|
|
49
49
|
|
|
50
50
|
const walletName: any = {
|
|
51
51
|
cash: {
|
|
@@ -87,65 +87,65 @@ const PaymentOptionWalletUI = (props: any) => {
|
|
|
87
87
|
{!walletsState.loading &&
|
|
88
88
|
!walletsState.error &&
|
|
89
89
|
walletsState.result?.length > 0 &&
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
90
|
+
(
|
|
91
|
+
<>
|
|
92
|
+
{walletsState.result?.map((wallet: any, idx: any) => wallet.valid && wallet.balance >= 0 && walletName[wallet.type]?.isActive && (
|
|
93
|
+
<Container
|
|
94
|
+
key={wallet.id}
|
|
95
|
+
isBottomBorder={idx === walletsState.result?.filter((wallet: any) => wallet.valid)?.length - 1}
|
|
96
|
+
onPress={() => handleOnChange(idx, wallet)}
|
|
97
|
+
disabled={(cart?.balance === 0 && !checkedState[idx]) || wallet.balance === 0}
|
|
98
|
+
>
|
|
99
|
+
<SectionLeft>
|
|
100
|
+
{checkedState[idx] ? (
|
|
101
|
+
<MaterialCommunityIcons
|
|
102
|
+
name="checkbox-marked"
|
|
103
|
+
size={25}
|
|
104
|
+
color={theme.colors.primary}
|
|
105
|
+
/>
|
|
106
|
+
) : (
|
|
107
|
+
<MaterialCommunityIcons
|
|
108
|
+
name="checkbox-blank-outline"
|
|
109
|
+
size={25}
|
|
110
|
+
color={theme.colors.disabled}
|
|
111
|
+
/>
|
|
112
|
+
)}
|
|
113
|
+
<View style={{ alignItems: 'baseline', marginLeft: 5 }}>
|
|
114
|
+
<View>
|
|
115
|
+
<OText
|
|
116
|
+
style={((cart?.balance === 0 && !checkedState[idx]) || wallet.balance === 0) ? {
|
|
117
|
+
color: theme.colors.disabled
|
|
118
|
+
} : {}}
|
|
119
|
+
>
|
|
120
|
+
{walletName[wallet.type]?.name}
|
|
121
|
+
</OText>
|
|
122
|
+
</View>
|
|
122
123
|
</View>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
{parsePrice(wallet?.balance)}
|
|
130
|
-
</OText>
|
|
131
|
-
)}
|
|
132
|
-
{wallet.type === 'credit_point' && (
|
|
133
|
-
<OText>
|
|
134
|
-
<OText color={theme.colors.primary} weight='bold'>
|
|
135
|
-
{`${wallet?.balance} ${t('POINTS', 'Points')}`}
|
|
124
|
+
</SectionLeft>
|
|
125
|
+
|
|
126
|
+
<View style={{ maxWidth: '35%', alignItems: 'flex-end' }}>
|
|
127
|
+
{wallet.type === 'cash' && (
|
|
128
|
+
<OText>
|
|
129
|
+
{parsePrice(wallet?.balance, { isTruncable: true })}
|
|
136
130
|
</OText>
|
|
131
|
+
)}
|
|
132
|
+
{wallet.type === 'credit_point' && (
|
|
137
133
|
<OText>
|
|
138
|
-
{
|
|
139
|
-
|
|
140
|
-
|
|
134
|
+
<OText color={theme.colors.primary} weight='bold'>
|
|
135
|
+
{`${wallet?.balance} ${t('POINTS', 'Points')}`}
|
|
136
|
+
</OText>
|
|
137
|
+
<OText>
|
|
138
|
+
{wallet?.balance > 0
|
|
139
|
+
? creditBalance(wallet)
|
|
140
|
+
: null}
|
|
141
|
+
</OText>
|
|
141
142
|
</OText>
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
</
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
)}
|
|
143
|
+
)}
|
|
144
|
+
</View>
|
|
145
|
+
</Container>
|
|
146
|
+
))}
|
|
147
|
+
</>
|
|
148
|
+
)}
|
|
149
149
|
|
|
150
150
|
{walletsState?.loading && (
|
|
151
151
|
<View>
|
|
@@ -21,6 +21,7 @@ interface Props {
|
|
|
21
21
|
isNotDecoration?: boolean;
|
|
22
22
|
styleCloseButton?: any,
|
|
23
23
|
isAvoidKeyBoardView?: boolean;
|
|
24
|
+
styleContainerCloseButton?: any;
|
|
24
25
|
}
|
|
25
26
|
const KeyboardView = styled.KeyboardAvoidingView`
|
|
26
27
|
flex-grow: 1;
|
|
@@ -45,6 +46,7 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
45
46
|
isNotDecoration,
|
|
46
47
|
style,
|
|
47
48
|
styleCloseButton,
|
|
49
|
+
styleContainerCloseButton,
|
|
48
50
|
isAvoidKeyBoardView
|
|
49
51
|
} = props
|
|
50
52
|
|
|
@@ -55,7 +57,7 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
55
57
|
{!entireModal ? (
|
|
56
58
|
<View style={styles.centeredView}>
|
|
57
59
|
<View style={titleSectionStyle ? titleSectionStyle : styles.titleSection}>
|
|
58
|
-
<TouchableOpacity style={styles.wrapperIcon} onPress={onClose}>
|
|
60
|
+
<TouchableOpacity style={{...styles.wrapperIcon, ...styleContainerCloseButton}} onPress={onClose}>
|
|
59
61
|
<OIcon
|
|
60
62
|
src={theme.images.general.close}
|
|
61
63
|
width={16}
|