ordering-ui-react-native 0.14.15 → 0.14.16

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.14.15",
3
+ "version": "0.14.16",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -26,6 +26,7 @@ const NewOrderNotificationUI = (props: any) => {
26
26
  const [messageOrderId, setMessageOrderId] = useState(null)
27
27
  const [soundTimeout, setSoundTimeout] = useState<any>(null)
28
28
  const [isFocused, setIsFocused] = useState(false)
29
+ const [currentChange, setCurrentChange] = useState(1)
29
30
 
30
31
  const notificationSound = new Sound(theme.sounds.notification, error => {
31
32
  if (error) {
@@ -64,6 +65,7 @@ const NewOrderNotificationUI = (props: any) => {
64
65
  const handleNotification = (order: any) => {
65
66
  setModalOpen(true)
66
67
  clearInterval(soundTimeout)
68
+ setCurrentChange(1)
67
69
  handlePlayNotificationSound()
68
70
  setNewOrderId(order.id)
69
71
  }
@@ -72,6 +74,7 @@ const NewOrderNotificationUI = (props: any) => {
72
74
  const { order_id: orderId } = message;
73
75
  if (!modalOpen) setModalOpen(true)
74
76
  clearInterval(soundTimeout)
77
+ setCurrentChange(2)
75
78
  handlePlayNotificationSound()
76
79
  setMessageOrderId(orderId)
77
80
  }
@@ -154,14 +157,14 @@ const NewOrderNotificationUI = (props: any) => {
154
157
  color={theme.colors.textGray}
155
158
  weight={600}
156
159
  >
157
- {t('NEW_ORDRES_RECEIVED', 'New orders have been received!')}
160
+ {currentChange === 1 ? t('NEW_ORDRES_RECEIVED', 'New orders have been received!') : t('NEW_MESSAGES_RECEIVED', 'New messages have been received!')}
158
161
  </OText>
159
162
  <OIcon
160
163
  src={theme.images.general.newOrder}
161
164
  width={250}
162
165
  height={200}
163
166
  />
164
- {newOrderId && (
167
+ {newOrderId !== null && (
165
168
  <OText
166
169
  color={theme.colors.textGray}
167
170
  mBottom={15}
@@ -170,7 +173,7 @@ const NewOrderNotificationUI = (props: any) => {
170
173
  </OText>
171
174
  )}
172
175
 
173
- {messageOrderId && (
176
+ {messageOrderId !== null && (
174
177
  <OText
175
178
  color={theme.colors.textGray}
176
179
  mBottom={15}