ordering-ui-react-native 0.18.97 → 0.18.98

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.18.97",
3
+ "version": "0.18.98",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -342,7 +342,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
342
342
  )}
343
343
  </OText>
344
344
 
345
- {numberToShow ? (
345
+ {!!numberToShow ? (
346
346
  <OButton
347
347
  bgColor="transparent"
348
348
  borderColor={theme.colors.primary}
@@ -855,7 +855,7 @@ const ChatUI = (props: MessagesParams) => {
855
855
  iconCover
856
856
  />
857
857
 
858
- {image && !isShowSignaturePad && (
858
+ {!!image && !isShowSignaturePad && (
859
859
  <TouchableOpacity
860
860
  style={{
861
861
  position: 'absolute',
@@ -18,7 +18,7 @@ export const NotFoundSource = (props: NotFoundSourceParams) => {
18
18
  <OIcon src={errorImage} width={260} height={220} />
19
19
  </NotFoundImage>
20
20
  )}
21
- {content && conditioned && !errorImage && (
21
+ {!!content && conditioned && !errorImage && (
22
22
  <OText
23
23
  color={theme.colors.textSecondary}
24
24
  size={textSize ?? 18}
@@ -26,7 +26,7 @@ export const NotFoundSource = (props: NotFoundSourceParams) => {
26
26
  {content}
27
27
  </OText>
28
28
  )}
29
- {content && !conditioned && (
29
+ {!!content && !conditioned && (
30
30
  <OText
31
31
  color={theme.colors.textSecondary}
32
32
  size={textSize ?? 18}
@@ -410,7 +410,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
410
410
  </View>
411
411
  )}
412
412
 
413
- {(!!error || error) && (
413
+ {(!!error || error?.length > 0) && (
414
414
  <NotFoundSource
415
415
  btnTitle={t('GO_TO_MY_ORDERS', 'Go to my orders')}
416
416
  content={
@@ -263,7 +263,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
263
263
  )}
264
264
  </>
265
265
  </OText>
266
- {!order?.isLogistic && order?.delivery_type && (!order?.order_group_id || !logisticOrderStatus?.includes(order?.status)) && (
266
+ {!order?.isLogistic && !!order?.delivery_type && (!order?.order_group_id || !logisticOrderStatus?.includes(order?.status)) && (
267
267
  <>
268
268
  <OText size={13}>
269
269
  <OText size={13} weight='bold'>{`${t('ORDER_TYPE', 'Order Type')}: `}</OText>
@@ -149,7 +149,7 @@ export const OrderDetailsLogisticUI = (props: OrderDetailsLogisticParams) => {
149
149
  keyboardShouldPersistTaps="handled"
150
150
  showsVerticalScrollIndicator={false}
151
151
  >
152
- {order?.order_group && order?.order_group_id && order?.isLogistic ? order?.order_group?.orders.map((order: any, i: number, hash: any) => (
152
+ {order?.order_group && !!order?.order_group_id && order?.isLogistic ? order?.order_group?.orders.map((order: any, i: number, hash: any) => (
153
153
  <OrderDetailsInformation key={order?.id} order={order} isOrderGroup lastOrder={hash?.length === i + 1} />
154
154
  )) : (
155
155
  <OrderDetailsInformation order={order} />
@@ -276,7 +276,7 @@ export const OrderMessageUI = (props: OrderDetailsParams) => {
276
276
 
277
277
  <View style={styles.titleGroups}>
278
278
  <View style={styles.shadow}>
279
- {order?.business?.logo ? (
279
+ {!!order?.business?.logo ? (
280
280
  <OIcon
281
281
  url={optimizeImage(order?.business?.logo, 'h_300,c_limit')}
282
282
  style={styles.titleIcons}
@@ -144,7 +144,7 @@ export const OrderItem = (props: any) => {
144
144
  onPress={() => handlePressOrder({ ...order, logistic_order_id: _order?.id })}
145
145
  >
146
146
  <Card key={order.id}>
147
- {allowColumns?.slaBar && (
147
+ {!!allowColumns?.slaBar && (
148
148
  <Timestatus
149
149
  style={{
150
150
  backgroundColor: getStatusClassName(getDelayMinutes(order)) === 'in_time'
@@ -194,7 +194,7 @@ export const OrderItem = (props: any) => {
194
194
  numberOfLines={1}
195
195
  adjustsFontSizeToFit
196
196
  >
197
- {(order?.order_group_id && order?.order_group && isLogisticOrder
197
+ {(!!order?.order_group_id && order?.order_group && isLogisticOrder
198
198
  ? `${order?.order_group?.orders?.length} ${t('ORDERS', 'Orders')}`
199
199
  : (t('NO', 'Order No.') + order.id)
200
200
  ) + ' · '}
@@ -371,7 +371,7 @@ export const PreviousOrders = (props: any) => {
371
371
  })}
372
372
  />
373
373
  )}
374
- {deliveryPickupBtn && deliveryPickupBtn?.includes(_ordersGrouped[k][0]?.status) && (
374
+ {!!deliveryPickupBtn && deliveryPickupBtn?.includes(_ordersGrouped[k][0]?.status) && (
375
375
  <AcceptOrRejectOrderStyle>
376
376
  <OButton
377
377
  text={t('PICKUP_FAILED', 'Pickup failed')}
@@ -403,7 +403,7 @@ export const PreviousOrders = (props: any) => {
403
403
  />
404
404
  </AcceptOrRejectOrderStyle>
405
405
  )}
406
- {deliveryStatusCompleteBtn && deliveryStatusCompleteBtn.includes(_ordersGrouped[k][0]?.status) && (
406
+ {!!deliveryStatusCompleteBtn && deliveryStatusCompleteBtn.includes(_ordersGrouped[k][0]?.status) && (
407
407
  <AcceptOrRejectOrderStyle>
408
408
  <OButton
409
409
  text={t('DELIVERY_FAILED', 'Delivery Failed')}