ordering-ui-react-native 0.12.54 → 0.12.58

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 (205) hide show
  1. package/package.json +1 -1
  2. package/src/components/Cart/index.tsx +50 -16
  3. package/src/components/OrderDetails/index.tsx +8 -0
  4. package/src/components/OrderSummary/index.tsx +38 -3
  5. package/src/layouts/Container.tsx +1 -1
  6. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +8 -0
  7. package/themes/business/src/components/OrderDetails/styles.tsx +1 -0
  8. package/themes/business/src/layouts/Container.tsx +3 -1
  9. package/themes/doordash/src/components/Cart/index.tsx +36 -2
  10. package/themes/doordash/src/components/OrderDetails/index.tsx +8 -0
  11. package/themes/doordash/src/components/OrderSummary/index.tsx +36 -3
  12. package/themes/doordash/src/layouts/Container.tsx +1 -1
  13. package/themes/instacart/src/components/Cart/index.tsx +37 -3
  14. package/themes/instacart/src/components/OrderDetails/index.tsx +8 -0
  15. package/themes/instacart/src/components/OrderSummary/index.tsx +37 -4
  16. package/themes/instacart/src/layouts/Container.tsx +1 -1
  17. package/themes/kiosk/src/layouts/Container.tsx +2 -1
  18. package/themes/original/src/components/Cart/index.tsx +268 -234
  19. package/themes/original/src/components/OrderDetails/index.tsx +723 -715
  20. package/themes/original/src/components/OrderSummary/index.tsx +37 -3
  21. package/themes/original/src/layouts/Container.tsx +1 -1
  22. package/themes/single-business/src/components/Cart/index.tsx +92 -16
  23. package/themes/single-business/src/components/Cart/styles.tsx +39 -0
  24. package/themes/single-business/src/components/CartContent/index.tsx +56 -52
  25. package/themes/single-business/src/components/CartContent/styles.tsx +2 -16
  26. package/themes/single-business/src/components/PhoneInputNumber/index.tsx +103 -112
  27. package/themes/single-business/src/components/UserDetails/index.tsx +107 -111
  28. package/themes/single-business/src/components/UserDetails/styles.tsx +3 -8
  29. package/themes/single-business/src/components/UserFormDetails/index.tsx +279 -326
  30. package/themes/single-business/src/components/UserFormDetails/styles.tsx +7 -5
  31. package/themes/single-business/src/layouts/Container.tsx +1 -1
  32. package/themes/uber-eats/src/components/Cart/index.tsx +37 -3
  33. package/themes/uber-eats/src/components/OrderDetails/index.tsx +8 -0
  34. package/themes/uber-eats/src/components/OrderSummary/index.tsx +40 -6
  35. package/themes/uber-eats/src/layouts/Container.tsx +1 -1
  36. package/themes/franchises/index.tsx +0 -111
  37. package/themes/franchises/src/components/ActiveOrders/index.tsx +0 -134
  38. package/themes/franchises/src/components/ActiveOrders/styles.tsx +0 -44
  39. package/themes/franchises/src/components/AddressDetails/index.tsx +0 -77
  40. package/themes/franchises/src/components/AddressDetails/styles.tsx +0 -21
  41. package/themes/franchises/src/components/AddressForm/index.tsx +0 -837
  42. package/themes/franchises/src/components/AddressForm/styles.tsx +0 -27
  43. package/themes/franchises/src/components/AddressList/index.tsx +0 -338
  44. package/themes/franchises/src/components/AddressList/styles.tsx +0 -20
  45. package/themes/franchises/src/components/AppleLogin/index.tsx +0 -149
  46. package/themes/franchises/src/components/AppleLogin/styles.tsx +0 -21
  47. package/themes/franchises/src/components/BottomWrapper/index.tsx +0 -29
  48. package/themes/franchises/src/components/BusinessBasicInformation/index.tsx +0 -310
  49. package/themes/franchises/src/components/BusinessBasicInformation/styles.tsx +0 -66
  50. package/themes/franchises/src/components/BusinessController/index.tsx +0 -184
  51. package/themes/franchises/src/components/BusinessController/styles.tsx +0 -64
  52. package/themes/franchises/src/components/BusinessFeaturedController/index.tsx +0 -189
  53. package/themes/franchises/src/components/BusinessFeaturedController/styles.tsx +0 -50
  54. package/themes/franchises/src/components/BusinessInformation/index.tsx +0 -202
  55. package/themes/franchises/src/components/BusinessInformation/styles.tsx +0 -39
  56. package/themes/franchises/src/components/BusinessItemAccordion/index.tsx +0 -125
  57. package/themes/franchises/src/components/BusinessItemAccordion/styles.tsx +0 -54
  58. package/themes/franchises/src/components/BusinessProductsCategories/index.tsx +0 -87
  59. package/themes/franchises/src/components/BusinessProductsCategories/styles.tsx +0 -8
  60. package/themes/franchises/src/components/BusinessProductsList/index.tsx +0 -199
  61. package/themes/franchises/src/components/BusinessProductsList/styles.tsx +0 -14
  62. package/themes/franchises/src/components/BusinessProductsListing/index.tsx +0 -292
  63. package/themes/franchises/src/components/BusinessProductsListing/styles.tsx +0 -30
  64. package/themes/franchises/src/components/BusinessReviews/index.tsx +0 -249
  65. package/themes/franchises/src/components/BusinessReviews/styles.tsx +0 -59
  66. package/themes/franchises/src/components/BusinessTypeFilter/index.tsx +0 -127
  67. package/themes/franchises/src/components/BusinessTypeFilter/styles.tsx +0 -40
  68. package/themes/franchises/src/components/BusinessesListing/index.tsx +0 -339
  69. package/themes/franchises/src/components/BusinessesListing/styles.tsx +0 -92
  70. package/themes/franchises/src/components/Cart/index.tsx +0 -298
  71. package/themes/franchises/src/components/Cart/styles.tsx +0 -28
  72. package/themes/franchises/src/components/CartContent/index.tsx +0 -60
  73. package/themes/franchises/src/components/CartContent/styles.tsx +0 -19
  74. package/themes/franchises/src/components/Checkout/index.tsx +0 -664
  75. package/themes/franchises/src/components/Checkout/styles.tsx +0 -89
  76. package/themes/franchises/src/components/CouponControl/index.tsx +0 -119
  77. package/themes/franchises/src/components/CouponControl/styles.tsx +0 -22
  78. package/themes/franchises/src/components/DriverTips/index.tsx +0 -167
  79. package/themes/franchises/src/components/DriverTips/styles.tsx +0 -63
  80. package/themes/franchises/src/components/FacebookLogin/index.tsx +0 -107
  81. package/themes/franchises/src/components/FacebookLogin/styles.tsx +0 -21
  82. package/themes/franchises/src/components/FloatingButton/index.tsx +0 -100
  83. package/themes/franchises/src/components/FloatingButton/styles.tsx +0 -26
  84. package/themes/franchises/src/components/ForgotPasswordForm/index.tsx +0 -156
  85. package/themes/franchises/src/components/ForgotPasswordForm/styles.tsx +0 -11
  86. package/themes/franchises/src/components/GPSButton/index.tsx +0 -84
  87. package/themes/franchises/src/components/GPSButton/styles.ts +0 -6
  88. package/themes/franchises/src/components/GoogleLogin/index.tsx +0 -122
  89. package/themes/franchises/src/components/GoogleLogin/styles.tsx +0 -23
  90. package/themes/franchises/src/components/GoogleMap/index.tsx +0 -229
  91. package/themes/franchises/src/components/Help/index.tsx +0 -56
  92. package/themes/franchises/src/components/Help/styles.tsx +0 -11
  93. package/themes/franchises/src/components/HelpAccountAndPayment/index.tsx +0 -68
  94. package/themes/franchises/src/components/HelpAccountAndPayment/styles.tsx +0 -6
  95. package/themes/franchises/src/components/HelpGuide/index.tsx +0 -67
  96. package/themes/franchises/src/components/HelpGuide/styles.tsx +0 -6
  97. package/themes/franchises/src/components/HelpOrder/index.tsx +0 -79
  98. package/themes/franchises/src/components/HelpOrder/styles.tsx +0 -6
  99. package/themes/franchises/src/components/Home/index.tsx +0 -102
  100. package/themes/franchises/src/components/Home/styles.tsx +0 -18
  101. package/themes/franchises/src/components/LanguageSelector/index.tsx +0 -98
  102. package/themes/franchises/src/components/LanguageSelector/styles.tsx +0 -7
  103. package/themes/franchises/src/components/LastOrder/index.tsx +0 -168
  104. package/themes/franchises/src/components/LastOrder/styles.tsx +0 -16
  105. package/themes/franchises/src/components/LastOrders/index.tsx +0 -104
  106. package/themes/franchises/src/components/LastOrders/styles.tsx +0 -17
  107. package/themes/franchises/src/components/LoginForm/index.tsx +0 -512
  108. package/themes/franchises/src/components/LoginForm/styles.tsx +0 -77
  109. package/themes/franchises/src/components/LogoutButton/index.tsx +0 -36
  110. package/themes/franchises/src/components/Messages/index.tsx +0 -359
  111. package/themes/franchises/src/components/Messages/styles.tsx +0 -20
  112. package/themes/franchises/src/components/MomentOption/index.tsx +0 -321
  113. package/themes/franchises/src/components/MomentOption/styles.tsx +0 -66
  114. package/themes/franchises/src/components/NavBar/index.tsx +0 -129
  115. package/themes/franchises/src/components/NotFoundSource/index.tsx +0 -50
  116. package/themes/franchises/src/components/NotFoundSource/styles.tsx +0 -16
  117. package/themes/franchises/src/components/Notifications/index.tsx +0 -120
  118. package/themes/franchises/src/components/Notifications/styles.ts +0 -21
  119. package/themes/franchises/src/components/OrderDetails/index.tsx +0 -820
  120. package/themes/franchises/src/components/OrderDetails/styles.tsx +0 -120
  121. package/themes/franchises/src/components/OrderSummary/index.tsx +0 -232
  122. package/themes/franchises/src/components/OrderSummary/styles.tsx +0 -41
  123. package/themes/franchises/src/components/OrderTypeSelector/index.tsx +0 -92
  124. package/themes/franchises/src/components/OrderTypeSelector/styles.tsx +0 -27
  125. package/themes/franchises/src/components/OrdersOption/index.tsx +0 -243
  126. package/themes/franchises/src/components/OrdersOption/styles.tsx +0 -5
  127. package/themes/franchises/src/components/PaymentOptionCash/index.tsx +0 -102
  128. package/themes/franchises/src/components/PaymentOptionCash/styles.tsx +0 -18
  129. package/themes/franchises/src/components/PaymentOptionStripe/index.tsx +0 -234
  130. package/themes/franchises/src/components/PaymentOptionStripe/styles.tsx +0 -71
  131. package/themes/franchises/src/components/PaymentOptions/index.tsx +0 -430
  132. package/themes/franchises/src/components/PaymentOptions/styles.tsx +0 -77
  133. package/themes/franchises/src/components/PhoneInputNumber/index.tsx +0 -127
  134. package/themes/franchises/src/components/PhoneInputNumber/styles.tsx +0 -3
  135. package/themes/franchises/src/components/PreviousOrders/index.tsx +0 -188
  136. package/themes/franchises/src/components/PreviousOrders/styles.tsx +0 -33
  137. package/themes/franchises/src/components/ProductForm/index.tsx +0 -695
  138. package/themes/franchises/src/components/ProductForm/styles.tsx +0 -78
  139. package/themes/franchises/src/components/ProductIngredient/index.tsx +0 -43
  140. package/themes/franchises/src/components/ProductIngredient/styles.tsx +0 -7
  141. package/themes/franchises/src/components/ProductItemAccordion/index.tsx +0 -276
  142. package/themes/franchises/src/components/ProductItemAccordion/styles.tsx +0 -57
  143. package/themes/franchises/src/components/ProductOption/index.tsx +0 -50
  144. package/themes/franchises/src/components/ProductOption/styles.tsx +0 -11
  145. package/themes/franchises/src/components/ProductOptionSubOption/index.tsx +0 -146
  146. package/themes/franchises/src/components/ProductOptionSubOption/styles.tsx +0 -32
  147. package/themes/franchises/src/components/ReviewDriver/index.tsx +0 -221
  148. package/themes/franchises/src/components/ReviewDriver/styles.tsx +0 -46
  149. package/themes/franchises/src/components/ReviewOrder/index.tsx +0 -325
  150. package/themes/franchises/src/components/ReviewOrder/styles.tsx +0 -46
  151. package/themes/franchises/src/components/ReviewProduct/index.tsx +0 -275
  152. package/themes/franchises/src/components/ReviewProduct/styles.tsx +0 -53
  153. package/themes/franchises/src/components/SearchBar/index.tsx +0 -139
  154. package/themes/franchises/src/components/SignupForm/index.tsx +0 -643
  155. package/themes/franchises/src/components/SignupForm/styles.tsx +0 -27
  156. package/themes/franchises/src/components/SingleProductCard/index.tsx +0 -124
  157. package/themes/franchises/src/components/SingleProductCard/styles.tsx +0 -23
  158. package/themes/franchises/src/components/StripeCardForm/index.tsx +0 -97
  159. package/themes/franchises/src/components/StripeCardForm/naked.tsx +0 -128
  160. package/themes/franchises/src/components/StripeCardForm/styles.tsx +0 -32
  161. package/themes/franchises/src/components/StripeCardsList/index.tsx +0 -182
  162. package/themes/franchises/src/components/StripeElementsForm/index.tsx +0 -204
  163. package/themes/franchises/src/components/StripeElementsForm/naked.tsx +0 -90
  164. package/themes/franchises/src/components/StripeElementsForm/styles.tsx +0 -13
  165. package/themes/franchises/src/components/StripeRedirectForm/index.tsx +0 -159
  166. package/themes/franchises/src/components/StripeRedirectForm/styles.tsx +0 -23
  167. package/themes/franchises/src/components/TagSelector/index.tsx +0 -94
  168. package/themes/franchises/src/components/TagSelector/styles.ts +0 -0
  169. package/themes/franchises/src/components/TaxInformation/index.tsx +0 -51
  170. package/themes/franchises/src/components/TaxInformation/styles.tsx +0 -9
  171. package/themes/franchises/src/components/UpsellingProducts/index.tsx +0 -222
  172. package/themes/franchises/src/components/UpsellingProducts/styles.tsx +0 -50
  173. package/themes/franchises/src/components/UserDetails/index.tsx +0 -134
  174. package/themes/franchises/src/components/UserDetails/styles.tsx +0 -26
  175. package/themes/franchises/src/components/UserFormDetails/index.tsx +0 -351
  176. package/themes/franchises/src/components/UserFormDetails/styles.tsx +0 -35
  177. package/themes/franchises/src/components/UserProfile/index.tsx +0 -179
  178. package/themes/franchises/src/components/UserProfile/styles.ts +0 -42
  179. package/themes/franchises/src/components/UserProfileForm/index.tsx +0 -253
  180. package/themes/franchises/src/components/UserProfileForm/styles.tsx +0 -29
  181. package/themes/franchises/src/components/VerifyPhone/index.tsx +0 -188
  182. package/themes/franchises/src/components/VerifyPhone/styles.tsx +0 -43
  183. package/themes/franchises/src/components/shared/OAlert.tsx +0 -55
  184. package/themes/franchises/src/components/shared/OBottomPopup.tsx +0 -73
  185. package/themes/franchises/src/components/shared/OBottomStickBar.tsx +0 -62
  186. package/themes/franchises/src/components/shared/OButton.tsx +0 -132
  187. package/themes/franchises/src/components/shared/ODropDown.tsx +0 -169
  188. package/themes/franchises/src/components/shared/OIcon.tsx +0 -53
  189. package/themes/franchises/src/components/shared/OIconButton.tsx +0 -127
  190. package/themes/franchises/src/components/shared/OIconText.tsx +0 -54
  191. package/themes/franchises/src/components/shared/OInput.tsx +0 -113
  192. package/themes/franchises/src/components/shared/OKeyButton.tsx +0 -35
  193. package/themes/franchises/src/components/shared/OModal.tsx +0 -172
  194. package/themes/franchises/src/components/shared/OText.tsx +0 -52
  195. package/themes/franchises/src/components/shared/OTextarea.tsx +0 -36
  196. package/themes/franchises/src/components/shared/OToast.tsx +0 -93
  197. package/themes/franchises/src/components/shared/OToggle.tsx +0 -158
  198. package/themes/franchises/src/components/shared/index.tsx +0 -29
  199. package/themes/franchises/src/config/constants.tsx +0 -57
  200. package/themes/franchises/src/layouts/Container.tsx +0 -23
  201. package/themes/franchises/src/layouts/SafeAreaContainer.tsx +0 -6
  202. package/themes/franchises/src/providers/AlertProvider.tsx +0 -43
  203. package/themes/franchises/src/providers/StoreUtil.tsx +0 -50
  204. package/themes/franchises/src/types/index.tsx +0 -445
  205. package/themes/franchises/src/utils/index.tsx +0 -222
@@ -1,310 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { StyleSheet, View, TouchableOpacity, Platform } from 'react-native';
3
- import { useUtils, useOrder, useLanguage, useSession, useConfig } from 'ordering-components/native';
4
- import { useTheme } from 'styled-components/native';
5
- import { OIcon, OText, OModal } from '../shared';
6
- import { BusinessBasicInformationParams } from '../../types';
7
- import { convertHoursToMinutes, getTypesText } from '../../utils';
8
- import { BusinessInformation } from '../BusinessInformation';
9
- import { BusinessReviews } from '../BusinessReviews';
10
- import {
11
- BusinessContainer,
12
- BusinessHeader,
13
- BusinessLogo,
14
- BusinessInfo,
15
- BusinessInfoItem,
16
- WrapReviews,
17
- WrapBusinessInfo,
18
- AddressInput,
19
- OrderControlContainer,
20
- DropOptionButton,
21
- } from './styles';
22
- import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
23
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
24
-
25
- const types = ['food', 'laundry', 'alcohol', 'groceries'];
26
-
27
- export const BusinessBasicInformation = (
28
- props: BusinessBasicInformationParams,
29
- ) => {
30
- const { navigation, businessState, isBusinessInfoShow, logo, header, isMini } = props;
31
- const { business, loading } = businessState;
32
-
33
- const theme = useTheme();
34
- const [orderState] = useOrder();
35
- const [{ auth }] = useSession()
36
- const [{ configs }] = useConfig();
37
- const [, t] = useLanguage();
38
- const [{ parsePrice, parseDistance, optimizeImage, parseDate }] = useUtils();
39
- const [openBusinessInformation, setOpenBusinessInformation] = useState(false);
40
- const [openBusinessReviews, setOpenBusinessReviews] = useState(false);
41
- const { top, bottom } = useSafeAreaInsets()
42
-
43
- const configTypes = configs?.order_types_allowed?.value.split('|').map((value: any) => Number(value)) || [];
44
-
45
- const getBusinessType = () => {
46
- if (Object.keys(business).length <= 0) return t('GENERAL', 'General');
47
- const _types: any = [];
48
- types.forEach(
49
- (type) =>
50
- business[type] &&
51
- _types.push(
52
- t(`BUSINESS_TYPE_${type?.replace(/\s/g, '_')?.toUpperCase()}`, type),
53
- ),
54
- );
55
- return _types.join(', ');
56
- };
57
-
58
- return (
59
- <BusinessContainer>
60
- {!isMini &&
61
- <BusinessHeader
62
- style={
63
- isBusinessInfoShow
64
- ? {...styles.businesInfoheaderStyle, paddingTop: top}
65
- : { ...styles.headerStyle, paddingTop: top, backgroundColor: theme.colors.backgroundGray }
66
- }
67
- source={{
68
- uri:
69
- header ||
70
- optimizeImage(businessState?.business?.header, 'h_400,c_limit'),
71
- }}>
72
- {!loading &&
73
- <React.Fragment>
74
- <AddressInput
75
- onPress={() => auth
76
- ? navigation.navigate('AddressList', { isGoBack: true, isFromProductsList: true })
77
- : navigation.navigate('AddressForm', { address: orderState.options?.address })}
78
- style={{marginTop: !auth ? 36 : top > 0 ? 0 : 20}}
79
- activeOpacity={0.8}
80
- >
81
- <OIcon src={theme.images.general.pin} width={16} color={theme.colors.textSecondary} />
82
- <OText color={theme.colors.textPrimary} numberOfLines={1} lineHeight={20} weight={Platform.OS === 'android' ? 'bold' : '600'} style={{paddingStart: 10, flexBasis: '90%'}}>
83
- {orderState?.options?.address?.address}
84
- </OText>
85
- </AddressInput>
86
- <OrderControlContainer>
87
- <View style={styles.wrapperOrderOptions}>
88
- <DropOptionButton activeOpacity={0.7} onPress={() => navigation.navigate('OrderTypes', { configTypes: configTypes })}>
89
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textSecondary}>{t(getTypesText(orderState?.options?.type || 1), 'Delivery')}</OText>
90
- <OIcon
91
- src={theme.images.general.arrow_down}
92
- width={10}
93
- style={{ marginStart: 8 }}
94
- />
95
- </DropOptionButton>
96
- <DropOptionButton
97
- onPress={() => navigation.navigate('MomentOption')}>
98
- <OText
99
- size={12}
100
- numberOfLines={1}
101
- ellipsizeMode="tail"
102
- color={theme.colors.textSecondary}>
103
- {orderState.options?.moment
104
- ? parseDate(orderState.options?.moment, {
105
- outputFormat:
106
- configs?.format_time?.value === '12'
107
- ? 'MM/DD hh:mma'
108
- : 'MM/DD HH:mm',
109
- })
110
- : t('ASAP_ABBREVIATION', 'ASAP')}
111
- </OText>
112
- <OIcon
113
- src={theme.images.general.arrow_down}
114
- width={10}
115
- style={{ marginStart: 8 }}
116
- />
117
- </DropOptionButton>
118
- </View>
119
- </OrderControlContainer>
120
- </React.Fragment>
121
- }
122
- </BusinessHeader>
123
- }
124
- <BusinessInfo style={styles.businessInfo}>
125
- {!isMini &&
126
- <BusinessLogo>
127
- {loading ? (
128
- <View>
129
- <Placeholder Animation={Fade}>
130
- <PlaceholderLine height={50} width={20} />
131
- </Placeholder>
132
- </View>
133
- ) : (
134
- !isBusinessInfoShow && (
135
- <OIcon
136
- url={
137
- logo ||
138
- optimizeImage(businessState?.business?.logo, 'h_300,c_limit')
139
- }
140
- style={styles.businessLogo}
141
- />
142
- )
143
- )}
144
- </BusinessLogo>
145
- }
146
- <BusinessInfoItem>
147
- {loading ? (
148
- <Placeholder Animation={Fade}>
149
- <PlaceholderLine height={30} width={20} />
150
- </Placeholder>
151
- ) : (
152
- <>
153
- <OText size={24} weight={'bold'}>
154
- {business?.name}
155
- </OText>
156
- {!isBusinessInfoShow && (
157
- <WrapBusinessInfo onPress={() => setOpenBusinessInformation(true)}>
158
- <OIcon src={theme.images.general.info} width={16} color={theme.colors.primary} />
159
- </WrapBusinessInfo>
160
- )}
161
- </>
162
- )}
163
- </BusinessInfoItem>
164
- {loading ? (
165
- <Placeholder Animation={Fade}>
166
- <PlaceholderLine width={10} />
167
- </Placeholder>
168
- ) : (
169
- <View style={{marginVertical: 5}}>
170
- {/* <OText color={theme.colors.textNormal}>{getBusinessType()}</OText> */}
171
- <OText size={12} lineHeight={18}>{business?.address}</OText>
172
- </View>
173
- )}
174
- <View>
175
- <BusinessInfoItem>
176
- {loading && (
177
- <Placeholder Animation={Fade}>
178
- <View style={{ flexDirection: 'row' }}>
179
- <PlaceholderLine width={13} style={{ marginRight: 10 }} />
180
- <PlaceholderLine width={13} style={{ marginRight: 10 }} />
181
- <PlaceholderLine width={13} style={{ marginRight: 10 }} />
182
- <PlaceholderLine width={13} />
183
- </View>
184
- </Placeholder>
185
- )}
186
- <View style={styles.bullet}>
187
- <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
188
- {`${t('DELIVERY_FEE', 'Delivery fee')} ${business && parsePrice(business?.delivery_price || 0)} \u2022 `}
189
- </OText>
190
- {orderState?.options?.type === 1 ? (
191
- <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
192
- {convertHoursToMinutes(business?.delivery_time) + ` \u2022 `}
193
- </OText>
194
- ) : (
195
- <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
196
- {convertHoursToMinutes(business?.pickup_time) + ` \u2022 `}
197
- </OText>
198
- )}
199
- <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
200
- {parseDistance(business?.distance || 0) + ` \u2022 `}
201
- </OText>
202
- </View>
203
-
204
- <View style={styles.reviewStyle}>
205
- <OIcon
206
- src={theme.images.general.star}
207
- width={14}
208
- color={theme.colors.textSecondary}
209
- style={{ marginTop: -2, marginEnd: 2 }}
210
- />
211
- <OText size={12} color={theme.colors.textSecondary}>
212
- {business?.reviews?.total}
213
- </OText>
214
- </View>
215
- </BusinessInfoItem>
216
- </View>
217
- <WrapReviews>
218
- {!isBusinessInfoShow && (
219
- <>
220
- <TouchableOpacity onPress={() => navigation.navigate('MomentOption')}>
221
- <OText color={theme.colors.primary} style={{ textDecorationLine: 'underline' }}>
222
- {t('PRE_ORDER', 'Preorder')}
223
- </OText>
224
- </TouchableOpacity>
225
- <OText size={12} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
226
- <TouchableOpacity onPress={() => setOpenBusinessReviews(true)}>
227
- <OText color={theme.colors.primary} style={{ textDecorationLine: 'underline' }}>
228
- {t('REVIEWS', 'Reviews')}
229
- </OText>
230
- </TouchableOpacity>
231
- </>
232
- )}
233
- </WrapReviews>
234
- </BusinessInfo>
235
- <OModal
236
- titleSectionStyle={styles.modalTitleSectionStyle}
237
- open={openBusinessInformation}
238
- onClose={() => setOpenBusinessInformation(false)}
239
- isNotDecoration>
240
- <BusinessInformation
241
- businessState={businessState}
242
- business={business}
243
- />
244
- </OModal>
245
- <OModal
246
- entireModal
247
- titleSectionStyle={styles.modalTitleSectionStyle}
248
- open={openBusinessReviews}
249
- onClose={() => setOpenBusinessReviews(false)}
250
- isNotDecoration>
251
- <BusinessReviews
252
- businessState={businessState}
253
- businessId={business.id}
254
- reviews={business.reviews?.reviews}
255
- />
256
- </OModal>
257
- </BusinessContainer>
258
- );
259
- };
260
-
261
- const styles = StyleSheet.create({
262
- businesInfoheaderStyle: {
263
- height: 150,
264
- paddingHorizontal: 40
265
- },
266
- headerStyle: {
267
- height: 260,
268
- paddingHorizontal: 40
269
- },
270
- businessLogo: {
271
- width: 72,
272
- height: 72,
273
- borderRadius: 7.6,
274
- justifyContent: 'flex-start',
275
- alignItems: 'flex-start',
276
- },
277
- businessInfo: {
278
- paddingHorizontal: 40,
279
- paddingTop: 46,
280
- },
281
- bullet: {
282
- flexDirection: 'row',
283
- alignItems: 'center',
284
- },
285
- metadata: {
286
- marginRight: 2,
287
- },
288
- starIcon: {
289
- marginHorizontal: 5,
290
- },
291
- reviewStyle: {
292
- flexDirection: 'row',
293
- alignItems: 'center',
294
- justifyContent: 'center'
295
- },
296
- modalTitleSectionStyle: {
297
- position: 'absolute',
298
- width: '100%',
299
- top: 0,
300
- zIndex: 100,
301
- left: 40
302
- },
303
- wrapperOrderOptions: {
304
- width: '100%',
305
- flexDirection: 'row',
306
- justifyContent: 'flex-start',
307
- marginBottom: 10,
308
- zIndex: 100,
309
- },
310
- });
@@ -1,66 +0,0 @@
1
- import styled from 'styled-components/native';
2
-
3
- export const BusinessContainer = styled.View`
4
- flex-direction: column;
5
- `;
6
- export const BusinessHeader = styled.ImageBackground`
7
- width: 100%;
8
- position: relative;
9
- max-height: 258px;
10
- height: 258px;
11
- resize-mode: cover;
12
- `;
13
- export const BusinessLogo = styled.View`
14
- position: absolute;
15
- start: 40px;
16
- top: -36px;
17
- z-index: 50;
18
- box-shadow: 0 0 2px #0000001A;
19
- `;
20
- export const BusinessInfo = styled.View`
21
- justify-content: flex-start;
22
- align-items: flex-start;
23
- background-color: ${(props: any) => props.theme.colors.backgroundPage};
24
- `;
25
- export const BusinessInfoItem = styled.View`
26
- flex-direction: row;
27
- align-items: center;
28
- `;
29
- export const WrapReviews = styled.View`
30
- flex-direction: row;
31
- align-items: center;
32
- justify-content: flex-start;
33
- margin-top: 20px;
34
- `;
35
- export const WrapBusinessInfo = styled.TouchableOpacity`
36
- padding: 0 7px;
37
- `;
38
- export const AddressInput = styled.TouchableOpacity`
39
- flex-direction: row;
40
- align-items: center;
41
- justify-content: flex-start;
42
- background-color: white;
43
- padding-horizontal: 15px;
44
- border-radius: 24px;
45
- height: 44px;
46
- min-height: 44px;
47
- `
48
- export const OrderControlContainer = styled.View`
49
- width: 100%;
50
- z-index: 10;
51
- padding-top: 9px;
52
- flex: 1;
53
- `
54
-
55
- export const DropOptionButton = styled.TouchableOpacity`
56
- background-color: ${(props: any) => props.theme.colors.backgroundGray100};
57
- border-radius: 7.6px;
58
- font-size: 12px;
59
- max-width: 240px;
60
- height: 26px;
61
- align-items: center;
62
- justify-content: center;
63
- padding-horizontal: 8px;
64
- flex-direction: row;
65
- margin-end: 12px;
66
- `
@@ -1,184 +0,0 @@
1
- import React from 'react';
2
- import {
3
- BusinessController as BusinessSingleCard,
4
- useUtils,
5
- useOrder,
6
- useLanguage,
7
- } from 'ordering-components/native';
8
- import { OButton, OIcon, OText } from '../shared';
9
- import { StyleSheet, View } from 'react-native';
10
- import { BusinessControllerParams } from '../../types';
11
- import { convertHoursToMinutes } from '../../utils';
12
- import {
13
- Card,
14
- BusinessHero,
15
- BusinessContent,
16
- BusinessCategory,
17
- BusinessInfo,
18
- Metadata,
19
- BusinessState,
20
- BusinessLogo,
21
- Reviews,
22
- BusinessInfoInner,
23
- LikeBtn,
24
- PreOrderBtn,
25
- } from './styles';
26
- import { useTheme } from 'styled-components/native';
27
-
28
- export const BusinessControllerUI = (props: BusinessControllerParams) => {
29
- const { business, handleClick } = props;
30
- const [{ parsePrice, parseDistance, parseNumber, optimizeImage }] =
31
- useUtils();
32
- const [orderState] = useOrder();
33
- const [, t] = useLanguage();
34
- const theme = useTheme()
35
-
36
- const styles = StyleSheet.create({
37
- headerStyle: {
38
- borderTopLeftRadius: 7.6,
39
- borderTopRightRadius: 7.6,
40
- },
41
- businessLogo: {
42
- backgroundColor: 'white',
43
- width: 62,
44
- height: 62,
45
- borderRadius: 7.6,
46
- justifyContent: 'center',
47
- alignItems: 'center',
48
- marginTop: -32,
49
- shadowColor: '#000000',
50
- shadowOffset: { width: 0, height: 1 },
51
- shadowOpacity: 0.1,
52
- shadowRadius: 1
53
- },
54
- businessStateView: {
55
- backgroundColor: '#DEE2E6',
56
- borderRadius: 50,
57
- height: 20,
58
- alignItems: 'center',
59
- justifyContent: 'center',
60
- paddingHorizontal: 8,
61
- },
62
- businessStateText: {
63
- textAlign: 'center',
64
- },
65
-
66
- starIcon: {
67
- marginHorizontal: 2,
68
- marginTop: -2,
69
- },
70
- featured: {
71
- position: 'absolute',
72
- padding: 8,
73
- backgroundColor: theme.colors.backgroundDark,
74
- opacity: 0.8,
75
- borderRadius: 10,
76
- left: 20,
77
- top: 10,
78
- },
79
- closed: {
80
- },
81
- bullet: {
82
- flexDirection: 'row',
83
- alignItems: 'center',
84
- justifyContent: 'flex-start',
85
- },
86
- startBtn: {
87
- height: 26,
88
- borderRadius: 7.6,
89
- backgroundColor: theme.colors.clear,
90
- borderWidth: 1,
91
- shadowOpacity: 0,
92
- paddingLeft: 0,
93
- paddingRight: 0,
94
- borderColor: theme.colors.primary,
95
- marginTop: 4
96
- }
97
- });
98
-
99
- const types = ['food', 'laundry', 'alcohol', 'groceries'];
100
-
101
- const getBusinessType = () => {
102
- if (Object.keys(business).length <= 0) return t('GENERAL', 'General');
103
- const _types: any = [];
104
- types.forEach((type) => {
105
- if (business[type]) {
106
- _types.push(t(type.toUpperCase(), type));
107
- }
108
- });
109
- return _types.join(', ');
110
- };
111
-
112
- const getOrderTypes = () => {
113
- return `Eat In | Drive Thru | Delivery | Curbside | Pickup`;
114
- }
115
-
116
- return (
117
- <Card activeOpacity={1} onPress={() => handleClick(business)}>
118
- <BusinessContent>
119
- <BusinessInfo>
120
- <BusinessInfoInner>
121
- <OText size={12} lineHeight={18} weight={'bold'} mBottom={5}>
122
- {business?.name}
123
- </OText>
124
- <OText size={10} lineHeight={15} color={theme.colors.textThird} mBottom={4}>
125
- {business?.address}
126
- </OText>
127
- <BusinessCategory>
128
- <OText size={8} lineHeight={12} color={theme.colors.textSecondary}>{getOrderTypes()}</OText>
129
- </BusinessCategory>
130
- </BusinessInfoInner>
131
- <View style={{alignItems: 'flex-end'}}>
132
- {business?.reviews?.total >= 0 && (
133
- <Reviews>
134
- <OIcon src={theme.images.general.star} width={12} style={styles.starIcon} color={theme.colors.textSecondary} />
135
- <OText size={12} style={{ lineHeight: 15 }}>
136
- {parseNumber(business?.reviews?.total, { separator: '.' })}
137
- </OText>
138
- <LikeBtn>
139
- <OIcon src={theme.images.general.heart} width={14} />
140
- </LikeBtn>
141
- </Reviews>
142
- )}
143
- <OButton
144
- onClick={() => handleClick(business)}
145
- text={t('START_ORDER', 'Start order')}
146
- style={styles.startBtn}
147
- textStyle={{fontSize: 12, color: theme.colors.primary}}
148
- />
149
- </View>
150
- </BusinessInfo>
151
-
152
- <Metadata>
153
- <PreOrderBtn onPress={() => handleClick(business)}>
154
- <OText
155
- color={theme.colors.primary}
156
- size={10} lineHeight={15}>
157
- {t('PRE_ORDER', 'Preorder')}
158
- </OText>
159
- </PreOrderBtn>
160
- {!business?.open ? (
161
- <View style={styles.closed}>
162
- <OText size={10} color={theme.colors.red}>
163
- {t('CLOSED', 'Closed')}
164
- </OText>
165
- </View>
166
- ) : (
167
- <View style={styles.bullet}>
168
-
169
- </View>
170
- )}
171
- </Metadata>
172
- </BusinessContent>
173
- </Card>
174
- );
175
- };
176
-
177
- export const BusinessController = (props: BusinessControllerParams) => {
178
- const BusinessControllerProps = {
179
- ...props,
180
- UIComponent: BusinessControllerUI,
181
- };
182
-
183
- return <BusinessSingleCard {...BusinessControllerProps} />;
184
- };
@@ -1,64 +0,0 @@
1
- import styled, { css } from 'styled-components/native';
2
-
3
- export const Card = styled.TouchableOpacity`
4
- margin-vertical: 20px;
5
- border-radius: 7.6px;
6
- flex: 1;
7
- width: 100%;
8
- `;
9
-
10
- export const BusinessHero = styled.ImageBackground`
11
- height: 122px;
12
- resize-mode: cover;
13
- border-radius: 7.6px;
14
- flex-direction: row;
15
- position: relative;
16
- `;
17
-
18
- export const BusinessContent = styled.View`
19
- overflow: visible;
20
- `;
21
-
22
- export const BusinessInfo = styled.View`
23
- flex-direction: row;
24
- justify-content: space-between;
25
- align-items: flex-start;
26
- width: 100%;
27
- margin-bottom: 9px;
28
- flex-shrink: 1;
29
- `;
30
-
31
- export const BusinessInfoInner = styled.View`
32
- flex: 1;
33
- `
34
-
35
- export const BusinessCategory = styled.View`
36
- `;
37
-
38
- export const Metadata = styled.View`
39
- flex-direction: row;
40
- `;
41
-
42
- export const BusinessState = styled.View`
43
- position: absolute;
44
- top: 13px;
45
- end: 18px;
46
- `
47
-
48
- export const BusinessLogo = styled.View`
49
-
50
- `
51
-
52
- export const Reviews = styled.View`
53
- flex-direction: row;
54
- align-items: center;
55
- `
56
-
57
- export const LikeBtn = styled.TouchableOpacity`
58
- padding-horizontal: 4px;
59
- margin-end: -4px;
60
- `;
61
-
62
- export const PreOrderBtn = styled.TouchableOpacity`
63
- margin-end: 12px;
64
- `;