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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.16.11",
3
+ "version": "0.16.12",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -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 : number) => (
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
@@ -1027,7 +1027,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1027
1027
  )}
1028
1028
  </View>
1029
1029
  <OText>
1030
- -{parsePrice(event.amount)}
1030
+ -{parsePrice(event.amount, {isTruncable: true})}
1031
1031
  </OText>
1032
1032
  </View>
1033
1033
  ))}
@@ -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
- {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>
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
- </View>
124
- </SectionLeft>
125
-
126
- <View style={{maxWidth: '35%', alignItems: 'flex-end' }}>
127
- {wallet.type === 'cash' && (
128
- <OText>
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
- {wallet?.balance > 0
139
- ? creditBalance(wallet)
140
- : null}
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
- </OText>
143
- )}
144
- </View>
145
- </Container>
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}