ordering-ui-react-native 0.17.23-release → 0.17.24-release

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.17.23-release",
3
+ "version": "0.17.24-release",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -53,7 +53,6 @@ const MultiCheckoutUI = (props: any) => {
53
53
  navigation,
54
54
  placing,
55
55
  openCarts,
56
- totalCartsPrice,
57
56
  handleGroupPlaceOrder,
58
57
  paymethodSelected,
59
58
  handleSelectPaymethod,
@@ -90,6 +89,17 @@ const MultiCheckoutUI = (props: any) => {
90
89
  const isMultiDriverTips = configs?.checkout_multi_business_enabled?.value === '1'
91
90
  const walletCarts = (Object.values(carts)?.filter((cart: any) => cart?.products && cart?.products?.length && cart?.status !== 2 && cart?.valid_schedule && cart?.valid_products && cart?.valid_address && cart?.valid_maximum && cart?.valid_minimum && cart?.wallets) || null) || []
92
91
 
92
+ const walletName: any = {
93
+ cash: {
94
+ name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet'),
95
+ },
96
+ credit_point: {
97
+ name: t('PAY_WITH_CREDITS_POINTS_WALLET', 'Pay with Credit Points Wallet'),
98
+ }
99
+ }
100
+
101
+ const totalCartsPrice = cartGroup?.result?.balance
102
+
93
103
  const driverTipsOptions = typeof configs?.driver_tip_options?.value === 'string'
94
104
  ? JSON.parse(configs?.driver_tip_options?.value) || []
95
105
  : configs?.driver_tip_options?.value || []
@@ -414,6 +424,16 @@ const MultiCheckoutUI = (props: any) => {
414
424
  </OText>
415
425
  </View>
416
426
  )}
427
+ {!cartGroup?.loading && cartGroup?.result?.payment_events?.length > 0 && cartGroup?.result?.payment_events?.map((event: any) => (
428
+ <View key={event.id} style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
429
+ <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
430
+ {walletName[cartGroup?.result?.wallets?.find((wallet: any) => wallet.wallet_id === event.wallet_id)?.type]?.name}
431
+ </OText>
432
+ <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
433
+ -{parsePrice(event.amount, { isTruncable: true })}
434
+ </OText>
435
+ </View>
436
+ ))}
417
437
  <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
418
438
  <OText size={16} lineHeight={24} color={theme.colors.textNormal} weight={'500'}>
419
439
  {t('TOTAL_FOR_ALL_CARTS', 'Total for all Carts')}
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { Pressable, StyleSheet, View, ScrollView, TouchableOpacity } from 'react-native';
2
+ import { Pressable, StyleSheet, View, ScrollView, TouchableOpacity, Platform } from 'react-native';
3
3
  import { useTheme } from 'styled-components/native'
4
4
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
5
5
  import FastImage from 'react-native-fast-image'
@@ -121,18 +121,62 @@ const WalletsUI = (props: any) => {
121
121
  <>
122
122
  <Container>
123
123
  <Header>
124
- <OText size={24} style={{ marginTop: 30 }}>{t('WALLETS', 'Wallets')}</OText>
125
- {isChewLayout && (
126
- <OButton
127
- text={t('WALLET_HISTORY', 'Wallet history')}
128
- bgColor={theme.colors.white}
129
- borderColor={theme.colors.lightGray}
130
- imgRightSrc={null}
131
- textStyle={{ fontSize: 12, color: theme.colors.disabled }}
132
- onClick={() => setOpenHistory(true)}
133
- style={{ borderRadius: 8, height: 40 }}
134
- />
135
- )}
124
+ <View style={{
125
+ ...{
126
+ width: '100%',
127
+ display: 'flex',
128
+ flexDirection: 'row',
129
+ alignItems: 'center',
130
+ marginTop: 30,
131
+ justifyContent: 'space-between',
132
+ alignContent: 'center'
133
+ },
134
+ }}>
135
+ {(!props.hideBackBtn || !hideWalletsTheme) && !isChewLayout && (
136
+ <OButton
137
+ imgLeftStyle={{ width: 18 }}
138
+ imgRightSrc={null}
139
+ style={{
140
+ borderWidth: 0,
141
+ width: 26,
142
+ height: 26,
143
+ backgroundColor: '#FFF',
144
+ borderColor: '#FFF',
145
+ shadowColor: '#FFF',
146
+ paddingLeft: 0,
147
+ paddingRight: 0,
148
+ marginTop: 30,
149
+ }}
150
+ onClick={goToBack}
151
+ icon={AntDesignIcon}
152
+ iconProps={{
153
+ name: 'arrowleft',
154
+ size: 26
155
+ }}
156
+ />
157
+ )}
158
+ <OText
159
+ size={20}
160
+ style={{
161
+ marginLeft: (!props.hideBackBtn || !hideWalletsTheme) && !isChewLayout ? 40 : 0,
162
+ color: theme.colors.textNormal,
163
+ }}
164
+ weight={Platform.OS === 'ios' ? '600' : 'bold'}
165
+ >
166
+ {t('WALLETS', 'Wallets')}
167
+ </OText>
168
+ {isChewLayout && (
169
+ <OButton
170
+ text={t('WALLET_HISTORY', 'Wallet history')}
171
+ bgColor={theme.colors.white}
172
+ borderColor={theme.colors.lightGray}
173
+ imgRightSrc={null}
174
+ textStyle={{ fontSize: 12, color: theme.colors.disabled }}
175
+ onClick={() => setOpenHistory(true)}
176
+ style={{ borderRadius: 8, height: 40 }}
177
+ />
178
+ )}
179
+ </View>
136
180
  </Header>
137
181
 
138
182
  {!walletList.loading &&
@@ -273,15 +317,18 @@ const WalletsUI = (props: any) => {
273
317
  <ScrollView>
274
318
  <WalletTransactionsWrapper>
275
319
  <OButton
320
+ imgLeftStyle={{ width: 18 }}
276
321
  imgRightSrc={null}
277
322
  style={{
278
323
  borderWidth: 0,
279
- backgroundColor: theme.colors.white,
280
- padding: 0,
281
- paddingHorizontal: 0,
282
- width: 30,
324
+ width: 26,
325
+ height: 26,
326
+ backgroundColor: '#FFF',
327
+ borderColor: '#FFF',
328
+ shadowColor: '#FFF',
283
329
  paddingLeft: 0,
284
- paddingRight: 0
330
+ paddingRight: 0,
331
+ marginBottom: 10
285
332
  }}
286
333
  onClick={() => setOpenHistory(false)}
287
334
  icon={AntDesignIcon}