ordering-ui-admin-external 1.26.1 → 1.27.0
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/_bundles/{ordering-ui-admin.45097ebbca4f4a7d30b7.js → ordering-ui-admin.23772e51e498fa009f98.js} +2 -2
- package/_modules/components/Delivery/UserFormDetails/index.js +38 -3
- package/_modules/components/Delivery/UserFormDetails/styles.js +10 -3
- package/_modules/components/MyProducts/OrderingWebsite/index.js +3 -0
- package/_modules/components/Orders/DeliveriesLocation/index.js +4 -4
- package/_modules/components/Orders/OrderNotification/index.js +2 -0
- package/_modules/components/Settings/BacCredomatic/index.js +200 -0
- package/_modules/components/Settings/BacCredomatic/styles.js +111 -0
- package/_modules/components/Settings/IntegrationListing/Analytics.js +5 -2
- package/_modules/components/Settings/IntegrationListing/PaymentGateway.js +22 -4
- package/_modules/components/Settings/IntegrationListing/index.js +10 -2
- package/_modules/components/Settings/index.js +7 -0
- package/_modules/components/Shared/ImageCrop/index.js +7 -1
- package/_modules/components/Stores/BusinessQRCodeOption/index.js +9 -4
- package/_modules/components/Stores/BusinessQRCodeOption/styles.js +8 -4
- package/index-template.js +1 -1
- package/package.json +2 -2
- package/src/components/Delivery/UserFormDetails/index.js +34 -2
- package/src/components/Delivery/UserFormDetails/styles.js +27 -0
- package/src/components/MyProducts/OrderingWebsite/index.js +3 -0
- package/src/components/Orders/DeliveriesLocation/index.js +5 -6
- package/src/components/Orders/OrderNotification/index.js +1 -0
- package/src/components/Settings/BacCredomatic/index.js +213 -0
- package/src/components/Settings/BacCredomatic/styles.js +344 -0
- package/src/components/Settings/IntegrationListing/Analytics.js +5 -2
- package/src/components/Settings/IntegrationListing/PaymentGateway.js +20 -2
- package/src/components/Settings/IntegrationListing/index.js +10 -2
- package/src/components/Settings/index.js +2 -0
- package/src/components/Shared/ImageCrop/index.js +9 -3
- package/src/components/Stores/BusinessQRCodeOption/index.js +28 -11
- package/src/components/Stores/BusinessQRCodeOption/styles.js +9 -1
- /package/_bundles/{ordering-ui-admin.45097ebbca4f4a7d30b7.js.LICENSE.txt → ordering-ui-admin.23772e51e498fa009f98.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const DoordashConnectContainer = styled.div`
|
|
4
|
+
padding: 26px 20px;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
width: 100%;
|
|
7
|
+
overflow-x: hidden;
|
|
8
|
+
position: relative;
|
|
9
|
+
|
|
10
|
+
button.all-setting {
|
|
11
|
+
height: 44px;
|
|
12
|
+
user-select: none;
|
|
13
|
+
margin-top: 36px;
|
|
14
|
+
span {
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
font-size: 14px;
|
|
17
|
+
}
|
|
18
|
+
svg {
|
|
19
|
+
margin-left: 5px;
|
|
20
|
+
transition: 0.2s linear;
|
|
21
|
+
${props => props.theme.rtl && css`
|
|
22
|
+
margin-right: 5px;
|
|
23
|
+
margin-left: 0px;
|
|
24
|
+
`}
|
|
25
|
+
}
|
|
26
|
+
&:hover {
|
|
27
|
+
svg {
|
|
28
|
+
transform: translateX(3px);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media (min-width: 768px) {
|
|
34
|
+
padding: 26px 40px;
|
|
35
|
+
}
|
|
36
|
+
`
|
|
37
|
+
|
|
38
|
+
export const Header = styled.div`
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: space-between;
|
|
41
|
+
align-items: center;
|
|
42
|
+
margin-bottom: 30px;
|
|
43
|
+
|
|
44
|
+
${props => props.theme?.rtl ? css`
|
|
45
|
+
margin-left: 35px;
|
|
46
|
+
` : css`
|
|
47
|
+
margin-right: 35px;
|
|
48
|
+
`}
|
|
49
|
+
|
|
50
|
+
h1 {
|
|
51
|
+
font-size: 20px;
|
|
52
|
+
font-weight: 700;
|
|
53
|
+
margin: 0px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
button {
|
|
57
|
+
height: 42px;
|
|
58
|
+
}
|
|
59
|
+
`
|
|
60
|
+
|
|
61
|
+
export const ApiKeysListTable = styled.table`
|
|
62
|
+
width: 100%;
|
|
63
|
+
margin-top: 25px;
|
|
64
|
+
|
|
65
|
+
thead {
|
|
66
|
+
border-bottom: 1px solid ${props => props.theme.colors.secundaryLight};
|
|
67
|
+
th {
|
|
68
|
+
padding: 10px 0;
|
|
69
|
+
&:last-child {
|
|
70
|
+
padding-left: 20px;
|
|
71
|
+
padding-right: 20px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
tr {
|
|
76
|
+
width: 100%;
|
|
77
|
+
th,
|
|
78
|
+
td {
|
|
79
|
+
font-size: 12px;
|
|
80
|
+
word-break: break-all;
|
|
81
|
+
|
|
82
|
+
&:last-child {
|
|
83
|
+
width: 100px;
|
|
84
|
+
> div {
|
|
85
|
+
padding-left: 20px;
|
|
86
|
+
padding-right: 20px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
tbody {
|
|
93
|
+
border-bottom: 1px solid ${props => props.theme.colors.borderColor};
|
|
94
|
+
td {
|
|
95
|
+
padding-top: 9px;
|
|
96
|
+
padding-bottom: 9px;
|
|
97
|
+
|
|
98
|
+
&:last-child {
|
|
99
|
+
> div {
|
|
100
|
+
display: flex;
|
|
101
|
+
justify-content: flex-end;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
`
|
|
107
|
+
|
|
108
|
+
export const DropdownButtonWrapper = styled.div`
|
|
109
|
+
${props => props?.theme?.rtl ? css`
|
|
110
|
+
border-right: 1px solid ${props => props.theme.colors.borderColor};
|
|
111
|
+
` : css`
|
|
112
|
+
border-left: 1px solid ${props => props.theme.colors.borderColor};
|
|
113
|
+
`}
|
|
114
|
+
padding: 5px 20px;
|
|
115
|
+
button {
|
|
116
|
+
background: transparent !important;
|
|
117
|
+
border: none;
|
|
118
|
+
padding: 0px;
|
|
119
|
+
&:active,
|
|
120
|
+
&:focus {
|
|
121
|
+
border-color: unset !important;
|
|
122
|
+
box-shadow: none !important;
|
|
123
|
+
}
|
|
124
|
+
svg {
|
|
125
|
+
color: ${props => props.theme.colors.headingColor};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&:after {
|
|
129
|
+
display: none;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.show {
|
|
134
|
+
button {
|
|
135
|
+
background: ${props => props.theme.colors.secundary} !important;
|
|
136
|
+
border-color: unset !important;
|
|
137
|
+
box-shadow: none !important;
|
|
138
|
+
}
|
|
139
|
+
>div {
|
|
140
|
+
border: 1px solid ${props => props.theme.colors.borderColor};
|
|
141
|
+
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
> div {
|
|
146
|
+
> div {
|
|
147
|
+
border-radius: 8px;
|
|
148
|
+
.dropdown-item {
|
|
149
|
+
font-size: 12px;
|
|
150
|
+
color: ${props => props.theme.colors.headingColor};
|
|
151
|
+
}
|
|
152
|
+
.dropdown-item:last-child {
|
|
153
|
+
color: #E63757;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
`
|
|
158
|
+
export const AddNewButton = styled.div`
|
|
159
|
+
cursor: pointer;
|
|
160
|
+
font-size: 12px;
|
|
161
|
+
color: ${props => props.theme.colors.lightGray};
|
|
162
|
+
margin: 20px 0;
|
|
163
|
+
width: fit-content;
|
|
164
|
+
|
|
165
|
+
&:hover {
|
|
166
|
+
color: ${props => props.theme.colors.primary};
|
|
167
|
+
}
|
|
168
|
+
`
|
|
169
|
+
|
|
170
|
+
export const AllSetting = styled.div`
|
|
171
|
+
user-select: none;
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
margin-top: 36px;
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
span {
|
|
176
|
+
font-weight: 600;
|
|
177
|
+
font-size: 14px;
|
|
178
|
+
color: ${props => props.theme.colors.primary};
|
|
179
|
+
}
|
|
180
|
+
svg {
|
|
181
|
+
color: ${props => props.theme.colors.primary};
|
|
182
|
+
margin-left: 5px;
|
|
183
|
+
transition: 0.2s linear;
|
|
184
|
+
${props => props.theme.rtl && css`
|
|
185
|
+
margin-right: 5px;
|
|
186
|
+
margin-left: 0px;
|
|
187
|
+
`}
|
|
188
|
+
}
|
|
189
|
+
&:hover {
|
|
190
|
+
svg {
|
|
191
|
+
transform: translateX(3px);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
`
|
|
195
|
+
|
|
196
|
+
export const Description = styled.p`
|
|
197
|
+
margin-top: 40px;
|
|
198
|
+
font-size: 14px;
|
|
199
|
+
margin-bottom: 0px;
|
|
200
|
+
text-align: justify;
|
|
201
|
+
|
|
202
|
+
@media (min-width: 768px) {
|
|
203
|
+
text-align: initial;
|
|
204
|
+
}
|
|
205
|
+
`
|
|
206
|
+
|
|
207
|
+
export const CategoryExtraContent = styled.div`
|
|
208
|
+
position: relative;
|
|
209
|
+
padding: 26px 26px 60px 26px;
|
|
210
|
+
box-sizing: border-box;
|
|
211
|
+
width: 100%;
|
|
212
|
+
overflow: auto;
|
|
213
|
+
|
|
214
|
+
${props => props.theme?.rtl ? css`
|
|
215
|
+
border-right: 1px solid #E9ECEF;
|
|
216
|
+
` : css`
|
|
217
|
+
border-left: 1px solid #E9ECEF;
|
|
218
|
+
`}
|
|
219
|
+
|
|
220
|
+
> button {
|
|
221
|
+
z-index: 100;
|
|
222
|
+
position: absolute;
|
|
223
|
+
top: 25px;
|
|
224
|
+
${props => props.theme?.rtl ? css`
|
|
225
|
+
left: 20px;
|
|
226
|
+
` : css`
|
|
227
|
+
right: 20px;
|
|
228
|
+
`}
|
|
229
|
+
}
|
|
230
|
+
`
|
|
231
|
+
|
|
232
|
+
export const Container = styled.div`
|
|
233
|
+
display: flex;
|
|
234
|
+
width: 0;
|
|
235
|
+
position: fixed;
|
|
236
|
+
box-shadow: -4px 0px 7px #ccc;
|
|
237
|
+
|
|
238
|
+
${({ isDriverOrders }) => isDriverOrders && css`
|
|
239
|
+
position: absolute;
|
|
240
|
+
box-shadow: none;
|
|
241
|
+
|
|
242
|
+
${props => props.theme?.rtl ? css`
|
|
243
|
+
border-right: 1px solid #CCC;
|
|
244
|
+
` : css`
|
|
245
|
+
border-left: 1px solid #CCC;
|
|
246
|
+
`}
|
|
247
|
+
`}
|
|
248
|
+
background: ${props => props.theme.colors?.backgroundPage || '#FFF'};
|
|
249
|
+
height: calc(var(--vh, 1vh) * 100);
|
|
250
|
+
top: 0px;
|
|
251
|
+
z-index: 1001;
|
|
252
|
+
overflow-x: hidden;
|
|
253
|
+
transition: 0.3s;
|
|
254
|
+
|
|
255
|
+
${props => props.theme?.rtl ? css`
|
|
256
|
+
left: 0px;
|
|
257
|
+
` : css`
|
|
258
|
+
right: 0px;
|
|
259
|
+
`}
|
|
260
|
+
@media print {
|
|
261
|
+
box-shadow: none;
|
|
262
|
+
}
|
|
263
|
+
`
|
|
264
|
+
|
|
265
|
+
export const DescriptionHeader = styled.div`
|
|
266
|
+
display: flex;
|
|
267
|
+
justify-content: flex-end;
|
|
268
|
+
align-items: center;
|
|
269
|
+
`
|
|
270
|
+
|
|
271
|
+
export const HeaderIcons = styled.div`
|
|
272
|
+
display: flex;
|
|
273
|
+
position: absolute;
|
|
274
|
+
top: 25px;
|
|
275
|
+
right: 20px;
|
|
276
|
+
|
|
277
|
+
> button:first-child {
|
|
278
|
+
${props => props.theme?.rtl ? css`
|
|
279
|
+
margin-left: 8px;
|
|
280
|
+
` : css`
|
|
281
|
+
margin-right: 8px;
|
|
282
|
+
`}
|
|
283
|
+
}
|
|
284
|
+
`
|
|
285
|
+
|
|
286
|
+
export const SettingListConatiner = styled.div`
|
|
287
|
+
width: 100%;
|
|
288
|
+
margin: 20px 0;
|
|
289
|
+
border-bottom: 1px solid #E9ECEF;
|
|
290
|
+
`
|
|
291
|
+
|
|
292
|
+
export const Tab = styled.div`
|
|
293
|
+
user-select: none;
|
|
294
|
+
padding: 10px 0px;
|
|
295
|
+
cursor: pointer;
|
|
296
|
+
color: ${props => props.theme.colors?.headingColor};
|
|
297
|
+
font-size: 14px;
|
|
298
|
+
white-space: nowrap;
|
|
299
|
+
${props => props.theme?.rtl ? css`
|
|
300
|
+
margin-left: 30px;
|
|
301
|
+
` : css`
|
|
302
|
+
margin-right: 30px;
|
|
303
|
+
`}
|
|
304
|
+
|
|
305
|
+
${({ active }) => active && css`
|
|
306
|
+
border-bottom: 2px solid;
|
|
307
|
+
font-weight: 500;
|
|
308
|
+
`}
|
|
309
|
+
|
|
310
|
+
${({ active }) => !active && css`
|
|
311
|
+
color: #909BA9;
|
|
312
|
+
`}
|
|
313
|
+
`
|
|
314
|
+
|
|
315
|
+
export const Paragraph = styled.div`
|
|
316
|
+
margin-top: 20px;
|
|
317
|
+
h3{
|
|
318
|
+
font-size: 16px;
|
|
319
|
+
}
|
|
320
|
+
p{
|
|
321
|
+
white-space: pre-line;
|
|
322
|
+
font-size: 12px;
|
|
323
|
+
margin: 0;
|
|
324
|
+
}
|
|
325
|
+
span {
|
|
326
|
+
font-size: 12px;
|
|
327
|
+
}
|
|
328
|
+
a {
|
|
329
|
+
text-decoration: underline !important;
|
|
330
|
+
cursor: pointer;
|
|
331
|
+
font-size: 12px;
|
|
332
|
+
color: ${props => props.theme.colors.primary} !important;
|
|
333
|
+
}
|
|
334
|
+
.bold {
|
|
335
|
+
font-weight: 600;
|
|
336
|
+
}
|
|
337
|
+
`
|
|
338
|
+
|
|
339
|
+
export const PurchaseWrapper = styled.div`
|
|
340
|
+
button {
|
|
341
|
+
border-radius: 5px;
|
|
342
|
+
}
|
|
343
|
+
margin-top: 15px;
|
|
344
|
+
`
|
|
@@ -14,7 +14,9 @@ import {
|
|
|
14
14
|
|
|
15
15
|
const AnalyticsUI = (props) => {
|
|
16
16
|
const {
|
|
17
|
-
categoryList
|
|
17
|
+
categoryList,
|
|
18
|
+
showOption,
|
|
19
|
+
setShowOption
|
|
18
20
|
} = props
|
|
19
21
|
|
|
20
22
|
const [, t] = useLanguage()
|
|
@@ -49,6 +51,7 @@ const AnalyticsUI = (props) => {
|
|
|
49
51
|
|
|
50
52
|
const handleOpenSetting = (category, initialRender) => {
|
|
51
53
|
setSelectedCategory(category)
|
|
54
|
+
setShowOption('analytics')
|
|
52
55
|
setShowDetail(true)
|
|
53
56
|
if (!initialRender) {
|
|
54
57
|
history.replace(`${location.pathname}?category=${category?.id}`)
|
|
@@ -104,7 +107,7 @@ const AnalyticsUI = (props) => {
|
|
|
104
107
|
))}
|
|
105
108
|
</SettingList>
|
|
106
109
|
)}
|
|
107
|
-
{showDetail && (
|
|
110
|
+
{showDetail && showOption === 'analytics' && (
|
|
108
111
|
<SettingsDetail
|
|
109
112
|
{...props}
|
|
110
113
|
open={showDetail}
|
|
@@ -11,10 +11,15 @@ import {
|
|
|
11
11
|
IconWrapper,
|
|
12
12
|
SettingItemContent
|
|
13
13
|
} from './styles'
|
|
14
|
+
import { BacCredomatic } from '../BacCredomatic'
|
|
14
15
|
|
|
15
16
|
const PaymentGatewayUI = (props) => {
|
|
16
17
|
const {
|
|
17
|
-
categoryList
|
|
18
|
+
categoryList,
|
|
19
|
+
showOption,
|
|
20
|
+
setShowOption,
|
|
21
|
+
handleCloseSettings,
|
|
22
|
+
handleOpenBasicSetting
|
|
18
23
|
} = props
|
|
19
24
|
|
|
20
25
|
const [, t] = useLanguage()
|
|
@@ -48,6 +53,7 @@ const PaymentGatewayUI = (props) => {
|
|
|
48
53
|
|
|
49
54
|
const handleOpenSetting = (category, initialRender) => {
|
|
50
55
|
setSelectedCategory(category)
|
|
56
|
+
setShowOption('payment-gateway')
|
|
51
57
|
setShowDetail(true)
|
|
52
58
|
if (!initialRender) {
|
|
53
59
|
history.replace(`${location.pathname}?category=${category?.id}`)
|
|
@@ -84,6 +90,17 @@ const PaymentGatewayUI = (props) => {
|
|
|
84
90
|
</SettingItemContent>
|
|
85
91
|
</SettingItemContainer>
|
|
86
92
|
))}
|
|
93
|
+
<SettingItemContainer
|
|
94
|
+
onClick={() => handleOpenBasicSetting('bac_credomatic')}
|
|
95
|
+
>
|
|
96
|
+
<IconWrapper>
|
|
97
|
+
<GearFill />
|
|
98
|
+
</IconWrapper>
|
|
99
|
+
<SettingItemContent>
|
|
100
|
+
<h5>{t('BAC_CREDOMATIC', 'BAC Credomatic')}</h5>
|
|
101
|
+
<p dangerouslySetInnerHTML={{ __html: t('BAC_CREDOMATIC_DESCRIPTION', 'Accept payments in Central America') }} />
|
|
102
|
+
</SettingItemContent>
|
|
103
|
+
</SettingItemContainer>
|
|
87
104
|
</SettingList>
|
|
88
105
|
)}
|
|
89
106
|
{categoryList?.loading && (
|
|
@@ -103,7 +120,7 @@ const PaymentGatewayUI = (props) => {
|
|
|
103
120
|
))}
|
|
104
121
|
</SettingList>
|
|
105
122
|
)}
|
|
106
|
-
{showDetail && (
|
|
123
|
+
{showDetail && showOption === 'payment-gateway' && (
|
|
107
124
|
<SettingsDetail
|
|
108
125
|
{...props}
|
|
109
126
|
open={showDetail}
|
|
@@ -112,6 +129,7 @@ const PaymentGatewayUI = (props) => {
|
|
|
112
129
|
onBasicSettingsRedirect={onBasicSettingsRedirect}
|
|
113
130
|
/>
|
|
114
131
|
)}
|
|
132
|
+
{showOption === 'bac_credomatic' && <BacCredomatic onClose={() => handleCloseSettings()} />}
|
|
115
133
|
</CategorySection>
|
|
116
134
|
)
|
|
117
135
|
}
|
|
@@ -227,10 +227,18 @@ export const IntegrationListing = (props) => {
|
|
|
227
227
|
</SettingList>
|
|
228
228
|
</CategorySection>
|
|
229
229
|
<div style={{ order: selectedTab === 5 ? 1 : selectedTab }}>
|
|
230
|
-
<PaymentGateway
|
|
230
|
+
<PaymentGateway
|
|
231
|
+
showOption={showOption}
|
|
232
|
+
setShowOption={setShowOption}
|
|
233
|
+
handleCloseSettings={handleCloseSettings}
|
|
234
|
+
handleOpenBasicSetting={handleOpenSetting}
|
|
235
|
+
/>
|
|
231
236
|
</div>
|
|
232
237
|
<div style={{ order: selectedTab === 6 ? 1 : selectedTab }}>
|
|
233
|
-
<Analytics
|
|
238
|
+
<Analytics
|
|
239
|
+
showOption={showOption}
|
|
240
|
+
setShowOption={setShowOption}
|
|
241
|
+
/>
|
|
234
242
|
</div>
|
|
235
243
|
</CategorGroup>
|
|
236
244
|
</IntegrationsContainer>
|
|
@@ -15,6 +15,7 @@ import { NotificationSetting } from './NotificationSetting'
|
|
|
15
15
|
import { SettingsSelectUI } from './SettingsSelectUI'
|
|
16
16
|
import { SettingsCountryFilter } from './SettingsCountryFilter'
|
|
17
17
|
import { ApiKeysList } from './ApiKeysList'
|
|
18
|
+
import { BacCredomatic } from './BacCredomatic'
|
|
18
19
|
import { WebhookList } from './WebhookList'
|
|
19
20
|
import { PluginList } from './PluginList'
|
|
20
21
|
import { WebhookDelaySelector } from './WebhookDelaySelector'
|
|
@@ -49,6 +50,7 @@ export {
|
|
|
49
50
|
SettingsSelectUI,
|
|
50
51
|
SettingsCountryFilter,
|
|
51
52
|
ApiKeysList,
|
|
53
|
+
BacCredomatic,
|
|
52
54
|
WebhookList,
|
|
53
55
|
PluginList,
|
|
54
56
|
WebhookDelaySelector,
|
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
ActionContentWrapper,
|
|
14
14
|
ButtonWrapper
|
|
15
15
|
} from './styles'
|
|
16
|
+
import { Checkbox } from '../../../styles/Checkbox'
|
|
17
|
+
import Skeleton from 'react-loading-skeleton'
|
|
16
18
|
|
|
17
19
|
export const ImageCrop = (props) => {
|
|
18
20
|
const {
|
|
@@ -99,9 +101,13 @@ export const ImageCrop = (props) => {
|
|
|
99
101
|
|
|
100
102
|
return (
|
|
101
103
|
<Container>
|
|
102
|
-
|
|
103
|
-
<
|
|
104
|
-
|
|
104
|
+
{loading
|
|
105
|
+
? <Skeleton style={{ height: 400 }} />
|
|
106
|
+
: (
|
|
107
|
+
<ImageCropWrapper>
|
|
108
|
+
<img ref={cropperRef} src={photo} />
|
|
109
|
+
</ImageCropWrapper>
|
|
110
|
+
)}
|
|
105
111
|
<ImageCropActionWrapper>
|
|
106
112
|
<RangeWrapper>
|
|
107
113
|
<span className='title'>{t('RESIZE_IMAGE', 'Resize image')}</span>
|
|
@@ -12,7 +12,8 @@ import {
|
|
|
12
12
|
Header,
|
|
13
13
|
CloseButton,
|
|
14
14
|
FormControl,
|
|
15
|
-
QRCodeLayout
|
|
15
|
+
QRCodeLayout,
|
|
16
|
+
TableNumberHintText
|
|
16
17
|
} from './styles'
|
|
17
18
|
|
|
18
19
|
export const BusinessQRCodeOption = (props) => {
|
|
@@ -62,8 +63,8 @@ export const BusinessQRCodeOption = (props) => {
|
|
|
62
63
|
: `https://${ordering.project}.tryordering.com/store/${business?.slug}`
|
|
63
64
|
const tsNumber = item?.key !== 'pick_up'
|
|
64
65
|
? (item?.key === 'eat_in'
|
|
65
|
-
? `&
|
|
66
|
-
: `&
|
|
66
|
+
? `&table_number=${numberRef?.current?.value}`
|
|
67
|
+
: `&spot_number=${numberRef?.current?.value}`)
|
|
67
68
|
: ''
|
|
68
69
|
const compltedUrl = `${storeUrl}?order_type=${item.value}${tsNumber}`
|
|
69
70
|
setCode(compltedUrl)
|
|
@@ -109,6 +110,7 @@ export const BusinessQRCodeOption = (props) => {
|
|
|
109
110
|
<Close onClick={() => onClose && onClose()} />
|
|
110
111
|
</CloseButton>
|
|
111
112
|
</Header>
|
|
113
|
+
|
|
112
114
|
{code && (
|
|
113
115
|
<QRCodeLayout ref={printerRef}>
|
|
114
116
|
<QRCode
|
|
@@ -119,17 +121,31 @@ export const BusinessQRCodeOption = (props) => {
|
|
|
119
121
|
/>
|
|
120
122
|
</QRCodeLayout>
|
|
121
123
|
)}
|
|
124
|
+
|
|
122
125
|
{item?.key === 'pick_up' ? (
|
|
123
|
-
<
|
|
126
|
+
<h4>{t('GENERATE_QR_CODE', 'Generate QR Code')}</h4>
|
|
124
127
|
) : (
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
<>
|
|
129
|
+
{item?.key === 'eat_in' && code && (
|
|
130
|
+
<TableNumberHintText>
|
|
131
|
+
{t('TO_GENERATE_NEW_QR_CODE_UPDATE_TABLE_NUMBER', 'To generate new QR codes, update the table number and regenerate the code.')}
|
|
132
|
+
</TableNumberHintText>
|
|
133
|
+
)}
|
|
134
|
+
<FormControl>
|
|
135
|
+
<label>{item?.key === 'eat_in' ? t('TABLE_NUMBER', 'Table number') : t('SPOT_NUMBER', 'Spot number')}</label>
|
|
136
|
+
<Input
|
|
137
|
+
placeholder='0'
|
|
138
|
+
ref={numberRef}
|
|
139
|
+
onKeyPress={(e) => {
|
|
140
|
+
if (!/^[0-9.]$/.test(e.key)) {
|
|
141
|
+
e.preventDefault()
|
|
142
|
+
}
|
|
143
|
+
}}
|
|
144
|
+
/>
|
|
145
|
+
</FormControl>
|
|
146
|
+
</>
|
|
132
147
|
)}
|
|
148
|
+
|
|
133
149
|
<ButtonGroup>
|
|
134
150
|
<Button color='primary' outline onClick={generateQRCode}>
|
|
135
151
|
{t('GENERATE_CODE', 'Generate Code')}
|
|
@@ -147,6 +163,7 @@ export const BusinessQRCodeOption = (props) => {
|
|
|
147
163
|
removeAfterPrint
|
|
148
164
|
/>
|
|
149
165
|
</ButtonGroup>
|
|
166
|
+
|
|
150
167
|
<Alert
|
|
151
168
|
title={t('ORDERING', 'Ordering')}
|
|
152
169
|
content={alertState.content}
|
|
@@ -25,7 +25,7 @@ export const Container = styled.div`
|
|
|
25
25
|
border-left: 1px solid #E9ECEF;
|
|
26
26
|
`}
|
|
27
27
|
}
|
|
28
|
-
>
|
|
28
|
+
> h4 {
|
|
29
29
|
font-weight: 400;
|
|
30
30
|
font-size: 14px;
|
|
31
31
|
line-height: 24px;
|
|
@@ -111,3 +111,11 @@ export const FormControl = styled.div`
|
|
|
111
111
|
export const QRCodeLayout = styled.div`
|
|
112
112
|
margin-bottom: 20px;
|
|
113
113
|
`
|
|
114
|
+
|
|
115
|
+
export const TableNumberHintText = styled.span`
|
|
116
|
+
font-weight: 400;
|
|
117
|
+
font-size: 14px;
|
|
118
|
+
line-height: 18px;
|
|
119
|
+
margin-bottom: 15px;
|
|
120
|
+
color: ${props => props.theme.colors.lightGray};
|
|
121
|
+
`
|