ordering-ui-react-native 0.15.9 → 0.15.10

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.9",
3
+ "version": "0.15.10",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -47,6 +47,8 @@ const MomentOptionUI = (props: MomentOptionParams) => {
47
47
  const [optionSelected, setOptionSelected] = useState({ isAsap: false, isSchedule: false })
48
48
  const [momentState, setMomentState] = useState({ isLoading: 0, isEditing: false })
49
49
 
50
+ const is12hours = configs?.dates_moment_format?.value?.includes('hh:mm')
51
+
50
52
  const goToBack = () => navigation?.canGoBack() && navigation.goBack()
51
53
 
52
54
  const _handleAsap = () => {
@@ -192,7 +194,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
192
194
  disabled={orderState.loading}
193
195
  >
194
196
  <OText color={timeSelected === hour.startTime ? theme.colors.primary : theme.colors.textSecondary}>
195
- {configs?.format_time?.value === '12' ? (
197
+ {is12hours ? (
196
198
  hour.startTime.includes('12')
197
199
  ? `${hour.startTime}PM`
198
200
  : parseTime(moment(hour.startTime, 'HH:mm'), { outputFormat: 'hh:mma' })
@@ -32,7 +32,8 @@ export const getTraduction = (key: string, t: any) => {
32
32
  ERROR_PLACE_PAY_WITH_CARD1: 'An error occurred while trying to pay by card',
33
33
  ERROR_PLACE_PAY_WITH_PAYPAL_CAPTURE: 'An error occurred while trying to pay by PayPal',
34
34
  ERROR_ADD_PRODUCT_VERY_FAR_FOR_DELIVERY: 'Error adding product, very far for delivery',
35
- ERROR_PRODUCT_NOT_FOUND: 'Error with the product'
35
+ ERROR_PRODUCT_NOT_FOUND: 'Error with the product',
36
+ ERROR_ADD_BUSINESS_INVALID: 'An error occurred with the business',
36
37
  }
37
38
 
38
39
  return keyList[key] ? t(key, keyList[key]) : t(key)
@@ -38,7 +38,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
38
38
  },
39
39
  });
40
40
 
41
- const _categories: any = business?.original?.categories;
41
+ const _categories: any = business?.categories;
42
42
  let _promos: any = [];
43
43
  _categories?.forEach((categ: any) => {
44
44
  const _featuredProds = categ?.products?.filter(
@@ -183,8 +183,8 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
183
183
  resetInactivityTimeout()
184
184
  navigation.navigate('Category', {
185
185
  category,
186
- categories: business.original.categories,
187
- businessId: business?.api?.businessId,
186
+ categories: business?.categories,
187
+ businessId: business?.id,
188
188
  businessSlug: business?.slug,
189
189
  clearInactivityTimeout,
190
190
  resetInactivityTimeout,
@@ -212,6 +212,7 @@ const CategoriesMenu = (props: any): React.ReactElement => {
212
212
  businessId={parseInt(businessId, 10)}
213
213
  businessSlug={businessSlug}
214
214
  onSave={() => {
215
+ showCartBottomSheet()
215
216
  setDrawerValues({ isOpen: !drawerState.isOpen, data: null })
216
217
  }}
217
218
  navigation={navigation}
@@ -87,7 +87,6 @@ export const ProductOptionsUI = (props: any) => {
87
87
  const isErrors = Object.values(errors).length > 0
88
88
  if (!isErrors) {
89
89
  handleSave && handleSave()
90
- showCartBottomSheet()
91
90
  return
92
91
  }
93
92
  }
@@ -58,9 +58,9 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
58
58
  const maxDistanceOptions = [1000, 2000, 5000, 'default']
59
59
  const maxTimeOptions = [5, 15, 30, 'default']
60
60
  const sortItems = [
61
- { text: t('PICKED_FOR_YOU', 'Picked for you (default)'), value: 'default' },
61
+ { text: t('PICKED_FOR_YOU', 'Picked for you (default)'), value: 'distance' },
62
62
  { text: t('DELIVERY_TIME', 'Delivery time'), value: 'delivery_time' },
63
- { text: t('PICKUP_TIME', 'Pickup time'), value: 'pickup_type' }
63
+ { text: t('PICKUP_TIME', 'Pickup time'), value: 'pickup_time' }
64
64
  ]
65
65
 
66
66
  const styles = StyleSheet.create({
@@ -396,7 +396,7 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
396
396
  <OText weight='bold' mBottom={7} size={16}>
397
397
  {t('SORT', 'Sort')}
398
398
  </OText>
399
- {sortItems?.map(item => (
399
+ {sortItems?.filter(item => !(orderState?.options?.type === 1 && item?.value === 'pickup_time') && !(orderState?.options?.type === 2 && item?.value === 'delivery_time'))?.map(item => (
400
400
  <TouchableOpacity
401
401
  key={item?.value}
402
402
  onPress={() => handleChangeFilters('orderBy', item?.value)}