ordering-ui-admin-external 1.21.1 → 1.22.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.54438e43781a1b813286.js → ordering-ui-admin.825f0823f4b81b92e41b.js} +2 -2
- package/_modules/components/Delivery/DriversGroupLogs/index.js +3 -3
- package/_modules/components/Delivery/DriversLogs/index.js +13 -0
- package/_modules/components/Delivery/UserDetails/index.js +9 -4
- package/_modules/components/Delivery/UserDetailsMenu/index.js +3 -0
- package/_modules/components/MyProducts/AdvancedSettings/OrderType.js +2 -2
- package/_modules/components/MyProducts/AdvancedSettings/index.js +14 -18
- package/_modules/components/Orders/OrdersListing/index.js +4 -2
- package/_modules/components/Orders/OrdersTable/index.js +8 -4
- package/_modules/components/Stores/BusinessDeliveryZoneInformation/index.js +1 -2
- package/_modules/components/Stores/BusinessDetails/index.js +4 -0
- package/_modules/components/Stores/BusinessQRCodeOption/index.js +168 -0
- package/_modules/components/Stores/BusinessQRCodeOption/styles.js +39 -0
- package/_modules/components/Stores/BusinessQRCodeOptions/index.js +111 -0
- package/_modules/components/Stores/BusinessQRCodeOptions/styles.js +48 -0
- package/_modules/components/Stores/BusinessSummary/index.js +1 -1
- package/_modules/components/Stores/index.js +14 -0
- package/_modules/utils/index.js +24 -2
- package/package.json +3 -2
- package/src/components/Delivery/DriversGroupLogs/index.js +2 -4
- package/src/components/Delivery/DriversLogs/index.js +8 -0
- package/src/components/Delivery/UserDetails/index.js +8 -0
- package/src/components/Delivery/UserDetailsMenu/index.js +2 -1
- package/src/components/MyProducts/AdvancedSettings/OrderType.js +2 -2
- package/src/components/MyProducts/AdvancedSettings/index.js +14 -15
- package/src/components/Orders/OrdersListing/index.js +3 -1
- package/src/components/Orders/OrdersTable/index.js +8 -4
- package/src/components/Stores/BusinessDeliveryZoneInformation/index.js +3 -2
- package/src/components/Stores/BusinessDetails/index.js +7 -0
- package/src/components/Stores/BusinessQRCodeOption/index.js +178 -0
- package/src/components/Stores/BusinessQRCodeOption/styles.js +113 -0
- package/src/components/Stores/BusinessQRCodeOptions/index.js +112 -0
- package/src/components/Stores/BusinessQRCodeOptions/styles.js +63 -0
- package/src/components/Stores/BusinessSummary/index.js +1 -1
- package/src/components/Stores/index.js +4 -0
- package/src/utils/index.js +16 -0
- /package/_bundles/{ordering-ui-admin.54438e43781a1b813286.js.LICENSE.txt → ordering-ui-admin.825f0823f4b81b92e41b.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import React, { useEffect, useState, useRef } from 'react'
|
|
2
|
+
import { useLanguage } from 'ordering-components-admin-external'
|
|
3
|
+
import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
4
|
+
import { Button, Input } from '../../../styles'
|
|
5
|
+
import { X as Close } from 'react-bootstrap-icons'
|
|
6
|
+
import QRCode from 'react-qr-code'
|
|
7
|
+
import ReactToPrint from 'react-to-print'
|
|
8
|
+
import { Alert } from '../../Shared'
|
|
9
|
+
import { checkSiteUrl, checkValidUrlFormat } from '../../../utils'
|
|
10
|
+
import {
|
|
11
|
+
Container,
|
|
12
|
+
ButtonGroup,
|
|
13
|
+
Header,
|
|
14
|
+
CloseButton,
|
|
15
|
+
FormControl,
|
|
16
|
+
QRCodeLayout
|
|
17
|
+
} from './styles'
|
|
18
|
+
|
|
19
|
+
export const BusinessQRCodeOption = (props) => {
|
|
20
|
+
const {
|
|
21
|
+
open,
|
|
22
|
+
item,
|
|
23
|
+
business,
|
|
24
|
+
onClose,
|
|
25
|
+
siteState
|
|
26
|
+
} = props
|
|
27
|
+
|
|
28
|
+
const [, t] = useLanguage()
|
|
29
|
+
const { width } = useWindowSize()
|
|
30
|
+
const [isMenuOpen, setIsMenuOpen] = useState(false)
|
|
31
|
+
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
32
|
+
const [code, setCode] = useState(null)
|
|
33
|
+
|
|
34
|
+
const numberRef = useRef(null)
|
|
35
|
+
const printerRef = useRef()
|
|
36
|
+
const siteRef = useRef()
|
|
37
|
+
|
|
38
|
+
const closeAlert = () => {
|
|
39
|
+
setAlertState({
|
|
40
|
+
open: false,
|
|
41
|
+
content: []
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const generateQRCode = () => {
|
|
46
|
+
const errors = []
|
|
47
|
+
if (!(siteState?.site?.domain && siteState?.site?.ssl_process_status === 'ended') && !siteRef?.current?.value) {
|
|
48
|
+
errors.push(t('VALIDATION_ERROR_REQUIRED', 'URL is required').replace('_attribute_', t('URL', 'Url')))
|
|
49
|
+
}
|
|
50
|
+
if (siteRef?.current?.value && !checkValidUrlFormat(siteRef?.current?.value)) {
|
|
51
|
+
errors.push(t('VALIDATION_ERROR_URL', 'The URL format is not valid').replace('_attribute_', 'URL'))
|
|
52
|
+
}
|
|
53
|
+
if (item?.key !== 'pick_up' && !numberRef?.current?.value) {
|
|
54
|
+
errors.push(
|
|
55
|
+
item?.key === 'eat_in'
|
|
56
|
+
? t('VALIDATION_ERROR_REQUIRED', 'Table number is required').replace('_attribute_', t('TABLE_NUMBER', 'Table number'))
|
|
57
|
+
: t('VALIDATION_ERROR_REQUIRED', 'Spot number is required').replace('_attribute_', t('SPOT_NUMBER', 'Spot number'))
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
if (errors.length > 0) {
|
|
61
|
+
setAlertState({
|
|
62
|
+
open: true,
|
|
63
|
+
content: errors
|
|
64
|
+
})
|
|
65
|
+
return
|
|
66
|
+
}
|
|
67
|
+
const storeUrl = siteState?.site?.domain && siteState?.site?.ssl_process_status === 'ended'
|
|
68
|
+
? `https://${siteState?.site?.domain}/store/${business?.slug}`
|
|
69
|
+
: `${checkSiteUrl(siteRef?.current?.value)}store/${business?.slug}`
|
|
70
|
+
const tsNumber = item?.key !== 'pick_up'
|
|
71
|
+
? (item?.key === 'eat_in'
|
|
72
|
+
? `&table_numer=${numberRef?.current?.value}`
|
|
73
|
+
: `&spot_numer=${numberRef?.current?.value}`)
|
|
74
|
+
: ''
|
|
75
|
+
const compltedUrl = `${storeUrl}?order_type=${item.value}${tsNumber}`
|
|
76
|
+
console.log(compltedUrl)
|
|
77
|
+
setCode(compltedUrl)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const actionSidebar = (value) => {
|
|
81
|
+
if (!value) {
|
|
82
|
+
onClose && onClose()
|
|
83
|
+
}
|
|
84
|
+
setIsMenuOpen(value)
|
|
85
|
+
document.getElementById('qrOption').style.width = value
|
|
86
|
+
? width > 1000 ? '500px' : '100%'
|
|
87
|
+
: '0'
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (isMenuOpen) {
|
|
92
|
+
if (width < 1000) {
|
|
93
|
+
document.getElementById('qrOption').style.width = '100%'
|
|
94
|
+
} else {
|
|
95
|
+
document.getElementById('qrOption').style.width = '500px'
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}, [width])
|
|
99
|
+
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
if (!open) return
|
|
102
|
+
actionSidebar(true)
|
|
103
|
+
}, [open])
|
|
104
|
+
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
setCode(null)
|
|
107
|
+
if (numberRef?.current) {
|
|
108
|
+
numberRef.current.value = ''
|
|
109
|
+
}
|
|
110
|
+
}, [item])
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<Container id='qrOption'>
|
|
114
|
+
<Header>
|
|
115
|
+
{item?.title && (<h1>{item?.title}</h1>)}
|
|
116
|
+
<CloseButton>
|
|
117
|
+
<Close onClick={() => onClose && onClose()} />
|
|
118
|
+
</CloseButton>
|
|
119
|
+
</Header>
|
|
120
|
+
{code && (
|
|
121
|
+
<QRCodeLayout ref={printerRef}>
|
|
122
|
+
<QRCode
|
|
123
|
+
size={256}
|
|
124
|
+
style={{ height: 'auto', maxWidth: '100%', width: '100%' }}
|
|
125
|
+
value={code}
|
|
126
|
+
viewBox='0 0 256 256'
|
|
127
|
+
/>
|
|
128
|
+
</QRCodeLayout>
|
|
129
|
+
)}
|
|
130
|
+
{item?.key === 'pick_up' ? (
|
|
131
|
+
<p>{t('GENERATE_QR_CODE', 'Generate QR Code')}</p>
|
|
132
|
+
) : (
|
|
133
|
+
<FormControl>
|
|
134
|
+
<label>{item?.key === 'eat_in' ? t('TABLE_NUMBER', 'Table number') : t('SPOT_NUMBER', 'Spot number')}</label>
|
|
135
|
+
<Input
|
|
136
|
+
placeholder='0'
|
|
137
|
+
ref={numberRef}
|
|
138
|
+
/>
|
|
139
|
+
</FormControl>
|
|
140
|
+
)}
|
|
141
|
+
{!(siteState?.site?.domain && siteState?.site?.ssl_process_status === 'ended') && (
|
|
142
|
+
<FormControl isMargin>
|
|
143
|
+
<label>{t('ADD_YOUR_SITE_URL', 'Add your site url')}</label>
|
|
144
|
+
<Input
|
|
145
|
+
placeholder='https://yourdomain.com'
|
|
146
|
+
ref={siteRef}
|
|
147
|
+
/>
|
|
148
|
+
</FormControl>
|
|
149
|
+
)}
|
|
150
|
+
<ButtonGroup>
|
|
151
|
+
<Button color='primary' outline onClick={generateQRCode}>
|
|
152
|
+
{t('GENERATE_CODE', 'Generate Code')}
|
|
153
|
+
</Button>
|
|
154
|
+
<ReactToPrint
|
|
155
|
+
trigger={() => (
|
|
156
|
+
<Button
|
|
157
|
+
color='primary'
|
|
158
|
+
disabled={!code}
|
|
159
|
+
>
|
|
160
|
+
{t('PRINT', 'Print')}
|
|
161
|
+
</Button>
|
|
162
|
+
)}
|
|
163
|
+
content={() => printerRef.current}
|
|
164
|
+
removeAfterPrint
|
|
165
|
+
/>
|
|
166
|
+
</ButtonGroup>
|
|
167
|
+
<Alert
|
|
168
|
+
title={t('ORDERING', 'Ordering')}
|
|
169
|
+
content={alertState.content}
|
|
170
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
171
|
+
open={alertState.open}
|
|
172
|
+
onClose={() => closeAlert()}
|
|
173
|
+
onAccept={() => closeAlert()}
|
|
174
|
+
closeOnBackdrop={false}
|
|
175
|
+
/>
|
|
176
|
+
</Container>
|
|
177
|
+
)
|
|
178
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const Container = styled.div`
|
|
4
|
+
padding: 20px;
|
|
5
|
+
overflow: auto;
|
|
6
|
+
transition: 0.3s;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
|
|
11
|
+
> button {
|
|
12
|
+
margin-top: 20px;
|
|
13
|
+
position: sticky;
|
|
14
|
+
top: 100%;
|
|
15
|
+
width: fit-content;
|
|
16
|
+
height: 42px;
|
|
17
|
+
margin-bottom: 20px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (min-width: 1000px) {
|
|
21
|
+
width: 0;
|
|
22
|
+
${props => props.theme?.rtl ? css`
|
|
23
|
+
border-right: 1px solid #E9ECEF;
|
|
24
|
+
` : css`
|
|
25
|
+
border-left: 1px solid #E9ECEF;
|
|
26
|
+
`}
|
|
27
|
+
}
|
|
28
|
+
> p {
|
|
29
|
+
font-weight: 400;
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
line-height: 24px;
|
|
32
|
+
margin: 0;
|
|
33
|
+
}
|
|
34
|
+
`
|
|
35
|
+
|
|
36
|
+
export const ButtonGroup = styled.div`
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
margin-top: 27px;
|
|
40
|
+
|
|
41
|
+
button {
|
|
42
|
+
height: 44px;
|
|
43
|
+
border-radius: 8px;
|
|
44
|
+
width: 100%;
|
|
45
|
+
margin-bottom: 10px;
|
|
46
|
+
@media (min-width: 576px) {
|
|
47
|
+
margin-bottom: 0;
|
|
48
|
+
width: fit-content;
|
|
49
|
+
&:first-child {
|
|
50
|
+
margin-right: 15px;
|
|
51
|
+
${props => props.theme.rtl && css`
|
|
52
|
+
margin-right: 0;
|
|
53
|
+
margin-left: 15px;
|
|
54
|
+
`}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
@media (min-width: 576px) {
|
|
59
|
+
flex-direction: row;
|
|
60
|
+
}
|
|
61
|
+
`
|
|
62
|
+
|
|
63
|
+
export const Header = styled.div`
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
margin-bottom: 20px;
|
|
68
|
+
h1 {
|
|
69
|
+
font-size: 20px;
|
|
70
|
+
color: ${props => props.theme.colors.headingColor};
|
|
71
|
+
font-weight: 600;
|
|
72
|
+
margin: 0;
|
|
73
|
+
}
|
|
74
|
+
`
|
|
75
|
+
|
|
76
|
+
export const CloseButton = styled.div`
|
|
77
|
+
display: none;
|
|
78
|
+
@media (min-width: 1000px) {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
> svg {
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
font-size: 24px;
|
|
84
|
+
color: ${props => props.theme.colors.headingColor};
|
|
85
|
+
${props => props.theme?.rtl ? css`
|
|
86
|
+
margin-right: 10px;
|
|
87
|
+
` : css`
|
|
88
|
+
margin-left: 10px;
|
|
89
|
+
`}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
`
|
|
93
|
+
|
|
94
|
+
export const FormControl = styled.div`
|
|
95
|
+
label {
|
|
96
|
+
font-weight: 400;
|
|
97
|
+
font-size: 14px;
|
|
98
|
+
line-height: 24px;
|
|
99
|
+
margin-bottom: 6px;
|
|
100
|
+
}
|
|
101
|
+
input {
|
|
102
|
+
width: 100%;
|
|
103
|
+
height: 44px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
${({ isMargin }) => isMargin && css`
|
|
107
|
+
margin-top: 10px;
|
|
108
|
+
`}
|
|
109
|
+
`
|
|
110
|
+
|
|
111
|
+
export const QRCodeLayout = styled.div`
|
|
112
|
+
margin-bottom: 20px;
|
|
113
|
+
`
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { useTheme } from 'styled-components'
|
|
3
|
+
import { useLanguage, BusinessQRCodeOptions as BusinessQRCodeOptionsController } from 'ordering-components-admin-external'
|
|
4
|
+
import BsChevronRight from '@meronex/icons/bs/BsChevronRight'
|
|
5
|
+
import { Modal } from '../../Shared'
|
|
6
|
+
import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
7
|
+
import { BusinessQRCodeOption } from '../BusinessQRCodeOption'
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
MainContainer,
|
|
11
|
+
PublishingContainer,
|
|
12
|
+
PublishingListWrapper,
|
|
13
|
+
PublishingOptionContainer,
|
|
14
|
+
PublishingOption,
|
|
15
|
+
PublishingName
|
|
16
|
+
} from './styles'
|
|
17
|
+
|
|
18
|
+
const BusinessQRCodeOptionsUI = (props) => {
|
|
19
|
+
const {
|
|
20
|
+
setIsExtendExtraOpen,
|
|
21
|
+
siteState
|
|
22
|
+
} = props
|
|
23
|
+
|
|
24
|
+
const [, t] = useLanguage()
|
|
25
|
+
const theme = useTheme()
|
|
26
|
+
const { width } = useWindowSize()
|
|
27
|
+
const [isOpen, setIsOpen] = useState(false)
|
|
28
|
+
const [itemSelected, setItemSelected] = useState(null)
|
|
29
|
+
|
|
30
|
+
const publishingItems = [
|
|
31
|
+
{
|
|
32
|
+
key: 'pick_up',
|
|
33
|
+
value: 2,
|
|
34
|
+
title: t('QR_CODE_FOR_PICKUP', 'QR Code for Pickup')
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: 'eat_in',
|
|
38
|
+
value: 3,
|
|
39
|
+
title: t('QR_CODE_FOR_EATIN', 'QR Code for Eat in')
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: 'curbside',
|
|
43
|
+
value: 4,
|
|
44
|
+
title: t('QR_CODE_FOR_CURBSIDE', 'QR Code for Curbside')
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: 'driver_thru',
|
|
48
|
+
value: 5,
|
|
49
|
+
title: t('QR_CODE_FOR_DRIVE_THRU', 'QR Code for Drive Thru')
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
const handleAction = (value, item = null) => {
|
|
54
|
+
setItemSelected(item)
|
|
55
|
+
setIsExtendExtraOpen(value)
|
|
56
|
+
setIsOpen(value)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<MainContainer>
|
|
61
|
+
<PublishingContainer>
|
|
62
|
+
<h1>{t('PUBLISHING', 'Publishing')}</h1>
|
|
63
|
+
|
|
64
|
+
<PublishingListWrapper>
|
|
65
|
+
{publishingItems.map((item, i) => (
|
|
66
|
+
<PublishingOptionContainer key={i} onClick={() => handleAction(true, item)} active={item.key === itemSelected?.key}>
|
|
67
|
+
<PublishingOption>
|
|
68
|
+
<PublishingName>{item?.title}</PublishingName>
|
|
69
|
+
</PublishingOption>
|
|
70
|
+
<BsChevronRight style={{ color: theme.colors.lightGray }} />
|
|
71
|
+
</PublishingOptionContainer>
|
|
72
|
+
))}
|
|
73
|
+
</PublishingListWrapper>
|
|
74
|
+
</PublishingContainer>
|
|
75
|
+
|
|
76
|
+
{width >= 1000 ? (
|
|
77
|
+
isOpen && (
|
|
78
|
+
<BusinessQRCodeOption
|
|
79
|
+
business={props.business}
|
|
80
|
+
open={isOpen}
|
|
81
|
+
item={itemSelected}
|
|
82
|
+
onClose={() => handleAction(false)}
|
|
83
|
+
/>
|
|
84
|
+
)
|
|
85
|
+
) : (
|
|
86
|
+
isOpen && (
|
|
87
|
+
<Modal
|
|
88
|
+
width='80%'
|
|
89
|
+
open={isOpen}
|
|
90
|
+
onClose={() => handleAction(false)}
|
|
91
|
+
>
|
|
92
|
+
<BusinessQRCodeOption
|
|
93
|
+
business={props.business}
|
|
94
|
+
siteState={siteState}
|
|
95
|
+
open={isOpen}
|
|
96
|
+
item={itemSelected}
|
|
97
|
+
onClose={() => handleAction(false)}
|
|
98
|
+
/>
|
|
99
|
+
</Modal>
|
|
100
|
+
)
|
|
101
|
+
)}
|
|
102
|
+
</MainContainer>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export const BusinessQRCodeOptions = (props) => {
|
|
107
|
+
const businessQRcodeOptionsProps = {
|
|
108
|
+
...props,
|
|
109
|
+
UIComponent: BusinessQRCodeOptionsUI
|
|
110
|
+
}
|
|
111
|
+
return <BusinessQRCodeOptionsController {...businessQRcodeOptionsProps} />
|
|
112
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const MainContainer = styled.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
height: 100%;
|
|
6
|
+
`
|
|
7
|
+
|
|
8
|
+
export const PublishingContainer = styled.div`
|
|
9
|
+
height: 100%;
|
|
10
|
+
overflow-x: hidden;
|
|
11
|
+
flex: 1;
|
|
12
|
+
h1 {
|
|
13
|
+
color: ${props => props.theme.colors.headingColor};
|
|
14
|
+
font-size: 20px;
|
|
15
|
+
font-weight: 700;
|
|
16
|
+
}
|
|
17
|
+
@media (min-width: 576px) {
|
|
18
|
+
padding: 20px;
|
|
19
|
+
}
|
|
20
|
+
`
|
|
21
|
+
|
|
22
|
+
export const PublishingListWrapper = styled.div`
|
|
23
|
+
border-top: 1px solid ${props => props.theme.colors.borderColor};
|
|
24
|
+
margin: 20px 0;
|
|
25
|
+
`
|
|
26
|
+
|
|
27
|
+
export const PublishingOptionContainer = styled.div`
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
border-bottom: 1px solid ${props => props.theme.colors.borderColor};
|
|
32
|
+
padding: 12px 18px;
|
|
33
|
+
${({ active }) => active && css`
|
|
34
|
+
border-top: 1px solid ${props => props.theme.colors.primary};
|
|
35
|
+
border-bottom: 1px solid ${props => props.theme.colors.primary};
|
|
36
|
+
background-color: ${props => props.theme.colors.backgroundInfo};
|
|
37
|
+
`}
|
|
38
|
+
`
|
|
39
|
+
|
|
40
|
+
export const PublishingOption = styled.div`
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: flex-start;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
color: ${props => props.theme.colors.headingColor};
|
|
46
|
+
|
|
47
|
+
> svg {
|
|
48
|
+
font-size: 20px;
|
|
49
|
+
&.fill {
|
|
50
|
+
color: ${props => props.theme.colors.primary};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`
|
|
54
|
+
|
|
55
|
+
export const PublishingName = styled.span`
|
|
56
|
+
color: ${props => props.theme.colors.headingColor};
|
|
57
|
+
font-size: 14px;
|
|
58
|
+
${props => props.theme?.rtl ? css`
|
|
59
|
+
margin-left: 10px;
|
|
60
|
+
` : css`
|
|
61
|
+
margin-right: 10px;
|
|
62
|
+
`}
|
|
63
|
+
`
|
|
@@ -59,7 +59,7 @@ export const BusinessSummary = (props) => {
|
|
|
59
59
|
window.open(`https://${ordering.project}.tryordering.com/store/${businessState?.business?.slug}`, '_blank')
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
const itemsExcluded = !!spoonityConfig ? ['publishing'] : ['publishing', 'spoonity_key']
|
|
62
|
+
const itemsExcluded = !!spoonityConfig ? ['publishing', 'personalization'] : ['publishing', 'spoonity_key', 'personalization']
|
|
63
63
|
|
|
64
64
|
const businessConfigs = [
|
|
65
65
|
{
|
|
@@ -33,6 +33,8 @@ import { BusinessTypes } from './BusinessTypes'
|
|
|
33
33
|
import { BusinessVideos } from './BusinessVideos'
|
|
34
34
|
import { BusinessWebhooks } from './BusinessWebhooks'
|
|
35
35
|
import { BusinessWidgets } from './BusinessWidgets'
|
|
36
|
+
import { BusinessQRCodeOption } from './BusinessQRCodeOption'
|
|
37
|
+
import { BusinessQRCodeOptions } from './BusinessQRCodeOptions'
|
|
36
38
|
import { SeoOptions } from './SeoOptions'
|
|
37
39
|
import { AddBusinessForm } from './AddBusinessForm'
|
|
38
40
|
import { WizardBusiness } from './WizardBusiness'
|
|
@@ -143,6 +145,8 @@ export {
|
|
|
143
145
|
BusinessVideos,
|
|
144
146
|
BusinessWebhooks,
|
|
145
147
|
BusinessWidgets,
|
|
148
|
+
BusinessQRCodeOption,
|
|
149
|
+
BusinessQRCodeOptions,
|
|
146
150
|
SeoOptions,
|
|
147
151
|
AddBusinessForm,
|
|
148
152
|
WizardBusiness,
|
package/src/utils/index.js
CHANGED
|
@@ -261,6 +261,22 @@ export const checkPreSiteUrl = (url, fallback) => {
|
|
|
261
261
|
return url[0] === '/' ? url : `/${url}`
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
+
/**
|
|
265
|
+
* Function to validate URL
|
|
266
|
+
* @param {string} url URL of page
|
|
267
|
+
*/
|
|
268
|
+
export const checkValidUrlFormat = (url) => {
|
|
269
|
+
if (!url) return
|
|
270
|
+
const pattern = new RegExp('^(https?:\\/\\/)?' + // protocol
|
|
271
|
+
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
|
|
272
|
+
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
|
|
273
|
+
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
|
|
274
|
+
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
|
|
275
|
+
'(\\#[-a-z\\d_]*)?$', 'i') // fragment locator
|
|
276
|
+
|
|
277
|
+
return pattern.test(url)
|
|
278
|
+
}
|
|
279
|
+
|
|
264
280
|
/**
|
|
265
281
|
* default value for bitton
|
|
266
282
|
*/
|