ordering-ui-react-native 0.16.63 → 0.16.64

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.16.63",
3
+ "version": "0.16.64",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -46,7 +46,7 @@ export const BusinessBasicInformation = (
46
46
  const [openBusinessReviews, setOpenBusinessReviews] = useState(false);
47
47
  const [businessInformationObtained, setBusinessInformationObtained] = useState(false)
48
48
  const [businessReviewsObtained, setBusinessReviewsObtainedbtained] = useState(false)
49
- const isChewLayout = theme?.layouts?.business_view?.components?.header?.components?.layout?.type === 'chew'
49
+ const isChewLayout = orderingTheme?.theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
50
50
  const showLogo = !orderingTheme?.theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
51
51
 
52
52
  const styles = StyleSheet.create({
@@ -75,9 +75,9 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
75
75
  const [{ configs }] = useConfig()
76
76
  const isPreOrder = configs?.preorder_status_enabled?.value === '1'
77
77
 
78
- const isChewLayout = theme?.layouts?.business_view?.components?.header?.components?.layout?.type === 'chew'
78
+ const isChewLayout = orderingTheme?.theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
79
79
  const showLogo = !orderingTheme?.theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
80
- const showBusinessNearCity = !theme?.layouts?.business_view?.components?.near_business?.hidden
80
+ const hideBusinessNearCity = orderingTheme?.theme?.business_view?.components?.near_business?.hidden
81
81
 
82
82
  const styles = StyleSheet.create({
83
83
  mainContainer: {
@@ -277,7 +277,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
277
277
  </WrapSearchBar>
278
278
  )}
279
279
  </TopHeader>
280
- {showBusinessNearCity && businessState?.business?.city_id && (
280
+ {!hideBusinessNearCity && businessState?.business?.city_id && (
281
281
  <NearBusiness>
282
282
  <BusinessesListing
283
283
  logosLayout
@@ -80,8 +80,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
80
80
  const appState = useRef(AppState.currentState)
81
81
  const searchBarRef = useRef<any>()
82
82
  const [appStateVisible, setAppStateVisible] = useState(appState.current);
83
- const isChewLayout = theme?.layouts?.header?.components?.layout?.type === 'chew'
84
- const showCities = !orderingTheme?.theme?.business_listing_view?.components?.cities?.hidden
83
+ const isChewLayout = orderingTheme?.theme?.header?.components?.layout?.type === 'chew'
84
+ const hideCities = orderingTheme?.theme?.business_listing_view?.components?.cities?.hidden
85
85
  const [refreshing] = useState(false);
86
86
  const styles = StyleSheet.create({
87
87
  container: {
@@ -216,7 +216,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
216
216
  }
217
217
  }
218
218
 
219
- const handleChangeCity = (cityId : number | null) => {
219
+ const handleChangeCity = (cityId: number | null) => {
220
220
  changeCityFilter(orderState?.options?.city_id === cityId ? null : cityId)
221
221
  setIsOpenCities(false)
222
222
  }
@@ -485,7 +485,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
485
485
  />
486
486
  )}
487
487
 
488
- {showCities && (
488
+ {!hideCities && (
489
489
  <View style={{ marginTop: 10 }}>
490
490
  <OButton
491
491
  onClick={() => setIsOpenCities(true)}
@@ -1,6 +1,6 @@
1
1
 
2
2
  import React, { useState, useEffect } from 'react'
3
- import { useOrder, useSession, useLanguage } from 'ordering-components/native';
3
+ import { useOrder, useSession, useLanguage, useOrderingTheme } from 'ordering-components/native';
4
4
 
5
5
  import { useTheme } from 'styled-components/native'
6
6
  import { BusinessesListing as OriginalBusinessListing } from './Layout/Original'
@@ -11,7 +11,8 @@ import { ReviewTrigger } from '../ReviewTrigger';
11
11
  export const BusinessesListing = (props: any) => {
12
12
  const { logosLayout } = props
13
13
  const theme = useTheme()
14
- const layout = theme?.layouts?.business_listing_view?.components?.layout?.type || 'original'
14
+ const [orderingTheme] = useOrderingTheme()
15
+ const layout = orderingTheme?.theme?.business_listing_view?.components?.layout?.type || 'original'
15
16
  const [, t] = useLanguage();
16
17
  const [{ auth }] = useSession()
17
18
  const [, { getLastOrderHasNoReview }] = useOrder();
@@ -96,4 +97,4 @@ export const BusinessesListing = (props: any) => {
96
97
  )}
97
98
  </>
98
99
  )
99
- }
100
+ }
@@ -1093,6 +1093,7 @@ export const ProductOptionsUI = (props: any) => {
1093
1093
  export const ProductForm = (props: any) => {
1094
1094
  const productOptionsProps = {
1095
1095
  ...props,
1096
+ productCart: { quantity: props?.product?.minimum_per_order || 1 },
1096
1097
  UIComponent: ProductOptionsUI,
1097
1098
  };
1098
1099
 
@@ -5,6 +5,7 @@ import {
5
5
  useOrder,
6
6
  useUtils,
7
7
  useSession,
8
+ useOrderingTheme,
8
9
  SingleProductCard as SingleProductCardController
9
10
  } from 'ordering-components/native';
10
11
  import { useTheme } from 'styled-components/native';
@@ -39,7 +40,8 @@ const SinguleProductCardUI = React.memo((props: SingleProductCardParams) => {
39
40
  } = props;
40
41
 
41
42
  const theme = useTheme();
42
- const showAddButton = !theme?.layouts?.business_view?.components?.products?.components?.add_to_cart_button?.hidden
43
+ const [orderingTheme] = useOrderingTheme()
44
+ const hideAddButton = orderingTheme?.theme?.business_view?.components?.products?.components?.add_to_cart_button?.hidden
43
45
 
44
46
  const styles = StyleSheet.create({
45
47
  container: {
@@ -132,7 +134,7 @@ const SinguleProductCardUI = React.memo((props: SingleProductCardParams) => {
132
134
  <InView style={{ minHeight: 200 }} triggerOnce={true} onChange={(inView: boolean) => setIsIntersectionObserver(true)}>
133
135
  {isIntersectionObserver ? (
134
136
  <CardContainer
135
- showAddButton={showAddButton}
137
+ showAddButton={!hideAddButton}
136
138
  style={[
137
139
  styles.container,
138
140
  (isSoldOut || maxProductQuantity <= 0) && styles.soldOutBackgroundStyle,
@@ -231,7 +233,7 @@ const SinguleProductCardUI = React.memo((props: SingleProductCardParams) => {
231
233
  </SoldOut>
232
234
  )}
233
235
  </View>
234
- {showAddButton && (
236
+ {!hideAddButton && (
235
237
  <OButton
236
238
  onClick={() => onProductClick?.(product)}
237
239
  style={{