ordering-ui-react-native 0.16.84 → 0.16.85

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.84",
3
+ "version": "0.16.85",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -223,16 +223,14 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
223
223
  return (
224
224
  <BContainer>
225
225
  <SearchWrapper>
226
- {isFocused && (
227
- <SearchBar
228
- lazyLoad
229
- inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
230
- placeholder={`${t('SEARCH_BUSINESSES', 'Search Businesses')} / ${t('TYPE_AT_LEAST_3_CHARACTERS', 'type at least 3 characters')}`}
231
- onSearch={(val: string) => handleChangeTermValue(val)}
232
- value={termValue}
233
- iconCustomRight={<AntDesignIcon name='filter' size={16} style={{ bottom: 2 }} onPress={() => handleOpenfilters()} />}
234
- />
235
- )}
226
+ <SearchBar
227
+ lazyLoad
228
+ inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
229
+ placeholder={`${t('SEARCH_BUSINESSES', 'Search Businesses')} / ${t('TYPE_AT_LEAST_3_CHARACTERS', 'type at least 3 characters')}`}
230
+ onSearch={(val: string) => handleChangeTermValue(val)}
231
+ value={termValue}
232
+ iconCustomRight={<AntDesignIcon name='filter' size={16} style={{ bottom: 2 }} onPress={() => handleOpenfilters()} />}
233
+ />
236
234
  </SearchWrapper>
237
235
  {
238
236
  noResults && (
@@ -33,6 +33,7 @@ const OrderProgressUI = (props: any) => {
33
33
  const [{ optimizeImage, parseDate, parseTime }] = useUtils()
34
34
  const [lastOrder, setLastOrder] = useState<any>(null)
35
35
  const imageFails = theme.images.general.emptyActiveOrders
36
+ const [initialLoaded, setInitialLoaded] = useState(false)
36
37
 
37
38
  const styles = StyleSheet.create({
38
39
  main: {
@@ -135,16 +136,21 @@ const OrderProgressUI = (props: any) => {
135
136
  }
136
137
  }, [isFocused])
137
138
 
139
+ useEffect(() => {
140
+ if (orderList.loading || initialLoaded) return
141
+ setInitialLoaded(true)
142
+ }, [orderList.loading, initialLoaded])
143
+
138
144
  return (
139
145
  <>
140
- {orderList?.loading && (
146
+ {(orderList?.loading && !initialLoaded) && (
141
147
  <Placeholder Animation={Fade} height={Platform.OS === 'ios' ? 147.5 : 158}>
142
148
  <PlaceholderLine height={60} style={{ borderRadius: 8, marginBottom: 10 }} />
143
149
  <PlaceholderLine height={20} style={{ marginBottom: 10 }} />
144
150
  <PlaceholderLine height={40} style={{ borderRadius: 8, marginBottom: 10 }} />
145
151
  </Placeholder>
146
152
  )}
147
- {!orderList?.loading && orderList?.orders?.length > 0 && lastOrder && (
153
+ {(!orderList?.loading || initialLoaded) && orderList?.orders?.length > 0 && lastOrder && (
148
154
  <View style={styles.main}>
149
155
  <OrderInfoWrapper style={{ flex: 1 }}>
150
156
  <View style={styles.logoWrapper}>
@@ -143,7 +143,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
143
143
 
144
144
  useFocusEffect(
145
145
  React.useCallback(() => {
146
- loadOrders(false, false, false, true)
146
+ if (!businessesSearchList) {
147
+ loadOrders(false, false, false, true)
148
+ }
147
149
  }, [navigation])
148
150
  )
149
151
 
@@ -47,7 +47,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
47
47
  borderWidth: 1,
48
48
  borderRadius: 7.6,
49
49
  borderColor: theme.colors.border,
50
- marginBottom: 28,
50
+ marginBottom: 25,
51
51
  minHeight: hideAddButton ? 100 : 165
52
52
  },
53
53
  titleWrapper: {
@@ -137,7 +137,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
137
137
  }
138
138
 
139
139
  return (
140
- <InView style={{ minHeight: hideAddButton ? 125 : 165 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeIntersection()}>
140
+ <InView style={{ minHeight: hideAddButton ? 125 : 190 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeIntersection()}>
141
141
  {isIntersectionObserver ? (
142
142
  <CardContainer
143
143
  showAddButton={!hideAddButton}