ordering-ui-react-native 0.15.38 → 0.15.39

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.38",
3
+ "version": "0.15.39",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -53,6 +53,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
53
53
  const [isEnabled, setIsEnabled] = useState(false)
54
54
  const { top } = useSafeAreaInsets()
55
55
  const showOrderTime = (selectedPreorderType === 1 && Object.keys(menu)?.length > 0) || selectedPreorderType === 0
56
+ const isPreOrderSetting = configs?.preorder_status_enabled?.value === '1'
56
57
  const styles = StyleSheet.create({
57
58
  container: {
58
59
  height: windowHeight,
@@ -301,60 +302,62 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
301
302
  />
302
303
  </View>
303
304
  </BusinessInfoWrapper>
304
- <PreorderTypeWrapper>
305
- <OText
306
- size={16}
307
- style={{
308
- fontWeight: '600',
309
- lineHeight: 24,
310
- marginBottom: 12
311
- }}
312
- >
313
- {t('PREORDER_TYPE', 'Preorder type')}
314
- </OText>
315
- <SelectDropdown
316
- defaultValueByIndex={selectedPreorderType}
317
- data={preorderTypeList}
318
- // disabled={orderState.loading}
319
- onSelect={(selectedItem, index) => {
320
- setSelectedPreorderType(index)
321
- }}
322
- buttonTextAfterSelection={(selectedItem, index) => {
323
- return selectedItem.name
324
- }}
325
- rowTextForSelection={(item, index) => {
326
- return item.name
327
- }}
328
- buttonStyle={styles.selectOption}
329
- buttonTextStyle={{
330
- color: theme.colors.disabled,
331
- fontSize: 14,
332
- textAlign: 'left',
333
- marginHorizontal: 0
334
- }}
335
- dropdownStyle={{
336
- borderRadius: 8,
337
- borderColor: theme.colors.lightGray,
338
- marginTop: Platform.OS === 'ios' ? 12 : -top
339
- }}
340
- rowStyle={{
341
- borderBottomColor: theme.colors.backgroundGray100,
342
- backgroundColor: theme.colors.backgroundGray100,
343
- height: 40,
344
- flexDirection: 'column',
345
- alignItems: 'flex-start',
346
- paddingTop: 8,
347
- paddingHorizontal: 14
348
- }}
349
- rowTextStyle={{
350
- color: theme.colors.disabled,
351
- fontSize: 14,
352
- marginHorizontal: 0
353
- }}
354
- renderDropdownIcon={() => dropDownIcon()}
355
- dropdownOverlayColor='transparent'
356
- />
357
- </PreorderTypeWrapper>
305
+ {isPreOrderSetting && (
306
+ <PreorderTypeWrapper>
307
+ <OText
308
+ size={16}
309
+ style={{
310
+ fontWeight: '600',
311
+ lineHeight: 24,
312
+ marginBottom: 12
313
+ }}
314
+ >
315
+ {t('PREORDER_TYPE', 'Preorder type')}
316
+ </OText>
317
+ <SelectDropdown
318
+ defaultValueByIndex={selectedPreorderType}
319
+ data={preorderTypeList}
320
+ // disabled={orderState.loading}
321
+ onSelect={(selectedItem, index) => {
322
+ setSelectedPreorderType(index)
323
+ }}
324
+ buttonTextAfterSelection={(selectedItem, index) => {
325
+ return selectedItem.name
326
+ }}
327
+ rowTextForSelection={(item, index) => {
328
+ return item.name
329
+ }}
330
+ buttonStyle={styles.selectOption}
331
+ buttonTextStyle={{
332
+ color: theme.colors.disabled,
333
+ fontSize: 14,
334
+ textAlign: 'left',
335
+ marginHorizontal: 0
336
+ }}
337
+ dropdownStyle={{
338
+ borderRadius: 8,
339
+ borderColor: theme.colors.lightGray,
340
+ marginTop: Platform.OS === 'ios' ? 12 : -top
341
+ }}
342
+ rowStyle={{
343
+ borderBottomColor: theme.colors.backgroundGray100,
344
+ backgroundColor: theme.colors.backgroundGray100,
345
+ height: 40,
346
+ flexDirection: 'column',
347
+ alignItems: 'flex-start',
348
+ paddingTop: 8,
349
+ paddingHorizontal: 14
350
+ }}
351
+ rowTextStyle={{
352
+ color: theme.colors.disabled,
353
+ fontSize: 14,
354
+ marginHorizontal: 0
355
+ }}
356
+ renderDropdownIcon={() => dropDownIcon()}
357
+ dropdownOverlayColor='transparent'
358
+ />
359
+ </PreorderTypeWrapper>
360
+ )}
358
361
  {selectedPreorderType === 1 && (
359
362
  <MenuWrapper>
360
363
  <OText
@@ -374,7 +377,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
374
377
  />
375
378
  </MenuWrapper>
376
379
  )}
377
- {showOrderTime && (
380
+ {isPreOrderSetting && (
378
381
  <OrderTimeWrapper>
379
382
  <OText
380
383
  size={16}
@@ -448,6 +451,20 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
448
451
  </TimeListWrapper>
449
452
  </OrderTimeWrapper>
450
453
  )}
454
+ {!isPreOrderSetting && (
455
+ <OText
456
+ size={16}
457
+ style={{
458
+ fontWeight: '600',
459
+ lineHeight: 24,
460
+ marginTop: 30,
461
+ marginBottom: 12,
462
+ textAlign: 'center'
463
+ }}
464
+ >
465
+ {t('ERROR_ADD_PRODUCT_BUSINESS_CLOSED', 'The business is closed at the moment')}
466
+ </OText>
467
+ )}
451
468
  <OButton
452
469
  text={t('GO_TO_MENU', 'Go to menu')}
453
470
  textStyle={{ color: 'white' }}