ordering-ui-react-native 0.21.37-test → 0.21.37

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.21.37-test",
3
+ "version": "0.21.37",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -45,7 +45,6 @@
45
45
  "@react-native-firebase/analytics": "^12.9.3",
46
46
  "@react-native-firebase/app": "^12.9.3",
47
47
  "@react-native-google-signin/google-signin": "^7.0.1",
48
- "@react-native-picker/picker": "^2.4.10",
49
48
  "@react-navigation/drawer": "^5.10.2",
50
49
  "@react-navigation/material-bottom-tabs": "^5.3.14",
51
50
  "@react-navigation/native": "^5.7.6",
@@ -111,7 +110,6 @@
111
110
  "react-native-signature-canvas": "^4.3.0",
112
111
  "react-native-snap-carousel": "^3.9.1",
113
112
  "react-native-sound": "^0.11.1",
114
- "react-native-star-io10": "^1.3.0",
115
113
  "react-native-swipe-gestures": "^1.0.5",
116
114
  "react-native-swiper": "^1.6.0",
117
115
  "react-native-tracking-transparency": "^0.1.1",
@@ -42,7 +42,6 @@ import { NewOrderNotification } from './src/components/NewOrderNotification';
42
42
  import { DriverSchedule } from './src/components/DriverSchedule';
43
43
  import { ScheduleBlocked } from './src/components/ScheduleBlocked';
44
44
  import { OrderDetailsLogistic } from './src/components/OrderDetailsLogistic'
45
- import HandleStarPrinter from './src/components/StarPrinter';
46
45
  //OComponents
47
46
  import {
48
47
  OText,
@@ -131,6 +130,4 @@ export {
131
130
  useLocation,
132
131
  // providers
133
132
  StoreMethods,
134
- //printer
135
- HandleStarPrinter,
136
133
  };
@@ -1,8 +1,6 @@
1
1
  import React, { useState } from 'react';
2
2
  import { OText, OIconButton } from '../shared';
3
- import {
4
- StyleSheet, View, Platform, Alert
5
- } from 'react-native';
3
+ import { StyleSheet, View, Platform, Alert } from 'react-native';
6
4
  import {
7
5
  Content,
8
6
  OrderCustomer,
@@ -22,8 +20,8 @@ import { FloatingButton } from '../FloatingButton';
22
20
  import RNHTMLtoPDF from 'react-native-html-to-pdf';
23
21
  import RNPrint from 'react-native-print';
24
22
  import { useTheme } from 'styled-components/native';
25
- import { ProductItemAccordion } from '../ProductItemAccordion';
26
23
 
24
+ import { ProductItemAccordion } from '../ProductItemAccordion';
27
25
 
28
26
  export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermission, getPermissions, isGrantedPermissions, checkBluetoothPermission }: any) => {
29
27
  const handleArrowBack: any = () => {
@@ -36,7 +34,6 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
36
34
  selectedPrinter: { url: undefined },
37
35
  });
38
36
 
39
-
40
37
  const getFormattedSubOptionName = ({ quantity, name, position, price }: any) => {
41
38
  if (name !== 'No') {
42
39
  const pos = position && position !== 'whole' ? `(${t(position.toUpperCase(), position)})` : '';
@@ -343,10 +340,6 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
343
340
  }
344
341
  };
345
342
 
346
- const openPrint = () => {
347
- navigation.navigate('HandleStarPrinter')
348
- }
349
-
350
343
  return (
351
344
  <>
352
345
  <Content>
@@ -686,7 +679,7 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
686
679
 
687
680
  <View style={{ marginBottom: 0 }}>
688
681
  <FloatingButton
689
- firstButtonClick={() => openPrint()}
682
+ firstButtonClick={() => handlePrint()}
690
683
  btnText={t('PRINT', 'Print')}
691
684
  color={theme.colors.green}
692
685
  widthButton={'100%'}
@@ -52,7 +52,7 @@ const LoginFormUI = (props: LoginParams) => {
52
52
  } = props;
53
53
 
54
54
  const theme = useTheme()
55
- const [{ configs }] = useConfig()
55
+ const [{ configs }, { refreshConfigs }] = useConfig()
56
56
  const [ordering, { setOrdering }] = useApi();
57
57
  const [, { showToast }] = useToast();
58
58
  const [, t] = useLanguage();
@@ -347,13 +347,16 @@ const LoginFormUI = (props: LoginParams) => {
347
347
  project: projectName
348
348
  })
349
349
  }
350
- if (isDeviceLoginEnabled) {
351
- props.handleChangeTab('device_code')
352
- }
353
350
  }, 1500)
354
351
  return () => clearTimeout(projectInputTimeout);
355
352
  }, [projectName, isDeviceLoginEnabled])
356
353
 
354
+ useEffect(() => {
355
+ if (ordering?.project) {
356
+ refreshConfigs()
357
+ }
358
+ }, [ordering?.project])
359
+
357
360
  const logo = (
358
361
  <LogoWrapper>
359
362
  <OIcon src={theme.images.logos.logotype} style={styles.logo} />
@@ -106,7 +106,6 @@ const BusinessInformationUI = (props: BusinessInformationParams) => {
106
106
  location={businessLocation.location}
107
107
  markerTitle={businessState?.business?.name}
108
108
  businessZones={businessState?.business?.zones}
109
- delta={30}
110
109
  />
111
110
  </WrapBusinessMap>
112
111
  )}
@@ -106,7 +106,7 @@ const RedeemGiftCardUI = (props: any) => {
106
106
  onChange(val)
107
107
  handleChangeCode(val)
108
108
  }}
109
- autoCapitalize='none'
109
+ autoCapitalize='characters'
110
110
  autoCorrect={false}
111
111
  blurOnSubmit={false}
112
112
  style={style.inputStyle}
@@ -129,7 +129,8 @@ export const LastOrder = (props: OrdersOptionParams) => {
129
129
  initialPage: 1,
130
130
  pageSize: 3,
131
131
  controlType: 'infinity'
132
- }
132
+ },
133
+ noGiftCardOrders: true
133
134
  }
134
135
 
135
136
  return <OrderList {...MyOrdersProps} />
@@ -117,7 +117,8 @@ export const LastOrders = (props: any) => {
117
117
  initialPage: 1,
118
118
  pageSize: 3,
119
119
  controlType: 'infinity'
120
- }
120
+ },
121
+ noGiftCardOrders: true
121
122
  }
122
123
  return <OrderListController {...helpProps} />
123
124
  }
@@ -208,7 +208,8 @@ export const OrderProgress = (props: any) => {
208
208
  initialPage: 1,
209
209
  pageSize: 10,
210
210
  controlType: 'infinity'
211
- }
211
+ },
212
+ noGiftCardOrders: true
212
213
  }
213
214
 
214
215
  return <OrderList {...orderProgressProps} />
@@ -508,7 +508,7 @@ export const ProductOptionsUI = (props: any) => {
508
508
  <PlaceholderLine width={60} height={20} />
509
509
  </Placeholder>
510
510
  ) : (
511
- <OText color={theme.colors.primary} size={13} style={{ textAlign: 'center' }}>{t('WITH_GUEST_USER', 'With Guest user')}</OText>
511
+ <OText color={theme.colors.primary} size={13} style={{ textAlign: 'center' }}>{t('AS_GUEST_USER', 'As guest user')}</OText>
512
512
  )}
513
513
  </TouchableOpacity>
514
514
  )}
@@ -602,7 +602,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
602
602
  <PlaceholderLine width={60} height={20} />
603
603
  </Placeholder>
604
604
  ) : (
605
- <OText color={theme.colors.primary} size={13}>{t('WITH_GUEST_USER', 'With Guest user')}</OText>
605
+ <OText color={theme.colors.primary} size={13}>{t('AS_GUEST_USER', 'As guest user')}</OText>
606
606
  )}
607
607
  </TouchableOpacity>
608
608
  )}
@@ -1,150 +0,0 @@
1
- import React, { useState } from 'react';
2
- import {
3
- InterfaceType,
4
- StarConnectionSettings,
5
- StarXpandCommand,
6
- StarPrinter
7
- } from 'react-native-star-io10';
8
- import { Picker } from '@react-native-picker/picker';
9
- import {
10
- View,
11
- Text,
12
- Button,
13
- TextInput,
14
- } from 'react-native';
15
-
16
-
17
- const HandleStarPrinter = () => {
18
-
19
- const [printState, setPrintState] = useState({
20
- interfaceType: InterfaceType.Bluetooth,
21
- identifier: '00:11:62:00:00:00',
22
- imageBase64: ''
23
- });
24
-
25
- const _onPressPrintButton = async () => {
26
-
27
- let settings = new StarConnectionSettings();
28
- settings.interfaceType = printState.interfaceType;
29
- settings.identifier = printState.identifier;
30
-
31
- let printer = new StarPrinter(settings);
32
-
33
- try {
34
- let builder = new StarXpandCommand.StarXpandCommandBuilder();
35
- builder.addDocument(new StarXpandCommand.DocumentBuilder()
36
- .addPrinter(new StarXpandCommand.PrinterBuilder()
37
- .actionPrintImage(new StarXpandCommand.Printer.ImageParameter("logo_01.png", 406))
38
- .styleInternationalCharacter(StarXpandCommand.Printer.InternationalCharacterType.Usa)
39
- .styleCharacterSpace(0)
40
- .styleAlignment(StarXpandCommand.Printer.Alignment.Center)
41
- .actionPrintText("Star Clothing Boutique\n" +
42
- "123 Star Road\n" +
43
- "City, State 12345\n" +
44
- "\n")
45
- .styleAlignment(StarXpandCommand.Printer.Alignment.Left)
46
- .actionPrintText("Date:MM/DD/YYYY Time:HH:MM PM\n" +
47
- "--------------------------------\n" +
48
- "\n")
49
- .actionPrintText("SKU Description Total\n" +
50
- "300678566 PLAIN T-SHIRT 10.99\n" +
51
- "300692003 BLACK DENIM 29.99\n" +
52
- "300651148 BLUE DENIM 29.99\n" +
53
- "300642980 STRIPED DRESS 49.99\n" +
54
- "300638471 BLACK BOOTS 35.99\n" +
55
- "\n" +
56
- "Subtotal 156.95\n" +
57
- "Tax 0.00\n" +
58
- "--------------------------------\n")
59
- .actionPrintText("Total ")
60
- .add(new StarXpandCommand.PrinterBuilder()
61
- .styleMagnification(new StarXpandCommand.MagnificationParameter(2, 2))
62
- .actionPrintText(" $156.95\n")
63
- )
64
- .actionPrintText("--------------------------------\n" +
65
- "\n" +
66
- "Charge\n" +
67
- "156.95\n" +
68
- "Visa XXXX-XXXX-XXXX-0123\n" +
69
- "\n")
70
- .add(new StarXpandCommand.PrinterBuilder()
71
- .styleInvert(true)
72
- .actionPrintText("Refunds and Exchanges\n")
73
- )
74
- .actionPrintText("Within ")
75
- .add(new StarXpandCommand.PrinterBuilder()
76
- .styleUnderLine(true)
77
- .actionPrintText("30 days")
78
- )
79
- .actionPrintText(" with receipt\n")
80
- .actionPrintText("And tags attached\n" +
81
- "\n")
82
- .styleAlignment(StarXpandCommand.Printer.Alignment.Center)
83
- .actionPrintBarcode(new StarXpandCommand.Printer.BarcodeParameter('0123456',
84
- StarXpandCommand.Printer.BarcodeSymbology.Jan8)
85
- .setBarDots(3)
86
- .setBarRatioLevel(StarXpandCommand.Printer.BarcodeBarRatioLevel.Level0)
87
- .setHeight(5)
88
- .setPrintHri(true))
89
- .actionFeedLine(1)
90
- .actionPrintQRCode(new StarXpandCommand.Printer.QRCodeParameter('Hello World.\n')
91
- .setModel(StarXpandCommand.Printer.QRCodeModel.Model2)
92
- .setLevel(StarXpandCommand.Printer.QRCodeLevel.L)
93
- .setCellSize(8))
94
- .actionCut(StarXpandCommand.Printer.CutType.Partial)
95
- )
96
- );
97
-
98
- let commands = await builder.getCommands();
99
-
100
- await printer.open();
101
- await printer.print(commands);
102
-
103
- console.log(`Success`);
104
- }
105
- catch (error) {
106
- console.log(`Error: ${String(error)}`);
107
- }
108
- finally {
109
- await printer.close();
110
- await printer.dispose();
111
- }
112
- }
113
-
114
- return (
115
- <View style={{ margin: 50 }}>
116
- <View style={{ flexDirection: 'row' }}>
117
- <Text style={{ width: 100 }}>Interface</Text>
118
- <Picker
119
- style={{ width: 200, marginLeft: 20, justifyContent: 'center' }}
120
- selectedValue={printState.interfaceType}
121
- onValueChange={(value) => {
122
- setPrintState({ interfaceType: value });
123
- }}>
124
- <Picker.Item label='LAN' value={InterfaceType.Lan} />
125
- <Picker.Item label='Bluetooth' value={InterfaceType.Bluetooth} />
126
- <Picker.Item label='Bluetooth LE' value={InterfaceType.BluetoothLE} />
127
- <Picker.Item label='USB' value={InterfaceType.Usb} />
128
- </Picker>
129
- </View>
130
- <View style={{ flexDirection: 'row', marginTop: 30 }}>
131
- <Text style={{ width: 100 }}>Identifier</Text>
132
- <TextInput
133
- style={{ width: 200, marginLeft: 20 }}
134
- value={printState.identifier}
135
- onChangeText={(value) => {
136
- setPrintState({ identifier: value });
137
- }}
138
- />
139
- </View>
140
- <View style={{ width: 100, marginTop: 20 }}>
141
- <Button
142
- title="Print"
143
- onPress={_onPressPrintButton}
144
- />
145
- </View>
146
- </View>
147
- );
148
- };
149
-
150
- export default HandleStarPrinter;