ordering-ui-react-native 0.17.60 → 0.17.62

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 (24) hide show
  1. package/package.json +1 -1
  2. package/themes/business/src/components/PreviousOrders/index.tsx +1 -1
  3. package/themes/original/src/components/AddressDetails/index.tsx +9 -7
  4. package/themes/original/src/components/AddressForm/index.tsx +7 -1
  5. package/themes/original/src/components/BusinessController/index.tsx +66 -40
  6. package/themes/original/src/components/BusinessController/styles.tsx +1 -1
  7. package/themes/original/src/components/BusinessListingSearch/index.tsx +27 -11
  8. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +9 -8
  9. package/themes/original/src/components/Checkout/index.tsx +36 -53
  10. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  11. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  12. package/themes/original/src/components/MyOrders/index.tsx +42 -42
  13. package/themes/original/src/components/ProductForm/styles.tsx +2 -4
  14. package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -8
  15. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  16. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
  17. package/themes/original/src/components/Promotions/index.tsx +232 -219
  18. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  19. package/themes/original/src/components/SingleProductCard/index.tsx +17 -21
  20. package/themes/original/src/components/SingleProductCard/styles.tsx +1 -0
  21. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  22. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  23. package/themes/original/src/layouts/Container.tsx +1 -1
  24. package/themes/original/src/types/index.tsx +4 -0
@@ -67,51 +67,51 @@ export const MyOrders = (props: any) => {
67
67
  });
68
68
 
69
69
  return (
70
- <Container noPadding refreshControl={
71
- <RefreshControl
72
- refreshing={refreshing}
73
- onRefresh={() => handleOnRefresh()}
74
- />
75
- }>
70
+ <Container
71
+ pt={0}
72
+ noPadding
73
+ refreshControl={
74
+ <RefreshControl
75
+ refreshing={refreshing}
76
+ onRefresh={() => handleOnRefresh()}
77
+ />
78
+ }
79
+ >
76
80
  {(isChewLayout || showNavbar) && (
77
81
  <View style={{
78
- width: '100%',
79
- display: 'flex',
80
- flexDirection: 'row',
81
- alignItems: 'center',
82
- paddingHorizontal: 40,
83
- marginTop: Platform.OS === 'android' ? 50 : 30,
82
+ ...{
83
+ width: '100%',
84
+ display: 'flex',
85
+ flexDirection: 'row',
86
+ alignItems: 'center',
87
+ paddingHorizontal: 40,
88
+ marginTop: Platform.OS === 'android' ? 50 : 30,
89
+ },
90
+ ...props.titleStyle
84
91
  }}>
85
- <OButton
86
- imgLeftStyle={{ width: 18 }}
87
- imgRightSrc={null}
88
- style={{
89
- borderWidth: 0,
90
- width: 26,
91
- height: 26,
92
- backgroundColor: '#FFF',
93
- borderColor: '#FFF',
94
- shadowColor: '#FFF',
95
- paddingLeft: 0,
96
- paddingRight: 0
97
- }}
98
- onClick={goToBack}
99
- icon={AntDesignIcon}
100
- iconProps={{
101
- name: 'arrowleft',
102
- size: 26
103
- }}
104
- />
105
- <OText
106
- size={24}
107
- style={{
108
- textTransform: 'capitalize',
109
- marginLeft: 20,
110
- top: 2
111
- }}
112
- >
113
- {t('MY_ORDERS', 'My Orders')}
114
- </OText>
92
+ {!props.hideBackBtn && (
93
+ <OButton
94
+ imgLeftStyle={{ width: 18 }}
95
+ imgRightSrc={null}
96
+ style={{
97
+ borderWidth: 0,
98
+ width: 26,
99
+ height: 26,
100
+ backgroundColor: '#FFF',
101
+ borderColor: '#FFF',
102
+ shadowColor: '#FFF',
103
+ paddingLeft: 0,
104
+ paddingRight: 0
105
+ }}
106
+ onClick={goToBack}
107
+ icon={AntDesignIcon}
108
+ iconProps={{
109
+ name: 'arrowleft',
110
+ size: 26
111
+ }}
112
+ />
113
+ )}
114
+ <HeaderTitle ph={0} text={t('MY_ORDERS', 'My Orders')} />
115
115
  </View>
116
116
  )}
117
117
  {!hideOrders && !isChewLayout && !showNavbar && (
@@ -44,9 +44,7 @@ export const ProductTitle = styled.View`
44
44
  padding-bottom: 7px;
45
45
  `
46
46
 
47
- export const ProductDescription = styled.View`
48
- margin-bottom: 20px;
49
- `
47
+ export const ProductDescription = styled.View``
50
48
 
51
49
  export const ProductEditions = styled.View`
52
50
  padding: 0 40px;
@@ -96,7 +94,7 @@ export const WeightUnitItem = styled.View`
96
94
  `}
97
95
  `
98
96
  export const ProductSummary = styled.View`
99
- padding: 26px 40px;
97
+ padding: 26px 40px 0;
100
98
  position: relative;
101
99
  background-color: white;
102
100
  z-index: 100;
@@ -236,12 +236,12 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
236
236
  <MaterialCommunityIcon name='chevron-down' size={18} />
237
237
  )}
238
238
  </View>
239
- <View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start' }}>
239
+ <View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', height: 20 }}>
240
240
  {onEditProduct && isCartProduct && !isCartPending && product?.valid_menu && (
241
- <TouchableOpacity onPress={() => handleEditProduct(product)} style={{ marginEnd: 7 }}>
242
- <OIcon
243
- src={theme.images.general.pencil}
244
- width={20}
241
+ <TouchableOpacity onPress={() => handleEditProduct(product)} style={{ marginRight: 5 }}>
242
+ <MaterialCommunityIcon
243
+ name='pencil-outline'
244
+ size={20}
245
245
  color={theme.colors.textSecondary}
246
246
  />
247
247
  </TouchableOpacity>
@@ -252,9 +252,9 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
252
252
  message={t('QUESTION_DELETE_PRODUCT', 'Are you sure that you want to delete the product?')}
253
253
  onAccept={() => onDeleteProduct(product)}
254
254
  >
255
- <OIcon
256
- src={theme.images.general.trash}
257
- width={20}
255
+ <MaterialCommunityIcon
256
+ name='trash-can-outline'
257
+ size={20}
258
258
  color={theme.colors.textSecondary}
259
259
  />
260
260
  </OAlert>
@@ -6,6 +6,7 @@ import {
6
6
  } from 'ordering-components/native'
7
7
  import { useTheme } from 'styled-components/native';
8
8
  import { StyleSheet, View } from 'react-native'
9
+ import IconAntDesign from 'react-native-vector-icons/AntDesign';
9
10
 
10
11
  import {
11
12
  Container,
@@ -33,13 +34,16 @@ export const ProductOptionSubOptionUI = (props: any) => {
33
34
 
34
35
  const disableIncrement = option?.limit_suboptions_by_max ? balance === option?.max : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
35
36
  const price = option?.with_half_option && suboption?.half_price && state.position !== 'whole' ? suboption?.half_price : suboption?.price
36
-
37
+
37
38
  const theme = useTheme();
38
39
  const [, t] = useLanguage()
39
40
  const [{ parsePrice }] = useUtils()
40
41
  const [showMessage, setShowMessage] = useState(false)
41
42
  const [isDirty, setIsDirty] = useState(false)
42
43
 
44
+ const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
45
+ const iconsSize = isChewLayout ? 20 : 16
46
+
43
47
  const handleSuboptionClick = () => {
44
48
  toggleSelect()
45
49
  setIsDirty(true)
@@ -87,9 +91,9 @@ export const ProductOptionSubOptionUI = (props: any) => {
87
91
  {option?.allow_suboption_quantity && state?.selected && (
88
92
  <>
89
93
  <Checkbox disabled={disabled || state.quantity === 0} onPress={decrement}>
90
- <OIcon
91
- src={theme.images.general.minus}
92
- width={16}
94
+ <IconAntDesign
95
+ name='minuscircleo'
96
+ size={iconsSize}
93
97
  color={state.quantity === 0 || disabled ? theme.colors.disabled : theme.colors.primary}
94
98
  />
95
99
  </Checkbox>
@@ -97,9 +101,9 @@ export const ProductOptionSubOptionUI = (props: any) => {
97
101
  {state.quantity}
98
102
  </OText>
99
103
  <Checkbox disabled={disabled || disableIncrement} onPress={increment}>
100
- <OIcon
101
- src={theme.images.general.plus}
102
- width={16}
104
+ <IconAntDesign
105
+ name='pluscircleo'
106
+ size={iconsSize}
103
107
  color={disableIncrement || disabled ? theme.colors.disabled : theme.colors.primary}
104
108
  />
105
109
  </Checkbox>
@@ -140,7 +144,11 @@ export const ProductOptionSubOptionUI = (props: any) => {
140
144
  </OText>
141
145
  )}
142
146
  </Container>
143
- {showMessage && <OText size={10} mLeft={4} mRight={4} style={{ flex: 1, textAlign: 'center' }} color={theme.colors.primary}>{`${t('OPTIONS_MAX_LIMIT', 'Maximum options to choose')}: ${option?.max}`}</OText>}
147
+ {showMessage && (
148
+ <OText size={10} mLeft={4} mRight={4} style={{ flex: 1, textAlign: 'center' }} color={theme.colors.primary}>
149
+ {`${t('OPTIONS_MAX_LIMIT', 'Maximum options to choose')}: ${option?.max}`}
150
+ </OText>
151
+ )}
144
152
  </View>
145
153
  )
146
154
  }
@@ -21,7 +21,6 @@ export const QuantityControl = styled.View`
21
21
  margin-horizontal: 5px;
22
22
  flex: 1;
23
23
  width: 60px;
24
-
25
24
  `
26
25
 
27
26
  export const PositionControl = styled.View`