ordering-ui-react-native 0.15.72 → 0.15.75

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.15.72",
3
+ "version": "0.15.75",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -385,7 +385,7 @@ export const OrderContentComponent = (props: OrderContent) => {
385
385
  order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 1)?.map((offer: any) => (
386
386
  <Table key={offer.id}>
387
387
  <OSRow>
388
- <OText numberOfLines={1} mBottom={4}>
388
+ <OText mBottom={4}>
389
389
  {offer.name}
390
390
  {offer.rate_type === 1 && (
391
391
  <OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
@@ -431,7 +431,7 @@ export const OrderContentComponent = (props: OrderContent) => {
431
431
  order?.taxes?.length > 0 && order?.taxes?.filter((tax: any) => tax?.type === 2 && tax?.rate !== 0).map((tax: any) => (
432
432
  <Table key={tax.id}>
433
433
  <OSRow>
434
- <OText numberOfLines={1} mBottom={4}>
434
+ <OText mBottom={4}>
435
435
  {tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
436
436
  {`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
437
437
  </OText>
@@ -444,7 +444,7 @@ export const OrderContentComponent = (props: OrderContent) => {
444
444
  order?.fees?.length > 0 && order?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0))?.map((fee: any) => (
445
445
  <Table key={fee.id}>
446
446
  <OSRow>
447
- <OText numberOfLines={1} mBottom={4}>
447
+ <OText mBottom={4}>
448
448
  {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
449
449
  ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%){' '}
450
450
  </OText>
@@ -457,7 +457,7 @@ export const OrderContentComponent = (props: OrderContent) => {
457
457
  order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 3)?.map((offer: any) => (
458
458
  <Table key={offer.id}>
459
459
  <OSRow>
460
- <OText numberOfLines={1} mBottom={4}>
460
+ <OText mBottom={4}>
461
461
  {offer.name}
462
462
  {offer.rate_type === 1 && (
463
463
  <OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
@@ -485,7 +485,7 @@ export const OrderContentComponent = (props: OrderContent) => {
485
485
  order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 2)?.map((offer: any) => (
486
486
  <Table key={offer.id}>
487
487
  <OSRow>
488
- <OText numberOfLines={1} mBottom={4}>
488
+ <OText mBottom={4}>
489
489
  {offer.name}
490
490
  {offer.rate_type === 1 && (
491
491
  <OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
@@ -446,7 +446,7 @@ export const ProductOptionsUI = (props: any) => {
446
446
  </WrapperIngredients>
447
447
  </View>
448
448
  )}
449
- {product?.extras.map((extra: any) => extra.options.sort((a: any, b: any) => a.rank - b.rank).map((option: any) => {
449
+ {product?.extras.sort((a: any, b: any) => a.rank - b.rank).map((extra: any) => extra.options.sort((a: any, b: any) => a.rank - b.rank).map((option: any) => {
450
450
  const currentState = productCart.options[`id:${option.id}`] || {}
451
451
  return (
452
452
  <React.Fragment key={option.id}>
@@ -7,8 +7,7 @@ import {
7
7
  WalletList,
8
8
  useLanguage,
9
9
  useUtils,
10
- useConfig,
11
- useSession
10
+ useConfig
12
11
  } from 'ordering-components/native'
13
12
 
14
13
  import {
@@ -32,6 +31,7 @@ const WalletsUI = (props: any) => {
32
31
  const {
33
32
  navigation,
34
33
  walletList,
34
+ userLoyaltyLevel,
35
35
  transactionsList,
36
36
  setWalletSelected,
37
37
  isWalletCashEnabled,
@@ -42,7 +42,6 @@ const WalletsUI = (props: any) => {
42
42
  } = props
43
43
 
44
44
  const [, t] = useLanguage()
45
- const [{ user }] = useSession()
46
45
  const theme = useTheme()
47
46
  const [{ parsePrice }] = useUtils()
48
47
  const [{ configs }] = useConfig()
@@ -66,7 +65,7 @@ const WalletsUI = (props: any) => {
66
65
 
67
66
  const currentWalletSelected = (walletList.wallets?.length > 0 && walletList.wallets?.find((w: any) => w.type === tabSelected)) ?? null
68
67
 
69
- const loyaltyLevel = Object.keys(user?.loyalty_level ?? {}).length > 0 && user?.loyalty_level
68
+ const loyaltyLevel = Object.keys(userLoyaltyLevel.loyaltyLevel ?? {}).length > 0 && userLoyaltyLevel.loyaltyLevel
70
69
 
71
70
  const walletName: any = {
72
71
  cash: {
@@ -117,6 +116,7 @@ const WalletsUI = (props: any) => {
117
116
  />
118
117
 
119
118
  {!walletList.loading &&
119
+ !userLoyaltyLevel.loading &&
120
120
  !walletList.error &&
121
121
  walletList.wallets?.length > 0 &&
122
122
  (
@@ -239,7 +239,7 @@ const WalletsUI = (props: any) => {
239
239
  </>
240
240
  )}
241
241
 
242
- {walletList?.loading && (
242
+ {(walletList?.loading || userLoyaltyLevel.loading) && (
243
243
  <>
244
244
  <View>
245
245
  <Placeholder Animation={Fade}>
@@ -263,7 +263,7 @@ const WalletsUI = (props: any) => {
263
263
  </>
264
264
  )}
265
265
 
266
- {!walletList?.loading && (walletList?.error || !walletList?.wallets?.length) && (
266
+ {!walletList?.loading && !userLoyaltyLevel.loading && (walletList?.error || !walletList?.wallets?.length) && (
267
267
  <NotFoundSource
268
268
  content={walletList?.error
269
269
  ? t('ERROR_NOT_FOUND_WALLETS', 'Sorry, an error has occurred')