ordering-ui-admin-external 1.17.0 → 1.19.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.6c1919d6b0356a2f522f.js → ordering-ui-admin.661a37246ac77dcc4edf.js} +2 -2
- package/_modules/components/Delivery/DeliveryUsersListing/index.js +4 -2
- package/_modules/components/Delivery/DriversGroupLogistics/index.js +1 -1
- package/_modules/components/Delivery/DriversGroupLogs/index.js +1 -0
- package/_modules/components/Delivery/UsersList/index.js +47 -51
- package/_modules/components/Delivery/UsersList/styles.js +6 -4
- package/_modules/components/Home/HomePage/index.js +7 -1
- package/_modules/components/Login/LoginForm/index.js +7 -1
- package/_modules/components/Marketing/EnterprisePromotionListing/index.js +1 -1
- package/_modules/components/Messages/MessagesListing/index.js +1 -1
- package/_modules/components/MyProducts/AdvancedSettings/ButtonShadow.js +98 -0
- package/_modules/components/MyProducts/AdvancedSettings/FontStyleGroup.js +28 -7
- package/_modules/components/MyProducts/AdvancedSettings/HideCheckBox.js +47 -0
- package/_modules/components/MyProducts/AdvancedSettings/ImageBox.js +12 -3
- package/_modules/components/MyProducts/AdvancedSettings/SettingComponent.js +15 -15
- package/_modules/components/MyProducts/AdvancedSettings/index.js +102 -117
- package/_modules/components/MyProducts/AppResources/index.js +132 -0
- package/_modules/components/MyProducts/OrderingWebsite/index.js +47 -2
- package/_modules/components/MyProducts/OrderingWebsite/styles.js +13 -3
- package/_modules/components/OrderingProducts/SiteTheme/index.js +13 -9
- package/_modules/components/Orders/DeliveriesManager/index.js +1 -1
- package/_modules/components/Orders/Messages/index.js +25 -94
- package/_modules/components/Orders/OrderBill/index.js +3 -3
- package/_modules/components/Orders/OrderNotification/index.js +4 -2
- package/_modules/components/Orders/OrdersManager/index.js +3 -1
- package/_modules/components/SidebarMenu/index.js +34 -33
- package/_modules/components/Stores/BusinessAdd/DeliveryZone/index.js +1 -1
- package/_modules/components/Stores/BusinessDeliveryZoneInformation/index.js +1 -1
- package/_modules/components/Stores/BusinessDetails/index.js +27 -8
- package/_modules/components/Stores/BusinessLocation/index.js +8 -7
- package/_modules/components/Stores/BusinessPlace/index.js +127 -0
- package/_modules/components/Stores/BusinessPlace/styles.js +55 -0
- package/_modules/components/Stores/BusinessPlaceGroup/index.js +258 -0
- package/_modules/components/Stores/BusinessPlaceGroup/styles.js +102 -0
- package/_modules/components/Stores/BusinessProductList/index.js +3 -3
- package/_modules/components/Stores/BusinessProductsListing/index.js +2 -1
- package/_modules/components/Stores/BusinessSummary/index.js +12 -3
- package/_modules/components/Stores/ProductStep/index.js +15 -3
- package/_modules/components/Stores/SpoonityApiKey/index.js +97 -0
- package/_modules/components/Stores/SpoonityApiKey/styles.js +47 -0
- package/_modules/components/Stores/UploadMenuGuide/index.js +8 -0
- package/_modules/components/Users/CustomerPointsWallet/index.js +126 -9
- package/_modules/components/Users/CustomerPointsWallet/styles.js +8 -4
- package/package.json +2 -2
- package/src/components/Delivery/DeliveryUsersListing/index.js +3 -1
- package/src/components/Delivery/DriversGroupLogistics/index.js +1 -1
- package/src/components/Delivery/DriversGroupLogs/index.js +2 -0
- package/src/components/Delivery/UsersList/index.js +79 -61
- package/src/components/Delivery/UsersList/styles.js +4 -12
- package/src/components/Home/HomePage/index.js +2 -2
- package/src/components/Login/LoginForm/index.js +4 -1
- package/src/components/Marketing/EnterprisePromotionListing/index.js +1 -1
- package/src/components/Messages/MessagesListing/index.js +1 -1
- package/src/components/MyProducts/AdvancedSettings/ButtonShadow.js +102 -0
- package/src/components/MyProducts/AdvancedSettings/FontStyleGroup.js +23 -5
- package/src/components/MyProducts/AdvancedSettings/HideCheckBox.js +33 -0
- package/src/components/MyProducts/AdvancedSettings/ImageBox.js +10 -3
- package/src/components/MyProducts/AdvancedSettings/SettingComponent.js +10 -15
- package/src/components/MyProducts/AdvancedSettings/index.js +119 -149
- package/src/components/MyProducts/AppResources/index.js +167 -0
- package/src/components/MyProducts/OrderingWebsite/index.js +66 -2
- package/src/components/MyProducts/OrderingWebsite/styles.js +37 -0
- package/src/components/OrderingProducts/SiteTheme/index.js +7 -3
- package/src/components/Orders/DeliveriesManager/index.js +1 -1
- package/src/components/Orders/Messages/index.js +56 -216
- package/src/components/Orders/OrderBill/index.js +6 -2
- package/src/components/Orders/OrderNotification/index.js +6 -2
- package/src/components/Orders/OrdersManager/index.js +1 -1
- package/src/components/SidebarMenu/index.js +8 -8
- package/src/components/Stores/BusinessAdd/DeliveryZone/index.js +1 -1
- package/src/components/Stores/BusinessDeliveryZoneInformation/index.js +1 -1
- package/src/components/Stores/BusinessDetails/index.js +24 -1
- package/src/components/Stores/BusinessLocation/index.js +2 -1
- package/src/components/Stores/BusinessPlace/index.js +137 -0
- package/src/components/Stores/BusinessPlace/styles.js +132 -0
- package/src/components/Stores/BusinessPlaceGroup/index.js +272 -0
- package/src/components/Stores/BusinessPlaceGroup/styles.js +248 -0
- package/src/components/Stores/BusinessProductList/index.js +9 -1
- package/src/components/Stores/BusinessProductsListing/index.js +1 -0
- package/src/components/Stores/BusinessSummary/index.js +16 -5
- package/src/components/Stores/ProductStep/index.js +19 -2
- package/src/components/Stores/SpoonityApiKey/index.js +87 -0
- package/src/components/Stores/SpoonityApiKey/styles.js +68 -0
- package/src/components/Stores/UploadMenuGuide/index.js +10 -1
- package/src/components/Users/CustomerPointsWallet/index.js +130 -2
- package/src/components/Users/CustomerPointsWallet/styles.js +40 -1
- /package/_bundles/{ordering-ui-admin.6c1919d6b0356a2f522f.js.LICENSE.txt → ordering-ui-admin.661a37246ac77dcc4edf.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
import { darken } from 'polished'
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div`
|
|
5
|
+
padding: 20px;
|
|
6
|
+
overflow: auto;
|
|
7
|
+
transition: 0.3s;
|
|
8
|
+
|
|
9
|
+
> button {
|
|
10
|
+
height: 42px;
|
|
11
|
+
width: 100%;
|
|
12
|
+
margin-top: 20px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@media (min-width: 1000px) {
|
|
16
|
+
max-width: 500px;
|
|
17
|
+
width: 0;
|
|
18
|
+
${props => props.theme?.rtl ? css`
|
|
19
|
+
border-right: 1px solid ${props => props.theme.colors.borderColor};
|
|
20
|
+
` : css`
|
|
21
|
+
border-left: 1px solid ${props => props.theme.colors.borderColor};
|
|
22
|
+
`}
|
|
23
|
+
}
|
|
24
|
+
`
|
|
25
|
+
|
|
26
|
+
export const Header = styled.div`
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
position: relative;
|
|
31
|
+
h1 {
|
|
32
|
+
font-size: 20px;
|
|
33
|
+
font-weight: 700;
|
|
34
|
+
margin: 5px 0;
|
|
35
|
+
color: ${props => props.theme.colors.headingColor};
|
|
36
|
+
|
|
37
|
+
${props => props.theme?.rtl ? css`
|
|
38
|
+
margin-left: 80px;
|
|
39
|
+
` : css`
|
|
40
|
+
margin-right: 80px;
|
|
41
|
+
`}
|
|
42
|
+
}
|
|
43
|
+
`
|
|
44
|
+
|
|
45
|
+
export const ActionBlock = styled.div`
|
|
46
|
+
background: ${props => props.theme.colors?.backgroundPage || '#FFF'};
|
|
47
|
+
position: absolute;
|
|
48
|
+
z-index: 1000;
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
> button {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
${props => props.theme?.rtl ? css`
|
|
56
|
+
left: 0px;
|
|
57
|
+
` : css`
|
|
58
|
+
right: 0px;
|
|
59
|
+
`}
|
|
60
|
+
|
|
61
|
+
@media (min-width: 1000px) {
|
|
62
|
+
> button {
|
|
63
|
+
display: block;
|
|
64
|
+
${props => props.theme?.rtl ? css`
|
|
65
|
+
margin-right: 10px;
|
|
66
|
+
` : css`
|
|
67
|
+
margin-left: 10px;
|
|
68
|
+
`}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
`
|
|
72
|
+
|
|
73
|
+
export const ActionSelectorWrapper = styled.div`
|
|
74
|
+
button {
|
|
75
|
+
display: flex;
|
|
76
|
+
background: transparent !important;
|
|
77
|
+
border: none;
|
|
78
|
+
padding: 5px;
|
|
79
|
+
border-radius: 8px;
|
|
80
|
+
|
|
81
|
+
&:active,
|
|
82
|
+
&:focus {
|
|
83
|
+
border-color: unset !important;
|
|
84
|
+
box-shadow: none !important;
|
|
85
|
+
}
|
|
86
|
+
svg {
|
|
87
|
+
color: ${props => props.theme.colors.headingColor};
|
|
88
|
+
font-size: 20px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&:after {
|
|
92
|
+
display: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:hover {
|
|
96
|
+
background: ${props => darken(0.04, props.theme.colors.secundary)} !important;
|
|
97
|
+
}
|
|
98
|
+
&:active {
|
|
99
|
+
background: ${props => darken(0.1, props.theme.colors.secundaryDarkContrast)} !important;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.show {
|
|
104
|
+
>div {
|
|
105
|
+
border: 1px solid ${props => props.theme.colors.borderColor};
|
|
106
|
+
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
> div {
|
|
111
|
+
> div {
|
|
112
|
+
border-radius: 8px;
|
|
113
|
+
.dropdown-item {
|
|
114
|
+
font-size: 12px;
|
|
115
|
+
color: ${props => props.theme.colors.headingColor};
|
|
116
|
+
padding: 7px 20px;
|
|
117
|
+
&:active {
|
|
118
|
+
background: ${props => darken(0.1, props.theme.colors.secundary)} !important;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
.dropdown-item:last-child {
|
|
122
|
+
color: ${props => props.theme.colors.danger};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
`
|
|
127
|
+
|
|
128
|
+
export const Content = styled.form`
|
|
129
|
+
margin-top: 30px;
|
|
130
|
+
label {
|
|
131
|
+
font-weight: 400;
|
|
132
|
+
font-size: 14px;
|
|
133
|
+
margin-bottom: 10px;
|
|
134
|
+
}
|
|
135
|
+
input {
|
|
136
|
+
height: 44px;
|
|
137
|
+
width: 100%;
|
|
138
|
+
}
|
|
139
|
+
`
|
|
140
|
+
|
|
141
|
+
export const ButtonWrapper = styled.div`
|
|
142
|
+
position: sticky;
|
|
143
|
+
top: 100%;
|
|
144
|
+
|
|
145
|
+
button {
|
|
146
|
+
height: 44px;
|
|
147
|
+
}
|
|
148
|
+
`
|
|
149
|
+
|
|
150
|
+
export const HideSubmitBtn = styled.button`
|
|
151
|
+
display: none;
|
|
152
|
+
`
|
|
153
|
+
|
|
154
|
+
export const OptionList = styled.div`
|
|
155
|
+
margin-top: 35px;
|
|
156
|
+
`
|
|
157
|
+
|
|
158
|
+
export const AddBtn = styled.span`
|
|
159
|
+
font-weight: 400;
|
|
160
|
+
font-size: 14px;
|
|
161
|
+
display: block;
|
|
162
|
+
margin: 10px 0px;
|
|
163
|
+
cursor: pointer;
|
|
164
|
+
user-select: none;
|
|
165
|
+
color: ${props => props.theme.colors.lightGray};
|
|
166
|
+
transition: color 0.2s ease;
|
|
167
|
+
|
|
168
|
+
&:hover {
|
|
169
|
+
color: ${props => props.theme.colors.primary};
|
|
170
|
+
}
|
|
171
|
+
`
|
|
172
|
+
|
|
173
|
+
export const CheckWrapper = styled.div`
|
|
174
|
+
display: flex;
|
|
175
|
+
align-items: center;
|
|
176
|
+
|
|
177
|
+
.check-box {
|
|
178
|
+
cursor: pointer !important;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
span {
|
|
182
|
+
svg {
|
|
183
|
+
cursor: pointer !important;
|
|
184
|
+
font-size: 16px;
|
|
185
|
+
color: ${props => props.theme.colors.secundaryLight};
|
|
186
|
+
|
|
187
|
+
&.active {
|
|
188
|
+
color: ${props => props.theme.colors.primary};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
> label {
|
|
194
|
+
margin-bottom: 0;
|
|
195
|
+
display: flex;
|
|
196
|
+
align-items: center;
|
|
197
|
+
font-size: 14px;
|
|
198
|
+
margin-left: 20px;
|
|
199
|
+
${props => props.theme.rtl && css`
|
|
200
|
+
margin-right: 20px;
|
|
201
|
+
margin-left: 0px;
|
|
202
|
+
`}
|
|
203
|
+
}
|
|
204
|
+
`
|
|
205
|
+
|
|
206
|
+
export const PlaceItemContainer = styled.div`
|
|
207
|
+
display: flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
padding: 12px 0;
|
|
210
|
+
border-bottom: 1px solid ${props => props.theme.colors.borderColor};
|
|
211
|
+
border-top: 1px solid transparent;
|
|
212
|
+
justify-content: space-between;
|
|
213
|
+
transition: all 0.3s linear;
|
|
214
|
+
cursor: pointer;
|
|
215
|
+
|
|
216
|
+
&:hover {
|
|
217
|
+
background: ${props => props.theme.colors.secundary};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
${({ active }) => active && css`
|
|
221
|
+
background: ${props => props.theme.colors.backgroundInfo};
|
|
222
|
+
border-top: 1px solid ${props => props.theme.colors.primary};
|
|
223
|
+
border-bottom: 1px solid ${props => props.theme.colors.primary};
|
|
224
|
+
`}
|
|
225
|
+
|
|
226
|
+
${({ notAllow }) => notAllow && css`
|
|
227
|
+
cursor: not-allowed;
|
|
228
|
+
* {
|
|
229
|
+
cursor: not-allowed;
|
|
230
|
+
}
|
|
231
|
+
`}
|
|
232
|
+
|
|
233
|
+
> svg {
|
|
234
|
+
font-size: 16px;
|
|
235
|
+
color: ${props => props.theme.colors.secundaryLight};
|
|
236
|
+
}
|
|
237
|
+
`
|
|
238
|
+
|
|
239
|
+
export const TableHead = styled.div`
|
|
240
|
+
display: flex;
|
|
241
|
+
align-items: center;
|
|
242
|
+
padding-bottom: 8px;
|
|
243
|
+
border-bottom: 1px solid ${props => props.theme.colors.secundaryLight};
|
|
244
|
+
|
|
245
|
+
label {
|
|
246
|
+
font-weight: 700;
|
|
247
|
+
}
|
|
248
|
+
`
|
|
@@ -195,7 +195,7 @@ export const BusinessProductList = (props) => {
|
|
|
195
195
|
</ProductListContainer>
|
|
196
196
|
<ProductListBottom>
|
|
197
197
|
{
|
|
198
|
-
!businessState.loading && businessState?.business?.categories?.length > 0 && (
|
|
198
|
+
!businessState.loading && businessState?.business?.categories?.length > 0 && categorySelected && (
|
|
199
199
|
<AddProductBtn
|
|
200
200
|
onClick={() => handleParentProductAdd(true)}
|
|
201
201
|
>
|
|
@@ -224,6 +224,14 @@ export const BusinessProductList = (props) => {
|
|
|
224
224
|
</WrapperNotFound>
|
|
225
225
|
)
|
|
226
226
|
}
|
|
227
|
+
|
|
228
|
+
{
|
|
229
|
+
!businessState.loading && businessState?.business?.categories?.length > 0 && !categorySelected && (
|
|
230
|
+
<WrapperNotFound>
|
|
231
|
+
{t('SELECT_CATEGORY_BEFORE_PRODUCT', 'Please select a category before adding your products.')}
|
|
232
|
+
</WrapperNotFound>
|
|
233
|
+
)
|
|
234
|
+
}
|
|
227
235
|
</>
|
|
228
236
|
)}
|
|
229
237
|
|
|
@@ -37,7 +37,8 @@ export const BusinessSummary = (props) => {
|
|
|
37
37
|
handleSelectedItem,
|
|
38
38
|
handleDuplicateBusiness,
|
|
39
39
|
handleDeleteBusiness,
|
|
40
|
-
extraOpen
|
|
40
|
+
extraOpen,
|
|
41
|
+
spoonityConfig
|
|
41
42
|
} = props
|
|
42
43
|
const [, t] = useLanguage()
|
|
43
44
|
const [{ optimizeImage }] = useUtils()
|
|
@@ -58,7 +59,7 @@ export const BusinessSummary = (props) => {
|
|
|
58
59
|
window.open(`https://${ordering.project}.tryordering.com/store/${businessState?.business?.slug}`, '_blank')
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
const itemsExcluded = ['publishing']
|
|
62
|
+
const itemsExcluded = !!spoonityConfig ? ['publishing'] : ['publishing', 'spoonity_key']
|
|
62
63
|
|
|
63
64
|
const businessConfigs = [
|
|
64
65
|
{
|
|
@@ -124,6 +125,13 @@ export const BusinessSummary = (props) => {
|
|
|
124
125
|
{
|
|
125
126
|
key: 'webhooks',
|
|
126
127
|
value: t('WEBHOOKS', 'Webhooks')
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
key: 'places',
|
|
131
|
+
value: t('PLACES', 'Places')
|
|
132
|
+
}, {
|
|
133
|
+
key: 'spoonity_key',
|
|
134
|
+
value: t('SPOONITY_KEY', 'Sponity key')
|
|
127
135
|
}
|
|
128
136
|
]
|
|
129
137
|
|
|
@@ -177,7 +185,7 @@ export const BusinessSummary = (props) => {
|
|
|
177
185
|
<RightHeader>
|
|
178
186
|
<IconButton
|
|
179
187
|
disabled
|
|
180
|
-
|
|
188
|
+
// onClick={() => handleSelectedItem('support')}
|
|
181
189
|
>
|
|
182
190
|
<LifePreserver />
|
|
183
191
|
</IconButton>
|
|
@@ -271,7 +279,9 @@ export const BusinessSummary = (props) => {
|
|
|
271
279
|
</BusinessDescription>
|
|
272
280
|
<BusinessConfigsContainer isLoading={businessState?.loading}>
|
|
273
281
|
{(isAdmin
|
|
274
|
-
?
|
|
282
|
+
? !!spoonityConfig
|
|
283
|
+
? businessConfigs
|
|
284
|
+
: businessConfigs.filter(configs => configs.key !== 'spoonity_key')
|
|
275
285
|
: businessConfigs.filter(c => !itemsExcluded.includes(c.key))
|
|
276
286
|
).map(config => (
|
|
277
287
|
<BusinessConfigItem
|
|
@@ -282,7 +292,8 @@ export const BusinessSummary = (props) => {
|
|
|
282
292
|
<span>{config.value}</span>
|
|
283
293
|
<BsChevronRight />
|
|
284
294
|
</BusinessConfigItem>
|
|
285
|
-
)
|
|
295
|
+
)
|
|
296
|
+
)}
|
|
286
297
|
</BusinessConfigsContainer>
|
|
287
298
|
</BusinessDetailsContent>
|
|
288
299
|
</BusinessDetailsContainer>
|
|
@@ -24,7 +24,8 @@ const ProductStepUI = (props) => {
|
|
|
24
24
|
business,
|
|
25
25
|
isLoading,
|
|
26
26
|
orderingBusiness,
|
|
27
|
-
countriesState
|
|
27
|
+
countriesState,
|
|
28
|
+
handleOpenCategoryDetails
|
|
28
29
|
} = props
|
|
29
30
|
|
|
30
31
|
const theme = useTheme()
|
|
@@ -39,6 +40,11 @@ const ProductStepUI = (props) => {
|
|
|
39
40
|
onClose()
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
const handleAddManuallyProduct = () => {
|
|
44
|
+
onClose()
|
|
45
|
+
handleOpenCategoryDetails()
|
|
46
|
+
}
|
|
47
|
+
|
|
42
48
|
return (
|
|
43
49
|
<Container>
|
|
44
50
|
{step === 1 && <ProductStartGuide onClose={onClose} setStep={setStep} setOption={setOption} countriesState={countriesState} />}
|
|
@@ -63,7 +69,7 @@ const ProductStepUI = (props) => {
|
|
|
63
69
|
</ImageContent>
|
|
64
70
|
</ImportMenuContainer>
|
|
65
71
|
)}
|
|
66
|
-
{step === 3 && option === 2 && !actionState?.loading && (
|
|
72
|
+
{step === 3 && option === 2 && !actionState?.loading && actionState?.content?.products > 0 && (
|
|
67
73
|
<ImportMenuContainer>
|
|
68
74
|
<h2>{t('YOUR_MENU_HAS_BEEN_IMPORTED', 'Your menu has been imported')}</h2>
|
|
69
75
|
<ImageContent>
|
|
@@ -74,6 +80,17 @@ const ProductStepUI = (props) => {
|
|
|
74
80
|
</ButtonWrapper>
|
|
75
81
|
</ImportMenuContainer>
|
|
76
82
|
)}
|
|
83
|
+
{step === 3 && option === 2 && !actionState?.loading && actionState?.content?.products === 0 && (
|
|
84
|
+
<ImportMenuContainer>
|
|
85
|
+
<h2>{t('YOUR_MENU_COULDNT__BE_IMPORTED', 'Your menu couldn\'t be imported')}</h2>
|
|
86
|
+
<ImageContent>
|
|
87
|
+
<img src={theme.images.general.importMenu} alt='' />
|
|
88
|
+
</ImageContent>
|
|
89
|
+
<ButtonWrapper>
|
|
90
|
+
<Button color='primary' onClick={handleAddManuallyProduct}>{t('ADD_PRODUCTS_MANUALLY', 'Add products manually')}</Button>
|
|
91
|
+
</ButtonWrapper>
|
|
92
|
+
</ImportMenuContainer>
|
|
93
|
+
)}
|
|
77
94
|
{step === 2 && option === 3 && (
|
|
78
95
|
<UploadMenuGuide
|
|
79
96
|
handleBack={() => setStep(1)}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useLanguage } from 'ordering-components-admin-external'
|
|
3
|
+
import { Button, Input } from '../../../styles'
|
|
4
|
+
import { Alert } from '../../Shared'
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
BusinessOrderingChannelsContainer,
|
|
8
|
+
Title,
|
|
9
|
+
BusinessCustomSlugContainer,
|
|
10
|
+
FormControl,
|
|
11
|
+
Label,
|
|
12
|
+
} from './styles'
|
|
13
|
+
|
|
14
|
+
export const SpoonityApiKey = (props) => {
|
|
15
|
+
const {
|
|
16
|
+
spoonityConfig,
|
|
17
|
+
handleUpdateSpoonityKey,
|
|
18
|
+
spoonityKeyState
|
|
19
|
+
} = props
|
|
20
|
+
|
|
21
|
+
const [, t] = useLanguage()
|
|
22
|
+
const [spoonityKey, setSpoonityKey] = useState(spoonityConfig?.value)
|
|
23
|
+
const [alertState, setAlertState] = useState({ open: false, content: [], success: false })
|
|
24
|
+
|
|
25
|
+
const changeSpoonityKey = () => {
|
|
26
|
+
if (spoonityKey === '') {
|
|
27
|
+
setAlertState({
|
|
28
|
+
...alertState,
|
|
29
|
+
open: true,
|
|
30
|
+
content: [t('SPOONITY_KEY_REQUIRED', 'Spoonity key is required')]
|
|
31
|
+
})
|
|
32
|
+
return
|
|
33
|
+
}
|
|
34
|
+
handleUpdateSpoonityKey(spoonityKey, spoonityConfig.id)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const closeAlert = () => {
|
|
38
|
+
setAlertState({
|
|
39
|
+
...alertState,
|
|
40
|
+
open: false,
|
|
41
|
+
content: []
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (spoonityKeyState?.key && !spoonityKeyState?.loading) setSpoonityKey(spoonityKey)
|
|
47
|
+
}, [spoonityKeyState?.key, spoonityKeyState?.loading])
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if(!spoonityKeyState?.key) return
|
|
51
|
+
setSpoonityKey(spoonityKeyState?.key)
|
|
52
|
+
}, [spoonityKeyState?.key])
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<>
|
|
56
|
+
<BusinessOrderingChannelsContainer>
|
|
57
|
+
<Title>{t('SPOONITY_KEY', 'Spoonity key')}</Title>
|
|
58
|
+
<BusinessCustomSlugContainer>
|
|
59
|
+
<FormControl>
|
|
60
|
+
<Label>{t('API_KEY', 'Api key')}</Label>
|
|
61
|
+
<Input
|
|
62
|
+
type='text'
|
|
63
|
+
value={spoonityKey}
|
|
64
|
+
placeholder={t('SPOONITY_PLACEHOLDER', 'Spoonity key')}
|
|
65
|
+
onChange={(e) => setSpoonityKey(e.target.value)}
|
|
66
|
+
onKeyPress={(e) => {
|
|
67
|
+
if (!/^[0-9a-zA-Z]$/.test(e.key)) {
|
|
68
|
+
e.preventDefault()
|
|
69
|
+
}
|
|
70
|
+
}}
|
|
71
|
+
/>
|
|
72
|
+
</FormControl>
|
|
73
|
+
<Button color='primary' onClick={changeSpoonityKey}>{t('SAVE', 'Save')}</Button>
|
|
74
|
+
</BusinessCustomSlugContainer>
|
|
75
|
+
</BusinessOrderingChannelsContainer>
|
|
76
|
+
<Alert
|
|
77
|
+
title={t('SPOONITY_KEY', 'Spoonity key')}
|
|
78
|
+
content={alertState.content}
|
|
79
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
80
|
+
open={alertState.open}
|
|
81
|
+
onClose={() => closeAlert()}
|
|
82
|
+
onAccept={() => closeAlert()}
|
|
83
|
+
closeOnBackdrop={false}
|
|
84
|
+
/>
|
|
85
|
+
</>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const BusinessOrderingChannelsContainer = styled.div`
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
@media (min-width: 576px) {
|
|
6
|
+
padding: 20px;
|
|
7
|
+
}
|
|
8
|
+
`
|
|
9
|
+
export const Title = styled.h1`
|
|
10
|
+
font-size: 20px;
|
|
11
|
+
font-weight: 700;
|
|
12
|
+
color: ${props => props.theme.colors?.headingColor};
|
|
13
|
+
margin-bottom: 25px;
|
|
14
|
+
`
|
|
15
|
+
|
|
16
|
+
export const BusinessCustomSlugContainer = styled.div`
|
|
17
|
+
button {
|
|
18
|
+
border-radius: 7.6px;
|
|
19
|
+
height: 44px;
|
|
20
|
+
}
|
|
21
|
+
`
|
|
22
|
+
|
|
23
|
+
export const FormControl = styled.div`
|
|
24
|
+
margin-bottom: 20px;
|
|
25
|
+
|
|
26
|
+
input[type=text] {
|
|
27
|
+
border: 1px solid #DEE2E6;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
border-radius: 7.6px;
|
|
30
|
+
height: 44px;
|
|
31
|
+
width: 100%;
|
|
32
|
+
}
|
|
33
|
+
`
|
|
34
|
+
|
|
35
|
+
export const Label = styled.p`
|
|
36
|
+
margin-top: 0;
|
|
37
|
+
margin-bottom: 10px;
|
|
38
|
+
font-size: 14px;
|
|
39
|
+
color: ${props => props.theme?.colors.headingColor};
|
|
40
|
+
`
|
|
41
|
+
|
|
42
|
+
export const Tabs = styled.div`
|
|
43
|
+
display: flex;
|
|
44
|
+
width: 100%;
|
|
45
|
+
margin-bottom: 25px;
|
|
46
|
+
border-bottom: 1px solid ${props => props.theme.colors.borderColor};
|
|
47
|
+
`
|
|
48
|
+
|
|
49
|
+
export const Tab = styled.div`
|
|
50
|
+
user-select: none;
|
|
51
|
+
padding: 10px 0px;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
color: ${props => props.theme.colors?.headingColor};
|
|
54
|
+
font-size: 14px;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
color: ${props => props.theme.colors.lightGray};
|
|
57
|
+
${props => props.theme?.rtl ? css`
|
|
58
|
+
margin-left: 30px;
|
|
59
|
+
` : css`
|
|
60
|
+
margin-right: 30px;
|
|
61
|
+
`}
|
|
62
|
+
|
|
63
|
+
${({ active }) => active && css`
|
|
64
|
+
border-bottom: 1px solid;
|
|
65
|
+
font-weight: 500;
|
|
66
|
+
color: ${props => props.theme.colors.headingColor};
|
|
67
|
+
`}
|
|
68
|
+
`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useRef } from 'react'
|
|
1
|
+
import React, { useState, useRef, useEffect } from 'react'
|
|
2
2
|
import { useLanguage, ExamineClick, DragAndDrop, UploadMenu } from 'ordering-components-admin-external'
|
|
3
3
|
import { CloudUploadFill, FileEarmarkPdfFill } from 'react-bootstrap-icons'
|
|
4
4
|
import { Button, Input } from '../../../styles'
|
|
@@ -76,6 +76,15 @@ const UploadMenuGuideUI = (props) => {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
if (formState?.error) {
|
|
81
|
+
setAlertState({
|
|
82
|
+
open: true,
|
|
83
|
+
content: formState.error
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
}, [formState?.error])
|
|
87
|
+
|
|
79
88
|
return (
|
|
80
89
|
<>
|
|
81
90
|
<Container>
|