@controleonline/ui-common 1.2.71 → 1.2.75
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/.github/actions/workers/manager/action.yml +147 -0
- package/.github/actions/workers/qa/action.yml +44 -0
- package/.github/actions/workers/security/action.yml +44 -0
- package/.github/actions/workers/technical-documenter/action.yml +51 -0
- package/.github/workflows/manager-worker.yml +168 -0
- package/.github/workflows/publish-npm.yml +45 -0
- package/.gitmodules +3 -0
- package/AGENTS.md +6 -0
- package/README.md +14 -0
- package/package.json +3 -2
- package/src/api/fetch.js +1 -1
- package/src/api/index.js +92 -22
- package/src/react/components/AddImportModal.js +94 -110
- package/src/react/components/BottomNavigationBar.config.js +211 -231
- package/src/react/components/CategoryForm.js +52 -35
- package/src/react/components/DefaultProvider.native.js +131 -95
- package/src/react/components/DefaultProvider.web.js +148 -74
- package/src/react/components/NetworkPrinterPreviewModal.js +249 -0
- package/src/react/components/NetworkPrinterPreviewModal.styles.js +159 -0
- package/src/react/components/RuntimeInfoFooter.js +100 -36
- package/src/react/components/RuntimeInfoFooter.styles.js +3 -0
- package/src/react/components/UnifiedPaymentBar.js +7 -4
- package/src/react/components/UserAvatar.js +160 -0
- package/src/react/components/integrations/IntegrationHero/index.js +48 -0
- package/src/react/components/integrations/IntegrationHero/styles.js +57 -0
- package/src/react/components/integrations/IntegrationTabs/index.js +89 -0
- package/src/react/components/integrations/IntegrationTabs/styles.js +44 -0
- package/src/react/config/deviceConfigBootstrap.js +5 -3
- package/src/react/pages/Connections.js +229 -0
- package/src/react/pages/Connections.styles.js +222 -0
- package/src/react/pages/DeviceDetailPage.js +2814 -0
- package/src/react/pages/DeviceDetailPage.styles.js +308 -0
- package/src/react/pages/Devices/currentDevice.js +194 -0
- package/src/react/pages/Devices/deviceTypes/DeviceGroupCard.js +257 -0
- package/src/react/pages/Devices/deviceTypes/all.js +23 -0
- package/src/react/pages/Devices/deviceTypes/device.js +25 -0
- package/src/react/pages/Devices/deviceTypes/deviceListHelpers.js +178 -0
- package/src/react/pages/Devices/deviceTypes/display.js +26 -0
- package/src/react/pages/Devices/deviceTypes/index.js +145 -0
- package/src/react/pages/Devices/deviceTypes/ipCamera.js +35 -0
- package/src/react/pages/Devices/deviceTypes/pdv.js +88 -0
- package/src/react/pages/Devices/deviceTypes/printer.js +37 -0
- package/src/react/pages/Devices/deviceTypes/shared.js +453 -0
- package/src/react/pages/Devices/deviceTypes/useDeviceNetworkConnectivity.js +145 -0
- package/src/react/pages/Devices.js +183 -0
- package/src/react/pages/Devices.styles.js +353 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99CatalogTab.js +219 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99OverviewTab.js +134 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99PreviewModal.js +173 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99ProductCard.js +1 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99QuickWalletModal.js +181 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99SettingsTab.js +306 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99StoreTab.js +417 -0
- package/src/react/pages/Food99IntegrationPage/index.js +1530 -0
- package/src/react/pages/Food99IntegrationPage/styles.js +792 -0
- package/src/react/pages/Food99IntegrationPage/utils.js +155 -0
- package/src/react/pages/Food99IntegrationPage.js +1 -0
- package/src/react/pages/Food99IntegrationPage.styles.js +1 -0
- package/src/react/pages/GenericLogPage.js +42 -167
- package/src/react/pages/IFoodIntegrationPage/components/IFoodCatalogTab.js +8 -0
- package/src/react/pages/IFoodIntegrationPage/components/IFoodOperationsTab.js +420 -0
- package/src/react/pages/IFoodIntegrationPage/components/IFoodOverviewTab.js +118 -0
- package/src/react/pages/IFoodIntegrationPage/components/IFoodPreviewModal.js +103 -0
- package/src/react/pages/IFoodIntegrationPage/components/IFoodProductCard.js +1 -0
- package/src/react/pages/IFoodIntegrationPage/components/IFoodStoreTab.js +150 -0
- package/src/react/pages/IFoodIntegrationPage/index.js +1298 -0
- package/src/react/pages/IFoodIntegrationPage/styles.js +764 -0
- package/src/react/pages/IFoodIntegrationPage/utils.js +91 -0
- package/src/react/pages/IFoodIntegrationPage.js +1 -0
- package/src/react/pages/IFoodIntegrationPage.styles.js +1 -0
- package/src/react/pages/Imports.js +214 -166
- package/src/react/pages/IntegrationConfigPage.js +744 -0
- package/src/react/pages/IntegrationConfigPage.styles.js +269 -0
- package/src/react/pages/Integrations.js +299 -0
- package/src/react/pages/Integrations.styles.js +130 -0
- package/src/react/pages/ManagerOrderNotificationsPage.js +642 -0
- package/src/react/pages/MarketplaceIntegrationPage/components/MarketplaceProductCard.js +205 -0
- package/src/react/pages/MarketplaceIntegrationPage/components/RemoteMarketplaceMenuTab.js +335 -0
- package/src/react/pages/MarketplaceIntegrationPage/index.js +60 -0
- package/src/react/pages/MarketplaceIntegrationPage/utils.js +137 -0
- package/src/react/pages/MercadoLivreIntegrationPage.js +538 -0
- package/src/react/pages/PrinterDeviceDetailPage.js +1916 -0
- package/src/react/pages/PrinterDeviceDetailPage.styles.js +223 -0
- package/src/react/pages/PrinterDeviceFormPage.js +521 -0
- package/src/react/pages/PrinterDeviceFormPage.styles.js +159 -0
- package/src/react/pages/WhatsAppConnectionPage.js +459 -0
- package/src/react/pages/WhatsAppConnectionPage.styles.js +284 -0
- package/src/react/pages/integrationsCatalog.js +399 -0
- package/src/react/services/Cielo/Cielo.js +193 -193
- package/src/react/utils/categoryContexts.js +46 -0
- package/src/react/utils/entityDisplay.js +222 -217
- package/src/react/utils/fileUrl.js +39 -20
- package/src/react/utils/integrationPage.js +16 -0
- package/src/react/utils/runtimeFooter.js +40 -22
- package/src/react/utils/runtimeLanguage.js +50 -9
- package/src/react/utils/runtimeMenu.js +191 -131
- package/src/react/utils/runtimeZoom.js +43 -0
- package/src/react/utils/shopConfig.js +27 -15
- package/src/react/utils/shopFranchises.js +126 -1
- package/src/react/utils/storeColumns.js +23 -4
- package/src/react/utils/userAvatar.js +104 -0
- package/src/store/categories/index.js +48 -20
- package/src/store/device_config/index.js +62 -21
- package/src/store/entity_log/index.js +22 -1
- package/src/store/imports/customActions.js +51 -0
- package/src/store/imports/index.js +89 -88
- package/src/store/status/index.js +11 -11
- package/src/store/themes/index.js +22 -0
- package/src/store/timezones/index.js +3 -1
- package/src/tests/browser/manager/connections.spec.js +143 -0
- package/src/tests/browser/manager/devices-current.spec.js +343 -0
- package/src/tests/browser/manager/mercado-livre-integration.spec.js +268 -0
- package/src/tests/react/api/deviceHeaders.test.js +114 -0
- package/src/tests/react/components/AddImportModal.test.js +166 -0
- package/src/tests/react/components/BottomNavigationBar.config.test.js +20 -0
- package/src/tests/react/components/UserAvatar.test.js +52 -0
- package/src/tests/react/pages/DevicePickerStyles.test.js +47 -0
- package/src/tests/react/pages/Devices/deviceListHelpers.test.js +39 -0
- package/src/tests/react/pages/DevicesCurrentDevice.test.js +198 -0
- package/src/tests/react/pages/connectionsHelpers.test.js +34 -0
- package/src/tests/react/pages/mercadoLivreIntegrationPageContract.test.mjs +16 -0
- package/src/tests/react/services/Cielo.test.js +190 -190
- package/src/tests/react/store/categoriesOrdering.test.js +26 -0
- package/src/tests/react/utils/appDomain.test.js +62 -0
- package/src/tests/react/utils/entityDisplay.test.js +2 -2
- package/src/tests/react/utils/fileUrl.test.js +3 -3
- package/src/tests/react/utils/formatter.test.mjs +33 -0
- package/src/tests/react/utils/runtimeFooter.test.js +29 -4
- package/src/tests/react/utils/runtimeLanguage.test.js +79 -9
- package/src/tests/react/utils/runtimeMenu.test.js +198 -134
- package/src/tests/react/utils/runtimeZoom.test.js +38 -0
- package/src/tests/react/utils/shopConfig.test.js +10 -9
- package/src/tests/react/utils/shopFranchises.test.js +43 -0
- package/src/tests/react/utils/translate.discovery.test.mjs +170 -0
- package/src/tests/react/utils/translate.test.helpers.mjs +152 -0
- package/src/tests/react/utils/translate.test.mjs +141 -349
- package/src/tests/react/utils/userAvatar.test.js +63 -0
- package/src/utils/appDomain.js +15 -4
- package/src/utils/formatter.js +104 -16
- package/src/utils/integrationConfigs.js +80 -80
- package/src/utils/translate.js +222 -438
- package/src/utils/translateDiscovery.js +96 -0
- package/src/utils/translateNormalize.js +33 -0
- package/src/utils/translatePending.js +92 -0
- package/src/utils/translateStorage.js +142 -0
- package/.github/agents/developer.agent.md +0 -30
- package/.github/agents/devops.agent.md +0 -30
- package/.github/agents/qa.agent.md +0 -30
- package/.github/agents/security.agent.md +0 -30
- package/.github/workflows/npmjs.yml +0 -35
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ActivityIndicator, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
|
3
|
+
import Icon from 'react-native-vector-icons/Feather';
|
|
4
|
+
import { colors } from '@controleonline/../../src/styles/colors';
|
|
5
|
+
|
|
6
|
+
import { withOpacity } from '@controleonline/../../src/styles/branding';
|
|
7
|
+
|
|
8
|
+
import styles from '../styles';
|
|
9
|
+
|
|
10
|
+
const resolveButtonPalette = (palette, accentColor) => {
|
|
11
|
+
const primaryBackground =
|
|
12
|
+
palette.buttonBackground || accentColor || palette.primary;
|
|
13
|
+
const primaryBorder = palette.buttonBorder || primaryBackground;
|
|
14
|
+
const primaryText = palette.buttonText || palette.white;
|
|
15
|
+
const primaryIcon = palette.buttonIcon || primaryText;
|
|
16
|
+
const secondaryBackground =
|
|
17
|
+
palette.buttonBackgroundSecondary || palette.white;
|
|
18
|
+
const secondaryBorder = palette.buttonBorderSecondary || palette.border;
|
|
19
|
+
const secondaryText = palette.buttonTextSecondary || palette.textSecondary;
|
|
20
|
+
const secondaryIcon = palette.buttonIconSecondary || secondaryText;
|
|
21
|
+
const disabledBackground =
|
|
22
|
+
palette.buttonDisabledBackground || secondaryBorder;
|
|
23
|
+
const disabledText = palette.buttonDisabledText || secondaryText;
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
primaryBackground,
|
|
27
|
+
primaryBorder,
|
|
28
|
+
primaryText,
|
|
29
|
+
primaryIcon,
|
|
30
|
+
secondaryBackground,
|
|
31
|
+
secondaryBorder,
|
|
32
|
+
secondaryText,
|
|
33
|
+
secondaryIcon,
|
|
34
|
+
disabledBackground,
|
|
35
|
+
disabledText,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// Aba dedicada ao vínculo da loja e ao status operacional remoto.
|
|
40
|
+
export default function Food99StoreTab({
|
|
41
|
+
shadowStyle,
|
|
42
|
+
accentColor,
|
|
43
|
+
statusRows,
|
|
44
|
+
lastMenuPublishState,
|
|
45
|
+
publicationTone,
|
|
46
|
+
publishStateLabel,
|
|
47
|
+
lastMenuTaskMessage,
|
|
48
|
+
lastErrorMessage,
|
|
49
|
+
actionLoading,
|
|
50
|
+
connected,
|
|
51
|
+
needsReconnect,
|
|
52
|
+
isOnline,
|
|
53
|
+
onRefresh,
|
|
54
|
+
onConnect,
|
|
55
|
+
onToggleStatus,
|
|
56
|
+
onSyncOrders,
|
|
57
|
+
onSyncTodayHistory,
|
|
58
|
+
manualShopId,
|
|
59
|
+
setManualShopId,
|
|
60
|
+
onManualBind,
|
|
61
|
+
onDisconnect,
|
|
62
|
+
palette = colors,
|
|
63
|
+
}) {
|
|
64
|
+
const buttonPalette = resolveButtonPalette(palette, accentColor);
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<>
|
|
68
|
+
<View style={[styles.panel, shadowStyle]}>
|
|
69
|
+
<View style={styles.panelHeader}>
|
|
70
|
+
<Text style={styles.panelTitle}>Status da loja</Text>
|
|
71
|
+
<TouchableOpacity
|
|
72
|
+
style={[
|
|
73
|
+
styles.inlineAction,
|
|
74
|
+
{
|
|
75
|
+
borderWidth: 1,
|
|
76
|
+
borderColor: buttonPalette.secondaryBorder,
|
|
77
|
+
backgroundColor: buttonPalette.secondaryBackground,
|
|
78
|
+
},
|
|
79
|
+
]}
|
|
80
|
+
onPress={onRefresh}
|
|
81
|
+
disabled={actionLoading === 'refresh'}>
|
|
82
|
+
<Icon
|
|
83
|
+
name="refresh-cw"
|
|
84
|
+
size={14}
|
|
85
|
+
color={buttonPalette.secondaryIcon}
|
|
86
|
+
/>
|
|
87
|
+
<Text
|
|
88
|
+
style={[
|
|
89
|
+
styles.inlineActionText,
|
|
90
|
+
{ color: buttonPalette.secondaryText },
|
|
91
|
+
]}>
|
|
92
|
+
Atualizar
|
|
93
|
+
</Text>
|
|
94
|
+
</TouchableOpacity>
|
|
95
|
+
</View>
|
|
96
|
+
|
|
97
|
+
{!!lastMenuPublishState && (
|
|
98
|
+
<View style={[styles.infoBanner, { backgroundColor: withOpacity(publicationTone, 0.12) }]}>
|
|
99
|
+
<Icon
|
|
100
|
+
name={
|
|
101
|
+
lastMenuPublishState === 'failed'
|
|
102
|
+
? 'alert-triangle'
|
|
103
|
+
: lastMenuPublishState === 'published'
|
|
104
|
+
? 'check-circle'
|
|
105
|
+
: 'clock'
|
|
106
|
+
}
|
|
107
|
+
size={14}
|
|
108
|
+
color={publicationTone}
|
|
109
|
+
/>
|
|
110
|
+
<Text style={[styles.infoBannerText, { color: publicationTone }]}>
|
|
111
|
+
{publishStateLabel}
|
|
112
|
+
{lastMenuTaskMessage ? ` • ${lastMenuTaskMessage}` : ''}
|
|
113
|
+
</Text>
|
|
114
|
+
</View>
|
|
115
|
+
)}
|
|
116
|
+
|
|
117
|
+
{!!lastErrorMessage && lastMenuPublishState !== 'failed' && (
|
|
118
|
+
<View style={styles.errorBanner}>
|
|
119
|
+
<Icon name="alert-circle" size={14} color={palette.error} />
|
|
120
|
+
<Text style={styles.errorBannerText}>{lastErrorMessage}</Text>
|
|
121
|
+
</View>
|
|
122
|
+
)}
|
|
123
|
+
|
|
124
|
+
{needsReconnect && (
|
|
125
|
+
<View style={[styles.infoBanner, { backgroundColor: withOpacity(palette.warning, 0.12) }]}>
|
|
126
|
+
<Icon name="alert-triangle" size={14} color={palette.warning} />
|
|
127
|
+
<Text style={[styles.infoBannerText, { color: palette.warning }]}>
|
|
128
|
+
A conexão remota da loja caiu. Refaça a reconexão para restaurar os webhooks.
|
|
129
|
+
</Text>
|
|
130
|
+
</View>
|
|
131
|
+
)}
|
|
132
|
+
|
|
133
|
+
<View style={styles.statusRows}>
|
|
134
|
+
{statusRows.map(row => (
|
|
135
|
+
<View
|
|
136
|
+
key={row.label}
|
|
137
|
+
style={[
|
|
138
|
+
styles.statusRowItem,
|
|
139
|
+
row.wide && styles.statusRowItemWide,
|
|
140
|
+
]}>
|
|
141
|
+
<Text style={styles.statusRowLabel}>{row.label}</Text>
|
|
142
|
+
<Text style={row.small ? styles.statusRowValueSmall : styles.statusRowValue}>{row.value}</Text>
|
|
143
|
+
</View>
|
|
144
|
+
))}
|
|
145
|
+
</View>
|
|
146
|
+
|
|
147
|
+
<View style={styles.actionRow}>
|
|
148
|
+
{!connected ? (
|
|
149
|
+
<TouchableOpacity
|
|
150
|
+
style={[
|
|
151
|
+
styles.primaryButton,
|
|
152
|
+
{
|
|
153
|
+
borderWidth: 1,
|
|
154
|
+
borderColor: buttonPalette.primaryBorder,
|
|
155
|
+
backgroundColor: buttonPalette.primaryBackground,
|
|
156
|
+
},
|
|
157
|
+
actionLoading === 'connect' && {
|
|
158
|
+
borderColor: buttonPalette.secondaryBorder,
|
|
159
|
+
backgroundColor: buttonPalette.disabledBackground,
|
|
160
|
+
},
|
|
161
|
+
]}
|
|
162
|
+
onPress={onConnect}
|
|
163
|
+
disabled={actionLoading === 'connect'}>
|
|
164
|
+
{actionLoading === 'connect' ? (
|
|
165
|
+
<ActivityIndicator
|
|
166
|
+
size="small"
|
|
167
|
+
color={buttonPalette.disabledText}
|
|
168
|
+
/>
|
|
169
|
+
) : (
|
|
170
|
+
<>
|
|
171
|
+
<Icon
|
|
172
|
+
name="link-2"
|
|
173
|
+
size={16}
|
|
174
|
+
color={buttonPalette.primaryIcon}
|
|
175
|
+
/>
|
|
176
|
+
<Text
|
|
177
|
+
style={[
|
|
178
|
+
styles.primaryButtonText,
|
|
179
|
+
{ color: buttonPalette.primaryText },
|
|
180
|
+
]}>
|
|
181
|
+
Integrar loja
|
|
182
|
+
</Text>
|
|
183
|
+
</>
|
|
184
|
+
)}
|
|
185
|
+
</TouchableOpacity>
|
|
186
|
+
) : (
|
|
187
|
+
<View style={styles.formRow}>
|
|
188
|
+
{needsReconnect && (
|
|
189
|
+
<TouchableOpacity
|
|
190
|
+
style={[
|
|
191
|
+
styles.secondaryActionButton,
|
|
192
|
+
{
|
|
193
|
+
flex: 1,
|
|
194
|
+
borderColor: buttonPalette.secondaryBorder,
|
|
195
|
+
backgroundColor: buttonPalette.secondaryBackground,
|
|
196
|
+
},
|
|
197
|
+
]}
|
|
198
|
+
onPress={onConnect}
|
|
199
|
+
disabled={actionLoading === 'connect'}>
|
|
200
|
+
{actionLoading === 'connect' ? (
|
|
201
|
+
<ActivityIndicator
|
|
202
|
+
size="small"
|
|
203
|
+
color={buttonPalette.disabledText}
|
|
204
|
+
/>
|
|
205
|
+
) : (
|
|
206
|
+
<>
|
|
207
|
+
<Icon
|
|
208
|
+
name="refresh-cw"
|
|
209
|
+
size={15}
|
|
210
|
+
color={buttonPalette.secondaryIcon}
|
|
211
|
+
/>
|
|
212
|
+
<Text
|
|
213
|
+
style={[
|
|
214
|
+
styles.secondaryActionButtonText,
|
|
215
|
+
{ color: buttonPalette.secondaryText },
|
|
216
|
+
]}>
|
|
217
|
+
Reconectar loja
|
|
218
|
+
</Text>
|
|
219
|
+
</>
|
|
220
|
+
)}
|
|
221
|
+
</TouchableOpacity>
|
|
222
|
+
)}
|
|
223
|
+
|
|
224
|
+
<TouchableOpacity
|
|
225
|
+
style={[
|
|
226
|
+
styles.primaryButton,
|
|
227
|
+
{
|
|
228
|
+
flex: 1,
|
|
229
|
+
borderWidth: 1,
|
|
230
|
+
borderColor: buttonPalette.primaryBorder,
|
|
231
|
+
backgroundColor: buttonPalette.primaryBackground,
|
|
232
|
+
},
|
|
233
|
+
(actionLoading === 'online' || actionLoading === 'offline') && {
|
|
234
|
+
borderColor: buttonPalette.secondaryBorder,
|
|
235
|
+
backgroundColor: buttonPalette.disabledBackground,
|
|
236
|
+
},
|
|
237
|
+
]}
|
|
238
|
+
onPress={onToggleStatus}
|
|
239
|
+
disabled={actionLoading === 'online' || actionLoading === 'offline'}>
|
|
240
|
+
{actionLoading === 'online' || actionLoading === 'offline' ? (
|
|
241
|
+
<ActivityIndicator
|
|
242
|
+
size="small"
|
|
243
|
+
color={buttonPalette.disabledText}
|
|
244
|
+
/>
|
|
245
|
+
) : (
|
|
246
|
+
<>
|
|
247
|
+
<Icon
|
|
248
|
+
name={isOnline ? 'pause-circle' : 'play-circle'}
|
|
249
|
+
size={16}
|
|
250
|
+
color={buttonPalette.primaryIcon}
|
|
251
|
+
/>
|
|
252
|
+
<Text
|
|
253
|
+
style={[
|
|
254
|
+
styles.primaryButtonText,
|
|
255
|
+
{ color: buttonPalette.primaryText },
|
|
256
|
+
]}>
|
|
257
|
+
{isOnline ? 'Colocar offline' : 'Colocar online'}
|
|
258
|
+
</Text>
|
|
259
|
+
</>
|
|
260
|
+
)}
|
|
261
|
+
</TouchableOpacity>
|
|
262
|
+
</View>
|
|
263
|
+
)}
|
|
264
|
+
</View>
|
|
265
|
+
|
|
266
|
+
{connected && (
|
|
267
|
+
<View style={styles.formRow}>
|
|
268
|
+
<TouchableOpacity
|
|
269
|
+
style={[
|
|
270
|
+
styles.secondaryActionButton,
|
|
271
|
+
{
|
|
272
|
+
flex: 1,
|
|
273
|
+
borderColor: buttonPalette.secondaryBorder,
|
|
274
|
+
backgroundColor: buttonPalette.secondaryBackground,
|
|
275
|
+
},
|
|
276
|
+
]}
|
|
277
|
+
onPress={onSyncOrders}
|
|
278
|
+
disabled={actionLoading === 'sync-orders'}>
|
|
279
|
+
{actionLoading === 'sync-orders' ? (
|
|
280
|
+
<ActivityIndicator
|
|
281
|
+
size="small"
|
|
282
|
+
color={buttonPalette.disabledText}
|
|
283
|
+
/>
|
|
284
|
+
) : (
|
|
285
|
+
<>
|
|
286
|
+
<Icon
|
|
287
|
+
name="refresh-cw"
|
|
288
|
+
size={15}
|
|
289
|
+
color={buttonPalette.secondaryIcon}
|
|
290
|
+
/>
|
|
291
|
+
<Text
|
|
292
|
+
style={[
|
|
293
|
+
styles.secondaryActionButtonText,
|
|
294
|
+
{ color: buttonPalette.secondaryText },
|
|
295
|
+
]}>
|
|
296
|
+
Sincronizar pedidos
|
|
297
|
+
</Text>
|
|
298
|
+
</>
|
|
299
|
+
)}
|
|
300
|
+
</TouchableOpacity>
|
|
301
|
+
|
|
302
|
+
<TouchableOpacity
|
|
303
|
+
style={[
|
|
304
|
+
styles.secondaryActionButton,
|
|
305
|
+
{
|
|
306
|
+
flex: 1,
|
|
307
|
+
borderColor: buttonPalette.secondaryBorder,
|
|
308
|
+
backgroundColor: buttonPalette.secondaryBackground,
|
|
309
|
+
},
|
|
310
|
+
]}
|
|
311
|
+
onPress={onSyncTodayHistory}
|
|
312
|
+
disabled={actionLoading === 'sync-history'}>
|
|
313
|
+
{actionLoading === 'sync-history' ? (
|
|
314
|
+
<ActivityIndicator
|
|
315
|
+
size="small"
|
|
316
|
+
color={buttonPalette.disabledText}
|
|
317
|
+
/>
|
|
318
|
+
) : (
|
|
319
|
+
<>
|
|
320
|
+
<Icon
|
|
321
|
+
name="clock"
|
|
322
|
+
size={15}
|
|
323
|
+
color={buttonPalette.secondaryIcon}
|
|
324
|
+
/>
|
|
325
|
+
<Text
|
|
326
|
+
style={[
|
|
327
|
+
styles.secondaryActionButtonText,
|
|
328
|
+
{ color: buttonPalette.secondaryText },
|
|
329
|
+
]}>
|
|
330
|
+
Histórico de hoje
|
|
331
|
+
</Text>
|
|
332
|
+
</>
|
|
333
|
+
)}
|
|
334
|
+
</TouchableOpacity>
|
|
335
|
+
</View>
|
|
336
|
+
)}
|
|
337
|
+
</View>
|
|
338
|
+
|
|
339
|
+
<View style={[styles.panel, shadowStyle]}>
|
|
340
|
+
<View style={styles.panelHeader}>
|
|
341
|
+
<View>
|
|
342
|
+
<Text style={styles.panelTitle}>Conexao da loja</Text>
|
|
343
|
+
<Text style={styles.panelSubtitle}>
|
|
344
|
+
Separei o vínculo manual e a desconexão para não misturar com as configurações operacionais.
|
|
345
|
+
</Text>
|
|
346
|
+
</View>
|
|
347
|
+
</View>
|
|
348
|
+
|
|
349
|
+
{!connected ? (
|
|
350
|
+
<>
|
|
351
|
+
<View style={styles.formField}>
|
|
352
|
+
<Text style={styles.formLabel}>Conectar manualmente por shop_id</Text>
|
|
353
|
+
<TextInput
|
|
354
|
+
value={manualShopId}
|
|
355
|
+
onChangeText={setManualShopId}
|
|
356
|
+
placeholder="Informe o shop_id da 99Food"
|
|
357
|
+
style={styles.formInput}
|
|
358
|
+
placeholderTextColor={palette.textSecondary}
|
|
359
|
+
/>
|
|
360
|
+
</View>
|
|
361
|
+
|
|
362
|
+
<View style={styles.formRow}>
|
|
363
|
+
<TouchableOpacity
|
|
364
|
+
style={[
|
|
365
|
+
styles.secondaryActionButton,
|
|
366
|
+
{
|
|
367
|
+
borderColor: buttonPalette.secondaryBorder,
|
|
368
|
+
backgroundColor: buttonPalette.secondaryBackground,
|
|
369
|
+
},
|
|
370
|
+
]}
|
|
371
|
+
onPress={onManualBind}
|
|
372
|
+
disabled={actionLoading === 'bind-manual'}>
|
|
373
|
+
{actionLoading === 'bind-manual' ? (
|
|
374
|
+
<ActivityIndicator
|
|
375
|
+
size="small"
|
|
376
|
+
color={buttonPalette.disabledText}
|
|
377
|
+
/>
|
|
378
|
+
) : (
|
|
379
|
+
<>
|
|
380
|
+
<Icon
|
|
381
|
+
name="link"
|
|
382
|
+
size={15}
|
|
383
|
+
color={buttonPalette.secondaryIcon}
|
|
384
|
+
/>
|
|
385
|
+
<Text
|
|
386
|
+
style={[
|
|
387
|
+
styles.secondaryActionButtonText,
|
|
388
|
+
{ color: buttonPalette.secondaryText },
|
|
389
|
+
]}>
|
|
390
|
+
Vincular shop_id
|
|
391
|
+
</Text>
|
|
392
|
+
</>
|
|
393
|
+
)}
|
|
394
|
+
</TouchableOpacity>
|
|
395
|
+
</View>
|
|
396
|
+
</>
|
|
397
|
+
) : (
|
|
398
|
+
<View style={styles.formRow}>
|
|
399
|
+
<TouchableOpacity
|
|
400
|
+
style={[styles.secondaryActionButton, styles.dangerActionButton]}
|
|
401
|
+
onPress={onDisconnect}
|
|
402
|
+
disabled={actionLoading === 'disconnect'}>
|
|
403
|
+
{actionLoading === 'disconnect' ? (
|
|
404
|
+
<ActivityIndicator size="small" color={palette.error} />
|
|
405
|
+
) : (
|
|
406
|
+
<>
|
|
407
|
+
<Icon name="unlink" size={15} color={palette.error} />
|
|
408
|
+
<Text style={[styles.secondaryActionButtonText, { color: palette.error }]}>Desconectar</Text>
|
|
409
|
+
</>
|
|
410
|
+
)}
|
|
411
|
+
</TouchableOpacity>
|
|
412
|
+
</View>
|
|
413
|
+
)}
|
|
414
|
+
</View>
|
|
415
|
+
</>
|
|
416
|
+
);
|
|
417
|
+
}
|