ordering-ui-react-native 0.14.83 → 0.14.84
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
|
@@ -117,6 +117,9 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
117
117
|
const [featuredBusiness, setFeaturedBusinesses] = useState(Array);
|
|
118
118
|
const [isFarAway, setIsFarAway] = useState(false)
|
|
119
119
|
|
|
120
|
+
const isPreorderEnabled = (configs?.preorder_status_enabled?.value === '1' || configs?.preorder_status_enabled?.value === 'true') &&
|
|
121
|
+
Number(configs?.max_days_preorder?.value) > 0
|
|
122
|
+
|
|
120
123
|
const timerId = useRef<any>(false)
|
|
121
124
|
// const panResponder = useRef(
|
|
122
125
|
// PanResponder.create({
|
|
@@ -128,6 +131,12 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
128
131
|
// })
|
|
129
132
|
// ).current
|
|
130
133
|
|
|
134
|
+
const handleMomentClick = () => {
|
|
135
|
+
if (isPreorderEnabled) {
|
|
136
|
+
navigation.navigate('MomentOption')
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
131
140
|
const configTypes =
|
|
132
141
|
configs?.order_types_allowed?.value
|
|
133
142
|
.split('|')
|
|
@@ -198,14 +207,12 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
198
207
|
}, [orderState?.options?.address?.location])
|
|
199
208
|
|
|
200
209
|
useEffect(() => {
|
|
201
|
-
const onFocusApp = (nextAppState
|
|
210
|
+
const onFocusApp = (nextAppState: any) => {
|
|
202
211
|
if (
|
|
203
212
|
appState.current.match(/inactive|background/) &&
|
|
204
213
|
nextAppState === "active"
|
|
205
214
|
) {
|
|
206
|
-
|
|
207
|
-
getBusinesses(true);
|
|
208
|
-
}
|
|
215
|
+
getBusinesses(true);
|
|
209
216
|
}
|
|
210
217
|
appState.current = nextAppState;
|
|
211
218
|
setAppStateVisible(appState.current);
|
|
@@ -281,7 +288,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
281
288
|
/>
|
|
282
289
|
</WrapMomentOption>
|
|
283
290
|
<WrapMomentOption
|
|
284
|
-
onPress={() =>
|
|
291
|
+
onPress={() => handleMomentClick()}>
|
|
285
292
|
<OText
|
|
286
293
|
size={12}
|
|
287
294
|
numberOfLines={1}
|
|
@@ -291,11 +298,13 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
291
298
|
? parseDate(orderState.options?.moment, { outputFormat: configs?.dates_moment_format?.value })
|
|
292
299
|
: t('ASAP_ABBREVIATION', 'ASAP')}
|
|
293
300
|
</OText>
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
301
|
+
{isPreorderEnabled && (
|
|
302
|
+
<OIcon
|
|
303
|
+
src={theme.images.general.arrow_down}
|
|
304
|
+
width={10}
|
|
305
|
+
style={{ marginStart: 8 }}
|
|
306
|
+
/>
|
|
307
|
+
)}
|
|
299
308
|
</WrapMomentOption>
|
|
300
309
|
|
|
301
310
|
{!businessId && (
|