ordering-ui-react-native 0.16.16-release → 0.16.17-release

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.16-release",
3
+ "version": "0.16.17-release",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { useOrder, useSession, useLanguage } from 'ordering-components/native';
2
+ import { useOrder, useSession, useLanguage, useConfig } from 'ordering-components/native';
3
3
 
4
4
  import { useTheme } from 'styled-components/native'
5
5
  import { BusinessesListing as OriginalBusinessListing } from './Layout/Original'
@@ -15,6 +15,8 @@ export const BusinessesListing = (props: any) => {
15
15
  const [, t] = useLanguage();
16
16
  const [{ auth }] = useSession()
17
17
  const [, { getLastOrderHasNoReview }] = useOrder();
18
+ const [{ configs }] = useConfig()
19
+ const isShowReviewsPopupEnabled = configs?.show_reviews_popups_enabled?.value === '1'
18
20
 
19
21
  const [, setIsReviewed] = useState()
20
22
  const [checkNotificationStatus, setCheckNotificationStatus] = useState({ open: false, checked: false })
@@ -73,8 +75,9 @@ export const BusinessesListing = (props: any) => {
73
75
  }
74
76
 
75
77
  useEffect(() => {
78
+ if (!isShowReviewsPopupEnabled) return
76
79
  (checkNotificationStatus?.checked && auth) && _getLastOrderHasNoReview()
77
- }, [checkNotificationStatus, auth])
80
+ }, [checkNotificationStatus, auth, isShowReviewsPopupEnabled])
78
81
 
79
82
  return (
80
83
  <>