ordering-ui-admin-external 1.17.0 → 1.18.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.d6ceaa81e226693746d5.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/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/Orders/Messages/index.js +9 -5
- package/_modules/components/Orders/OrderBill/index.js +1 -1
- package/_modules/components/Orders/OrderNotification/index.js +4 -2
- package/_modules/components/Orders/OrdersManager/index.js +3 -1
- 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/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/BusinessPreorderDetails/index.js +13 -1
- 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/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/Orders/Messages/index.js +38 -0
- package/src/components/Orders/OrderBill/index.js +1 -1
- package/src/components/Orders/OrderNotification/index.js +6 -2
- package/src/components/Orders/OrdersManager/index.js +1 -1
- 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/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/BusinessPreorderDetails/index.js +2 -2
- 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.d6ceaa81e226693746d5.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react'
|
|
2
|
+
import { useLanguage, BusinessPlaceGroup as BusinessPlaceGroupController } from 'ordering-components-admin-external'
|
|
3
|
+
import { DropdownButton, Dropdown } from 'react-bootstrap'
|
|
4
|
+
import { useTheme } from 'styled-components'
|
|
5
|
+
import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
6
|
+
import { Button, IconButton, Input } from '../../../styles'
|
|
7
|
+
import { useForm } from 'react-hook-form'
|
|
8
|
+
import { Alert, Modal } from '../../Shared'
|
|
9
|
+
import Skeleton from 'react-loading-skeleton'
|
|
10
|
+
import { BusinessPlace } from '../BusinessPlace'
|
|
11
|
+
import { ChevronRight, CheckSquareFill, Square, XLg, ThreeDots } from 'react-bootstrap-icons'
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
Container,
|
|
15
|
+
Header,
|
|
16
|
+
ActionBlock,
|
|
17
|
+
ActionSelectorWrapper,
|
|
18
|
+
Content,
|
|
19
|
+
ButtonWrapper,
|
|
20
|
+
HideSubmitBtn,
|
|
21
|
+
OptionList,
|
|
22
|
+
AddBtn,
|
|
23
|
+
PlaceItemContainer,
|
|
24
|
+
CheckWrapper,
|
|
25
|
+
TableHead
|
|
26
|
+
} from './styles'
|
|
27
|
+
|
|
28
|
+
export const BusinessPlaceGroupUI = (props) => {
|
|
29
|
+
const {
|
|
30
|
+
open,
|
|
31
|
+
onClose,
|
|
32
|
+
placeGroup,
|
|
33
|
+
formState,
|
|
34
|
+
handleChangeInput,
|
|
35
|
+
handleAddPlaceGroup,
|
|
36
|
+
handleUpdatePlaceGroup,
|
|
37
|
+
handleDeletePlaceGroup,
|
|
38
|
+
placeList,
|
|
39
|
+
handleSuccessDeletePlace,
|
|
40
|
+
handleSuccessAddPlace,
|
|
41
|
+
handleSuccessUpdatePlace,
|
|
42
|
+
handleChangePlaceEnabled,
|
|
43
|
+
businessId,
|
|
44
|
+
handleMultiPlaceChangeEnabled,
|
|
45
|
+
getMultiPlaceCheckStatus
|
|
46
|
+
} = props
|
|
47
|
+
|
|
48
|
+
const theme = useTheme()
|
|
49
|
+
const [, t] = useLanguage()
|
|
50
|
+
const { width } = useWindowSize()
|
|
51
|
+
const formMethods = useForm()
|
|
52
|
+
|
|
53
|
+
const [isMenuOpen, setIsMenuOpen] = useState(false)
|
|
54
|
+
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
55
|
+
const [selectedPlace, setSelectedPlace] = useState(null)
|
|
56
|
+
const [openModal, setOpenModal] = useState(false)
|
|
57
|
+
|
|
58
|
+
const buttonRef = useRef(null)
|
|
59
|
+
|
|
60
|
+
const actionSidebar = (value) => {
|
|
61
|
+
if (!value) {
|
|
62
|
+
props.onClose()
|
|
63
|
+
}
|
|
64
|
+
setIsMenuOpen(value)
|
|
65
|
+
document.getElementById('business_place').style.width = value
|
|
66
|
+
? width > 1000 ? '500px' : '100%'
|
|
67
|
+
: '0'
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const handleOpenModal = (place) => {
|
|
71
|
+
setSelectedPlace(place)
|
|
72
|
+
setOpenModal(true)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const closeAlert = () => {
|
|
76
|
+
setAlertState({
|
|
77
|
+
open: false,
|
|
78
|
+
content: []
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const onSubmit = () => {
|
|
83
|
+
if (placeGroup) handleUpdatePlaceGroup()
|
|
84
|
+
else handleAddPlaceGroup()
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const handleCloseModal = () => {
|
|
88
|
+
setOpenModal(false)
|
|
89
|
+
setSelectedPlace(null)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (isMenuOpen) {
|
|
94
|
+
if (width < 1000) {
|
|
95
|
+
document.getElementById('business_place').style.width = '100%'
|
|
96
|
+
} else {
|
|
97
|
+
document.getElementById('business_place').style.width = '500px'
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}, [width])
|
|
101
|
+
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (!open) return
|
|
104
|
+
actionSidebar(true)
|
|
105
|
+
}, [open])
|
|
106
|
+
|
|
107
|
+
const handlePlaceClick = (e, place) => {
|
|
108
|
+
if (e.target.closest('.check-box')) return
|
|
109
|
+
handleOpenModal(place)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const handleCheckBoxChange = (place) => {
|
|
113
|
+
handleChangePlaceEnabled(place?.id, { enabled: !place?.enabled })
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const handleUpdateSelectedPlace = (placeGroup) => {
|
|
117
|
+
setSelectedPlace(placeGroup)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
if (Object.keys(formMethods.errors).length > 0) {
|
|
122
|
+
setAlertState({
|
|
123
|
+
open: true,
|
|
124
|
+
content: Object.values(formMethods.errors).map(error => error.message)
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
}, [formMethods.errors])
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<>
|
|
131
|
+
<Container id='business_place'>
|
|
132
|
+
<Header>
|
|
133
|
+
<h1>{placeGroup ? placeGroup?.name : t('NEW_PLACE', 'New place')}</h1>
|
|
134
|
+
<ActionBlock>
|
|
135
|
+
{placeGroup && (
|
|
136
|
+
<ActionSelectorWrapper>
|
|
137
|
+
<DropdownButton
|
|
138
|
+
className='product_actions'
|
|
139
|
+
menuAlign={theme?.rtl ? 'left' : 'right'}
|
|
140
|
+
title={<ThreeDots />}
|
|
141
|
+
id={theme?.rtl ? 'dropdown-menu-align-left' : 'dropdown-menu-align-right'}
|
|
142
|
+
>
|
|
143
|
+
<Dropdown.Item
|
|
144
|
+
onClick={() => handleDeletePlaceGroup()}
|
|
145
|
+
>
|
|
146
|
+
{t('DELETE', 'Delete')}
|
|
147
|
+
</Dropdown.Item>
|
|
148
|
+
</DropdownButton>
|
|
149
|
+
</ActionSelectorWrapper>
|
|
150
|
+
)}
|
|
151
|
+
<IconButton
|
|
152
|
+
color='black'
|
|
153
|
+
onClick={() => onClose()}
|
|
154
|
+
>
|
|
155
|
+
<XLg />
|
|
156
|
+
</IconButton>
|
|
157
|
+
</ActionBlock>
|
|
158
|
+
</Header>
|
|
159
|
+
<Content onSubmit={formMethods.handleSubmit(onSubmit)}>
|
|
160
|
+
<label>{t('NAME', 'Name')}</label>
|
|
161
|
+
<Input
|
|
162
|
+
placeholder={t('NAME', 'Name')}
|
|
163
|
+
name='name'
|
|
164
|
+
autoComplete='off'
|
|
165
|
+
onChange={handleChangeInput}
|
|
166
|
+
value={formState?.changes?.name ?? placeGroup?.name ?? ''}
|
|
167
|
+
ref={formMethods.register({
|
|
168
|
+
required: t(
|
|
169
|
+
'VALIDATION_ERROR_REQUIRED',
|
|
170
|
+
'Name is required'
|
|
171
|
+
).replace('_attribute_', t('NAME', 'Name'))
|
|
172
|
+
})}
|
|
173
|
+
/>
|
|
174
|
+
<HideSubmitBtn type='submit' ref={buttonRef} />
|
|
175
|
+
</Content>
|
|
176
|
+
{placeGroup && placeList?.loading && (
|
|
177
|
+
<OptionList>
|
|
178
|
+
{
|
|
179
|
+
[...Array(5).keys()].map(i => (
|
|
180
|
+
<PlaceItemContainer key={i}>
|
|
181
|
+
<CheckWrapper>
|
|
182
|
+
<Skeleton width={16} height={16} />
|
|
183
|
+
<label>
|
|
184
|
+
<Skeleton width={100} />
|
|
185
|
+
</label>
|
|
186
|
+
</CheckWrapper>
|
|
187
|
+
<Skeleton width={16} height={16} />
|
|
188
|
+
</PlaceItemContainer>
|
|
189
|
+
))
|
|
190
|
+
}
|
|
191
|
+
</OptionList>
|
|
192
|
+
)}
|
|
193
|
+
{placeGroup && !placeList?.loading && (
|
|
194
|
+
<OptionList>
|
|
195
|
+
{placeList?.places?.length > 0 && (
|
|
196
|
+
<TableHead>
|
|
197
|
+
<CheckWrapper>
|
|
198
|
+
<span className='check-box' onClick={() => handleMultiPlaceChangeEnabled()}>
|
|
199
|
+
{getMultiPlaceCheckStatus() ? <CheckSquareFill className='active' /> : <Square />}
|
|
200
|
+
</span>
|
|
201
|
+
<label>{t('OPTIONS', 'Options')}</label>
|
|
202
|
+
</CheckWrapper>
|
|
203
|
+
</TableHead>
|
|
204
|
+
)}
|
|
205
|
+
{placeList?.places?.map((place, i) => (
|
|
206
|
+
<PlaceItemContainer
|
|
207
|
+
key={i}
|
|
208
|
+
active={selectedPlace?.id === place?.id}
|
|
209
|
+
onClick={(e) => handlePlaceClick(e, place)}
|
|
210
|
+
>
|
|
211
|
+
<CheckWrapper>
|
|
212
|
+
<span className='check-box' onClick={() => handleCheckBoxChange(place)}>
|
|
213
|
+
{place?.enabled ? <CheckSquareFill className='active' /> : <Square />}
|
|
214
|
+
</span>
|
|
215
|
+
<label>{place?.name}</label>
|
|
216
|
+
</CheckWrapper>
|
|
217
|
+
<ChevronRight />
|
|
218
|
+
</PlaceItemContainer>
|
|
219
|
+
))}
|
|
220
|
+
</OptionList>
|
|
221
|
+
)}
|
|
222
|
+
{placeGroup && <AddBtn onClick={() => handleOpenModal(null)}>{t('ADD_OPTION', 'Add option')}</AddBtn>}
|
|
223
|
+
<ButtonWrapper>
|
|
224
|
+
<Button
|
|
225
|
+
color='primary'
|
|
226
|
+
borderRadius='8px'
|
|
227
|
+
disabled={Object.keys(formState?.changes).length === 0}
|
|
228
|
+
onClick={() => buttonRef.current.click()}
|
|
229
|
+
>
|
|
230
|
+
{placeGroup ? t('SAVE', 'Save') : t('ADD', 'Add')}
|
|
231
|
+
</Button>
|
|
232
|
+
</ButtonWrapper>
|
|
233
|
+
</Container>
|
|
234
|
+
<Alert
|
|
235
|
+
title={t('PLACES', 'Places')}
|
|
236
|
+
content={alertState.content}
|
|
237
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
238
|
+
open={alertState.open}
|
|
239
|
+
onClose={() => closeAlert()}
|
|
240
|
+
onAccept={() => closeAlert()}
|
|
241
|
+
closeOnBackdrop={false}
|
|
242
|
+
/>
|
|
243
|
+
<Modal
|
|
244
|
+
width='700px'
|
|
245
|
+
height='80vh'
|
|
246
|
+
padding='30px'
|
|
247
|
+
open={openModal}
|
|
248
|
+
onClose={() => handleCloseModal()}
|
|
249
|
+
hideCloseDefault
|
|
250
|
+
>
|
|
251
|
+
<BusinessPlace
|
|
252
|
+
businessId={businessId}
|
|
253
|
+
place={selectedPlace}
|
|
254
|
+
placeGroup={placeGroup}
|
|
255
|
+
handleUpdateSelectedPlace={handleUpdateSelectedPlace}
|
|
256
|
+
handleSuccessUpdatePlace={handleSuccessUpdatePlace}
|
|
257
|
+
handleSuccessAddPlace={handleSuccessAddPlace}
|
|
258
|
+
handleSuccessDeletePlace={handleSuccessDeletePlace}
|
|
259
|
+
onClose={() => handleCloseModal()}
|
|
260
|
+
/>
|
|
261
|
+
</Modal>
|
|
262
|
+
</>
|
|
263
|
+
)
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export const BusinessPlaceGroup = (props) => {
|
|
267
|
+
const businessPlaceProps = {
|
|
268
|
+
...props,
|
|
269
|
+
UIComponent: BusinessPlaceGroupUI
|
|
270
|
+
}
|
|
271
|
+
return <BusinessPlaceGroupController {...businessPlaceProps} />
|
|
272
|
+
}
|
|
@@ -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
|
+
`
|
|
@@ -120,7 +120,7 @@ export const BusinessPreorderDetails = (props) => {
|
|
|
120
120
|
{t('SAVE', 'Save')}
|
|
121
121
|
</Button>
|
|
122
122
|
</PreorderTimeWrapper>
|
|
123
|
-
|
|
123
|
+
<Divider />
|
|
124
124
|
<BusinessCateringDelivery
|
|
125
125
|
minutes={minutes}
|
|
126
126
|
type='catering_delivery'
|
|
@@ -135,7 +135,7 @@ export const BusinessPreorderDetails = (props) => {
|
|
|
135
135
|
changePreorderConfigs={changePreorderConfigs}
|
|
136
136
|
disabled={actionStatus?.loading}
|
|
137
137
|
/>
|
|
138
|
-
<Margin />
|
|
138
|
+
<Margin />
|
|
139
139
|
</BusinessPreorderContainer>
|
|
140
140
|
)
|
|
141
141
|
}
|
|
@@ -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)}
|