ordering-ui-react-native 0.23.14 → 0.23.15-test

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.23.14",
3
+ "version": "0.23.15-test",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -1,5 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { StyleSheet, View, ActivityIndicator, TouchableOpacity } from 'react-native';
3
+ import FastImage from 'react-native-fast-image'
3
4
  import ToggleSwitch from 'toggle-switch-react-native';
4
5
  import { useTheme } from 'styled-components/native';
5
6
  import {
@@ -99,10 +100,14 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
99
100
  onPress={() => navigation && business?.slug && navigation.navigate('BusinessProductListing', { slug: business?.slug })}
100
101
  >
101
102
  <Logo style={styles.logo}>
102
- <OIcon
103
- url={optimizeImage(business?.logo, 'h_300,c_limit')}
104
- src={!business?.logo && theme?.images?.dummies?.businessLogo}
103
+ <FastImage
105
104
  style={styles.icon}
105
+ source={business?.logo?.includes('https') ? {
106
+ uri: business?.logo,
107
+ priority: FastImage.priority.high,
108
+ cache: FastImage.cacheControl.immutable
109
+ } : business?.logo ?? theme?.images?.dummies?.businessLogo}
110
+ resizeMode={FastImage.resizeMode.cover}
106
111
  />
107
112
  </Logo>
108
113
  <Information>
@@ -316,8 +316,18 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
316
316
  const printAction = async (printerSettings: any, commands: any, showAlert: boolean = true) => {
317
317
  try {
318
318
  var printResult = await StarPRNT.print(printerSettings?.emulation, commands, printerSettings?.portName);
319
+ Alert.alert(
320
+ 'Print Result',
321
+ JSON.stringify(printResult),
322
+ [{ text: t('OK', 'Ok')}]
323
+ )
319
324
  showAlert && showToast(ToastType.Info, t('ORDER_PRINTED_SUCCESS', 'Order printed'), 1000)
320
325
  } catch (e) {
326
+ Alert.alert(
327
+ 'Print Result',
328
+ JSON.stringify(e),
329
+ [{ text: t('OK', 'Ok')}]
330
+ )
321
331
  showAlert && showToast(ToastType.Error, t('ORDER_PRINTED_FAILED', 'Order not printed, connection failed'), 1000)
322
332
  }
323
333
  }
@@ -330,7 +340,11 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
330
340
  orderStatus: getOrderStatus(order?.status, t)?.value
331
341
  }, printer?.printMode)
332
342
  commands.push({ appendCutPaper: StarPRNT.CutPaperAction.PartialCutWithFeed })
333
-
343
+ Alert.alert(
344
+ `Printer: ${printer?.model}`,
345
+ `Port name: ${printer?.portName}`,
346
+ [{ text: t('OK', 'Ok')}]
347
+ )
334
348
  printAction(printer, commands, idx === printerSettings.length - 1)
335
349
  })
336
350
  return
@@ -423,6 +437,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
423
437
  const autoPrint = await _retrieveStoreData('auto_print_after_accept_order')
424
438
  setPrinterSettings(printers?.length && printers)
425
439
  setAutoPrintEnabled(!!autoPrint)
440
+ console.log('printers after', printers);
426
441
  }
427
442
 
428
443
  getStorageData()
@@ -1,5 +1,6 @@
1
1
  import React, { useState } from 'react';
2
2
  import { StyleSheet, TouchableOpacity, FlatList, RefreshControl } from 'react-native';
3
+ import FastImage from 'react-native-fast-image';
3
4
  import { useTheme } from 'styled-components/native';
4
5
  import { useLanguage, useUtils } from 'ordering-components/native';
5
6
  import { Card, Logo, Information, Header, Badge } from './styles';
@@ -302,10 +303,14 @@ export const PreviousMessages = (props: PreviousMessagesParams) => {
302
303
  activeOpacity={1}>
303
304
  <Card key={order?.id}>
304
305
  <Logo style={styles.logo}>
305
- <OIcon
306
- url={optimizeImage(order?.business?.logo, 'h_300,c_limit')}
307
- src={!order?.business?.logo && theme?.images?.dummies?.businessLogo}
306
+ <FastImage
308
307
  style={styles.icon}
308
+ source={order.business?.logo?.includes('https') ? {
309
+ uri: order.business?.logo,
310
+ priority: FastImage.priority.high,
311
+ cache: FastImage.cacheControl.immutable
312
+ } : order.business?.logo ?? theme?.images?.dummies?.businessLogo}
313
+ resizeMode={FastImage.resizeMode.cover}
309
314
  />
310
315
  </Logo>
311
316
  <Information>
@@ -171,7 +171,8 @@ export const OrderItem = React.memo((props: any) => {
171
171
  style={styles.icon}
172
172
  source={order.business?.logo?.includes('https') ? {
173
173
  uri: order.business?.logo,
174
- priority: FastImage.priority.normal,
174
+ priority: FastImage.priority.high,
175
+ cache: FastImage.cacheControl.immutable
175
176
  } : order.business?.logo ?? theme?.images?.dummies?.businessLogo}
176
177
  resizeMode={FastImage.resizeMode.cover}
177
178
  />
@@ -63,9 +63,13 @@ export const PrinterEdition = (props: any) => {
63
63
  paddingRight: 10
64
64
  },
65
65
  inputStyle: {
66
- height: 40,
67
66
  borderWidth: 1,
68
67
  borderRadius: 8,
68
+ color: theme.colors.arrowColor,
69
+ borderColor: theme.colors.inputSignup,
70
+ backgroundColor: theme.colors.transparent,
71
+ minHeight: 50,
72
+ maxHeight: 50
69
73
  },
70
74
  savePrinterBtnText: {
71
75
  color: theme.colors.white,