ordering-ui-react-native 0.14.23 → 0.14.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.
Files changed (26) hide show
  1. package/package.json +2 -2
  2. package/src/components/ProductForm/index.tsx +40 -34
  3. package/src/components/VerifyPhone/styles.tsx +1 -2
  4. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  5. package/themes/doordash/src/components/ProductForm/index.tsx +14 -16
  6. package/themes/instacart/src/components/ProductForm/index.tsx +13 -15
  7. package/themes/kiosk/src/components/ProductForm/index.tsx +13 -15
  8. package/themes/original/index.tsx +0 -4
  9. package/themes/original/src/components/BusinessesListing/index.tsx +19 -25
  10. package/themes/original/src/components/Checkout/index.tsx +4 -15
  11. package/themes/original/src/components/Checkout/styles.tsx +1 -5
  12. package/themes/original/src/components/Help/index.tsx +2 -2
  13. package/themes/original/src/components/OrderDetails/index.tsx +0 -54
  14. package/themes/original/src/components/OrderProgress/index.tsx +2 -2
  15. package/themes/original/src/components/OrderSummary/index.tsx +2 -58
  16. package/themes/original/src/components/ProductForm/index.tsx +43 -28
  17. package/themes/original/src/components/UserProfile/index.tsx +0 -5
  18. package/themes/original/src/types/index.tsx +2 -4
  19. package/themes/single-business/src/components/ProductForm/index.tsx +28 -29
  20. package/themes/uber-eats/src/components/ProductForm/index.tsx +13 -15
  21. package/themes/original/src/components/PaymentOptionWallet/index.tsx +0 -163
  22. package/themes/original/src/components/PaymentOptionWallet/styles.tsx +0 -38
  23. package/themes/original/src/components/WalletTransactionItem/index.tsx +0 -68
  24. package/themes/original/src/components/WalletTransactionItem/styles.tsx +0 -37
  25. package/themes/original/src/components/Wallets/index.tsx +0 -204
  26. package/themes/original/src/components/Wallets/styles.tsx +0 -43
@@ -380,13 +380,30 @@ export const ProductOptionsUI = (props: any) => {
380
380
  </Placeholder>
381
381
  ) : (
382
382
  <>
383
- <OText
384
- size={20}
385
- lineHeight={30}
386
- weight={'600'}
387
- style={{ flex: 1, marginBottom: 5 }}>
388
- {product?.name || productCart.name}
389
- </OText>
383
+ <View style={{ flexDirection: 'row' }}>
384
+ <OText
385
+ size={20}
386
+ lineHeight={30}
387
+ weight={'600'}
388
+ style={{ flex: 1, marginBottom: 10 }}>
389
+ {product?.name || productCart.name}
390
+ </OText>
391
+ {product?.calories && (
392
+ <OText size={16} style={{ color: '#808080' }}>{product?.calories} cal
393
+ </OText>
394
+ )}
395
+ </View>
396
+ <View style={{ flexDirection: 'row', marginBottom: 10 }}>
397
+ <OText size={16} style={{ flex: I18nManager.isRTL ? 1 : 0 }} color={theme.colors.primary}>{productCart.price ? parsePrice(productCart.price) : ''}</OText>
398
+ {product?.offer_price && (
399
+ <OText style={{ fontSize: 14,
400
+ color: '#808080',
401
+ textDecorationLine: 'line-through',
402
+ marginLeft: 7,
403
+ marginRight: 7
404
+ }}>{parsePrice(product?.offer_price)}</OText>
405
+ )}
406
+ </View>
390
407
  {((product?.sku && product?.sku !== '-1' && product?.sku !== '1') || (product?.estimated_person)) && (
391
408
  <OText size={14} style={{ flex: I18nManager.isRTL ? 1 : 0 }} color={'#909BA9'} mBottom={7}>
392
409
  {
@@ -663,27 +680,25 @@ export const ProductOptionsUI = (props: any) => {
663
680
  )}
664
681
  </>
665
682
  )}
666
- {!product?.hide_special_instructions && (
667
- <ProductComment>
668
- <SectionTitle>
669
- <OText size={16} weight={'600'} lineHeight={24}>
670
- {t('SPECIAL_COMMENT', 'Special comment')}
671
- </OText>
672
- </SectionTitle>
673
- <OInput
674
- multiline
675
- placeholder={t('SPECIAL_COMMENT', 'Special comment')}
676
- value={productCart.comment}
677
- onChange={(val: string) =>
678
- handleChangeCommentState({ target: { value: val } })
679
- }
680
- isDisabled={
681
- !(productCart && !isSoldOut && maxProductQuantity)
682
- }
683
- style={styles.comment}
684
- />
685
- </ProductComment>
686
- )}
683
+ <ProductComment>
684
+ <SectionTitle>
685
+ <OText size={16} weight={'600'} lineHeight={24}>
686
+ {t('SPECIAL_COMMENT', 'Special comment')}
687
+ </OText>
688
+ </SectionTitle>
689
+ <OInput
690
+ multiline
691
+ placeholder={t('SPECIAL_COMMENT', 'Special comment')}
692
+ value={productCart.comment}
693
+ onChange={(val: string) =>
694
+ handleChangeCommentState({ target: { value: val } })
695
+ }
696
+ isDisabled={
697
+ !(productCart && !isSoldOut && maxProductQuantity)
698
+ }
699
+ style={styles.comment}
700
+ />
701
+ </ProductComment>
687
702
  </ProductEditions>
688
703
  )}
689
704
  </WrapContent>
@@ -14,7 +14,6 @@ import { ProfileParams } from '../../types';
14
14
  import { LogoutButton } from '../LogoutButton'
15
15
  import { LanguageSelector } from '../LanguageSelector'
16
16
  import MessageCircle from 'react-native-vector-icons/AntDesign'
17
- import Ionicons from 'react-native-vector-icons/Ionicons'
18
17
 
19
18
  import {
20
19
  OIcon,
@@ -161,10 +160,6 @@ const ProfileListUI = (props: ProfileParams) => {
161
160
  <MessageCircle name='message1' style={styles.messageIconStyle} color={theme.colors.textNormal} />
162
161
  <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MESSAGES', 'Messages')}</OText>
163
162
  </ListItem>
164
- <ListItem onPress={() => onRedirect('Wallets', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
165
- <Ionicons name='wallet-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
166
- <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('WALLETS', 'Wallets')}</OText>
167
- </ListItem>
168
163
  <ListItem onPress={() => navigation.navigate('Help', {})} activeOpacity={0.7}>
169
164
  <OIcon src={theme.images.general.ic_help} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
170
165
  <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('HELP', 'Help')}</OText>
@@ -129,7 +129,6 @@ export interface BusinessesListingParams {
129
129
  businessTypes?: any;
130
130
  defaultBusinessType?: any;
131
131
  franchiseId?: any;
132
- businessId?: any;
133
132
  }
134
133
  export interface HighestRatedBusinessesParams {
135
134
  businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
@@ -345,8 +344,8 @@ export interface MessagesParams {
345
344
  onClose?: () => void,
346
345
  isMeesageListing?: boolean,
347
346
  setCanRead?: any,
348
- business?: boolean,
349
- driver?: boolean,
347
+ business: boolean,
348
+ driver: boolean,
350
349
  onMessages?: any
351
350
  }
352
351
  export interface ViewInterface {
@@ -456,7 +455,6 @@ export interface GoogleMapsParams {
456
455
 
457
456
  export interface HelpParams {
458
457
  navigation: any;
459
- businessId?: any;
460
458
  }
461
459
 
462
460
  export interface LastOrdersParams {
@@ -527,35 +527,34 @@ export const ProductOptionsUI = (props: any) => {
527
527
  );
528
528
  }))}
529
529
  </View>
530
- {!product?.hide_special_instructions && (
531
- <ProductComment>
532
- <SectionTitle>
533
- <OText size={16} weight={'600'} lineHeight={24}>
534
- {t('SPECIAL_COMMENT', 'Special comment')}
535
- </OText>
536
- </SectionTitle>
537
- <OInput
538
- multiline={true}
539
- numberOfLines={10}
540
- placeholder={t('SPECIAL_COMMENT', 'Special comment')}
541
- value={productCart.comment}
542
- onChange={(val: string) =>
543
- handleChangeCommentState({ target: { value: val } })
544
- }
545
- isDisabled={
546
- !(productCart && !isSoldOut && maxProductQuantity)
547
- }
548
- style={{
549
- height: 100,
550
- justifyContent: "flex-end",
551
- alignItems: 'flex-start',
552
- borderWidth: 1,
553
- borderRadius: 8,
554
- borderColor: theme.colors.border,
555
- }}
556
- />
557
- </ProductComment>
558
- )}
530
+
531
+ <ProductComment>
532
+ <SectionTitle>
533
+ <OText size={16} weight={'600'} lineHeight={24}>
534
+ {t('SPECIAL_COMMENT', 'Special comment')}
535
+ </OText>
536
+ </SectionTitle>
537
+ <OInput
538
+ multiline={true}
539
+ numberOfLines={10}
540
+ placeholder={t('SPECIAL_COMMENT', 'Special comment')}
541
+ value={productCart.comment}
542
+ onChange={(val: string) =>
543
+ handleChangeCommentState({ target: { value: val } })
544
+ }
545
+ isDisabled={
546
+ !(productCart && !isSoldOut && maxProductQuantity)
547
+ }
548
+ style={{
549
+ height: 100,
550
+ justifyContent: "flex-end",
551
+ alignItems: 'flex-start',
552
+ borderWidth: 1,
553
+ borderRadius: 8,
554
+ borderColor: theme.colors.border,
555
+ }}
556
+ />
557
+ </ProductComment>
559
558
  </ProductEditions>
560
559
  )}
561
560
  </WrapContent>
@@ -327,21 +327,19 @@ export const ProductOptionsUI = (props: any) => {
327
327
  </React.Fragment>
328
328
  )
329
329
  }))}
330
- {!product?.hide_special_instructions && (
331
- <ProductComment>
332
- <SectionTitle>
333
- <OText size={16}>{t('SPECIAL_COMMENT', 'Special comment')}</OText>
334
- </SectionTitle>
335
- <OInput
336
- multiline
337
- placeholder={t('SPECIAL_COMMENT', 'Special comment')}
338
- value={productCart.comment}
339
- onChange={(val: string) => handleChangeCommentState({ target: { value: val } })}
340
- isDisabled={!(productCart && !isSoldOut && maxProductQuantity)}
341
- style={styles.comment}
342
- />
343
- </ProductComment>
344
- )}
330
+ <ProductComment>
331
+ <SectionTitle>
332
+ <OText size={16}>{t('SPECIAL_COMMENT', 'Special comment')}</OText>
333
+ </SectionTitle>
334
+ <OInput
335
+ multiline
336
+ placeholder={t('SPECIAL_COMMENT', 'Special comment')}
337
+ value={productCart.comment}
338
+ onChange={(val: string) => handleChangeCommentState({ target: { value: val } })}
339
+ isDisabled={!(productCart && !isSoldOut && maxProductQuantity)}
340
+ style={styles.comment}
341
+ />
342
+ </ProductComment>
345
343
  </ProductEditions>
346
344
  )}
347
345
  </WrapContent>
@@ -1,163 +0,0 @@
1
- import React, { useState, useEffect } from 'react'
2
- import { Platform, StyleSheet, View } from 'react-native'
3
- import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
4
- import { useTheme } from 'styled-components/native'
5
- import CheckBox from '@react-native-community/checkbox';
6
- import {
7
- PaymentOptionWallet as PaymentOptionWalletController,
8
- useLanguage,
9
- useUtils,
10
- } from 'ordering-components/native'
11
-
12
- import {
13
- Container,
14
- SectionLeft,
15
- } from './styles'
16
-
17
- import { OText } from '../shared'
18
-
19
- const PaymentOptionWalletUI = (props: any) => {
20
- const {
21
- cart,
22
- walletsState,
23
- selectWallet,
24
- deletetWalletSelected
25
- } = props
26
-
27
- const theme = useTheme()
28
- const [, t] = useLanguage()
29
- const [{ parsePrice }] = useUtils()
30
-
31
- const styles = StyleSheet.create({
32
- checkBoxStyle: {
33
- width: 25,
34
- height: 25,
35
- }
36
- });
37
-
38
- const [checkedState, setCheckedState] = useState(
39
- new Array(walletsState.result?.length).fill(false)
40
- );
41
-
42
- const creditBalance = (wallet: any) => ` = ${parsePrice((wallet.balance * wallet.redemption_rate) / 100)}`
43
-
44
- const walletName: any = {
45
- cash: {
46
- name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet'),
47
- },
48
- credit_point: {
49
- name: t('PAY_WITH_CREDITS_POINTS_WALLET', 'Pay with Credit Points Wallet'),
50
- }
51
- }
52
-
53
- const handleOnChange = (position: any, wallet: any) => {
54
- const updatedCheckedState = checkedState.map((item, index) =>
55
- index === position ? !item : item
56
- );
57
-
58
- if (!checkedState[position]) {
59
- selectWallet(wallet)
60
- } else {
61
- deletetWalletSelected(wallet)
62
- }
63
-
64
- setCheckedState(updatedCheckedState);
65
- };
66
-
67
- useEffect(() => {
68
- if (!walletsState.loading) {
69
- setCheckedState(
70
- walletsState.result.map((wallet: any) => {
71
- return !!cart?.wallets?.find((w: any) => w.id === wallet.id)
72
- })
73
- )
74
- }
75
- }, [walletsState.result?.length])
76
-
77
- return (
78
- <>
79
- {!walletsState.loading &&
80
- !walletsState.error &&
81
- walletsState.result?.length > 0 &&
82
- (
83
- <>
84
- {walletsState.result?.map((wallet: any, idx: any) => wallet.valid && (
85
- <Container
86
- key={wallet.id}
87
- isBottomBorder={idx === walletsState.result?.filter((wallet: any) => wallet.valid)?.length - 1}
88
- >
89
- <SectionLeft>
90
- <CheckBox
91
- value={checkedState[idx]}
92
- onValueChange={() => handleOnChange(idx, wallet)}
93
- disabled={(cart?.balance === 0 && !checkedState[idx]) || wallet.balance === 0 }
94
- boxType={'square'}
95
- tintColors={{
96
- true: theme.colors.primary,
97
- false: theme.colors.disabled
98
- }}
99
- tintColor={theme.colors.disabled}
100
- onCheckColor={theme.colors.primary}
101
- onTintColor={theme.colors.primary}
102
- style={Platform.OS === 'ios' && styles.checkBoxStyle}
103
- />
104
- <View style={{ alignItems: 'baseline' }}>
105
- <View>
106
- <OText
107
- style={((cart?.balance === 0 && !checkedState[idx]) || wallet.balance === 0) ?{
108
- color: theme.colors.disabled
109
- } : {}}
110
- >
111
- {walletName[wallet.type]?.name}
112
- </OText>
113
- </View>
114
- </View>
115
- </SectionLeft>
116
-
117
- <View style={{maxWidth: '40%', alignItems: 'flex-end' }}>
118
- {wallet.type === 'cash' && (
119
- <OText>
120
- {parsePrice(wallet?.balance)}
121
- </OText>
122
- )}
123
- {wallet.type === 'credit_point' && (
124
- <OText>
125
- <OText color={theme.colors.primary} weight='bold'>
126
- {`${wallet?.balance} ${t('POINTS', 'Points')}`}
127
- </OText>
128
- <OText>
129
- {`${wallet.balance > 0 && creditBalance(wallet)}`}
130
- </OText>
131
- </OText>
132
- )}
133
- </View>
134
- </Container>
135
- ))}
136
- </>
137
- )}
138
-
139
- {walletsState?.loading && (
140
- <View>
141
- {[...Array(2).keys()].map(i => (
142
- <View style={{ marginBottom: 10 }} key={i}>
143
- <Placeholder Animation={Fade}>
144
- <PlaceholderLine width={100} height={40} style={{ marginBottom: 0, borderRadius: 8 }} />
145
- </Placeholder>
146
- </View>
147
- ))}
148
- </View>
149
- )}
150
- </>
151
- )
152
- }
153
-
154
- export const PaymentOptionWallet = (props: any) => {
155
- const paymentWalletProps = {
156
- ...props,
157
- UIComponent: PaymentOptionWalletUI
158
- }
159
-
160
- return (
161
- <PaymentOptionWalletController {...paymentWalletProps} />
162
- )
163
- }
@@ -1,38 +0,0 @@
1
- import styled, { css } from 'styled-components/native'
2
-
3
- export const Container = styled.View`
4
- width: 100%;
5
- display: flex;
6
- padding: 20px 0;
7
- margin-top: 10px;
8
- flex-direction: row;
9
- justify-content: space-between;
10
- align-items: center;
11
- border-top-width: 1px;
12
- border-top-color: ${(props: any) => props.theme.colors.backgroundGray200};
13
- ${(props: any) => props.isBottomBorder && css`
14
- border-bottom-width: 1px;
15
- border-bottom-color: ${(props: any) => props.theme.colors.backgroundGray200};
16
- `}
17
- `
18
-
19
- export const SectionLeft = styled.View`
20
- max-width: 55%;
21
- display: flex;
22
- flex-direction: row;
23
- align-items: center;
24
- justify-content: center;
25
- `
26
-
27
- export const SectionLeftText = styled.View`
28
- alignSelf: flex-start;
29
- display: flex;
30
- flex-direction: column;
31
- flex-wrap: wrap;
32
- `
33
-
34
- export const SectionWrapper = styled.View`
35
- padding-top: 10px;
36
- display: flex;
37
- flex-direction: column;
38
- `
@@ -1,68 +0,0 @@
1
- import React from 'react'
2
- import { useTheme } from 'styled-components/native'
3
- import { useLanguage, useUtils } from 'ordering-components/native'
4
-
5
- import {
6
- Container,
7
- DateBlock,
8
- MessageBlock,
9
- DescriptionBlock,
10
- Dot
11
- } from './styles'
12
- import { OIcon, OText } from '../shared';
13
-
14
- export const WalletTransactionItem = (props: any) => {
15
- const {
16
- item,
17
- idx,
18
- type
19
- } = props
20
-
21
- const theme = useTheme()
22
- const [{ parsePrice, parseDate }] = useUtils()
23
- const [, t] = useLanguage()
24
-
25
- const LANG_EVENT_KEY = `WALLET_${type.toUpperCase()}_${item?.event.toUpperCase()}_${item?.event_type.toUpperCase()}_${item?.amount >= 0 ? 'POSITIVE': 'NEGATIVE'}`
26
- const lang_event_text = !!item?.event?.order_id
27
- ? `:author ${item?.amount >= 0 ? 'add' : 'reduce'} money in Order No. :order_id`
28
- : `:author ${item?.amount >= 0 ? 'add' : 'reduce'} money`
29
-
30
- return (
31
- <Container>
32
- <Dot isTop={idx === 0} />
33
- <DateBlock>
34
- <OText color={theme.colors.disabled}>{parseDate(item?.created_at)}</OText>
35
- <OText
36
- style={{
37
- color: item?.amount > 0 && theme.colors.primary,
38
- fontWeight: 'bold'
39
- }}
40
- >
41
- {item?.amount > 0 && '+ '}{parsePrice(item?.amount)}
42
- </OText>
43
- </DateBlock>
44
- <MessageBlock>
45
- <OText>
46
- {t(LANG_EVENT_KEY, lang_event_text)
47
- .replace(':author', item?.event?.author?.name ?? '')
48
- .replace(':order_id', item?.event?.order_id ?? '')}
49
- </OText>
50
- </MessageBlock>
51
- {!!item?.description && (
52
- <DescriptionBlock>
53
- <OText>{item?.description}</OText>
54
- </DescriptionBlock>
55
- )}
56
- {!!item?.code && (
57
- <DescriptionBlock>
58
- <OText weight={'bold'}>
59
- {t('CODE', 'Code')}
60
- <OText weight={'100'}>
61
- {': '}{item?.code}
62
- </OText>
63
- </OText>
64
- </DescriptionBlock>
65
- )}
66
- </Container>
67
- )
68
- }
@@ -1,37 +0,0 @@
1
- import styled from 'styled-components/native'
2
-
3
- export const Container = styled.View`
4
- display: flex;
5
- flex-direction: column;
6
- margin-bottom: 20px;
7
- position: relative;
8
- padding-left: 10px;
9
- `
10
-
11
- export const DateBlock = styled.View`
12
- display: flex;
13
- flex-direction: row;
14
- justify-content: space-between;
15
- align-items: center;
16
- `
17
-
18
- export const MessageBlock = styled.View`
19
- display: flex;
20
- font-size: 14px;
21
- `
22
-
23
- export const Dot = styled.View`
24
- position: absolute;
25
- top: ${(props: any) => props.isTop ? 0 : 6}px;
26
- left: -4px;
27
- width: 6px;
28
- height: 6px;
29
- border-radius: 50px;
30
- background-color: ${(props: any) => props.theme.colors.disabled};
31
- `
32
-
33
- export const DescriptionBlock = styled(MessageBlock)`
34
- display: flex;
35
- flex-direction: row;
36
- flex-wrap: wrap;
37
- `