ordering-ui-admin-external 1.7.3 → 1.8.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.
Files changed (102) hide show
  1. package/_bundles/{ordering-ui-admin.499cd3aed4f9480d7496.js → ordering-ui-admin.22db20d62f2d39ead727.js} +2 -2
  2. package/_bundles/{ordering-ui-admin.499cd3aed4f9480d7496.js.LICENSE.txt → ordering-ui-admin.22db20d62f2d39ead727.js.LICENSE.txt} +0 -0
  3. package/_modules/components/Delivery/DriversGroupDeliveryDetails/index.js +104 -0
  4. package/_modules/components/Delivery/DriversGroupDeliveryDetails/styles.js +12 -0
  5. package/_modules/components/Delivery/DriversGroupDeliveryZoneInformation/index.js +274 -0
  6. package/_modules/components/Delivery/DriversGroupDeliveryZoneInformation/styles.js +40 -0
  7. package/_modules/components/Delivery/DriversGroupDeliveryZoneList/index.js +119 -0
  8. package/_modules/components/Delivery/DriversGroupDeliveryZoneList/styles.js +54 -0
  9. package/_modules/components/Delivery/DriversGroupDetails/index.js +37 -8
  10. package/_modules/components/Delivery/DriversGroupsDeliveryZoneDetails/index.js +125 -0
  11. package/_modules/components/Delivery/DriversGroupsDeliveryZoneDetails/styles.js +62 -0
  12. package/_modules/components/Delivery/DriversGroupsList/index.js +2 -1
  13. package/_modules/components/Delivery/DriversGroupsListing/index.js +12 -6
  14. package/_modules/components/Home/HomePage/index.js +2 -2
  15. package/_modules/components/Orders/Messages/index.js +1 -1
  16. package/_modules/components/SidebarMenu/index.js +4 -3
  17. package/_modules/components/SidebarMenu/styles.js +22 -18
  18. package/_modules/components/Stores/BusinessDelete/index.js +99 -0
  19. package/_modules/components/Stores/BusinessDelete/styles.js +19 -0
  20. package/_modules/components/Stores/BusinessDeliveryGroupsDetails/index.js +181 -0
  21. package/_modules/components/Stores/BusinessDeliveryGroupsDetails/styles.js +14 -0
  22. package/_modules/components/Stores/BusinessDeliveryPickupMore/index.js +5 -1
  23. package/_modules/components/Stores/BusinessDeliveryZoneInformation/index.js +34 -12
  24. package/_modules/components/Stores/BusinessDeliveryZoneInformation/styles.js +1 -1
  25. package/_modules/components/Stores/BusinessProductAddForm/index.js +4 -4
  26. package/_modules/components/Stores/BusinessWidgets/index.js +12 -82
  27. package/_modules/components/Stores/BusinessWidgets/styles.js +3 -7
  28. package/_modules/components/Stores/BusinessesList/index.js +75 -10
  29. package/_modules/components/Stores/BusinessesList/styles.js +26 -3
  30. package/_modules/components/Stores/BusinessesListing/index.js +19 -4
  31. package/_modules/components/Stores/BusinessesListing/styles.js +10 -3
  32. package/_modules/components/Stores/PaymentOptionMethods/index.js +11 -12
  33. package/_modules/components/Stores/PaymentOptionMethods/styles.js +1 -5
  34. package/_modules/components/Stores/PaymentOptionPaypal/index.js +6 -7
  35. package/_modules/components/Stores/PaymentOptionPaypal/styles.js +1 -5
  36. package/_modules/components/Stores/PaymentOptionSquare/index.js +1 -1
  37. package/_modules/components/Stores/PaymentOptionStripeDirect/index.js +11 -12
  38. package/_modules/components/Stores/PaymentOptionStripeDirect/styles.js +1 -5
  39. package/_modules/components/Stores/PaymethodOptionPaypalExpress/index.js +11 -12
  40. package/_modules/components/Stores/PaymethodOptionPaypalExpress/styles.js +1 -5
  41. package/_modules/components/Stores/PaymethodOptionStripeRedirect/index.js +11 -12
  42. package/_modules/components/Stores/PaymethodOptionStripeRedirect/styles.js +1 -5
  43. package/_modules/components/Stores/SingleBusiness/index.js +37 -19
  44. package/_modules/components/Stores/SingleBusiness/styles.js +20 -3
  45. package/_modules/components/Stores/index.js +7 -0
  46. package/package.json +2 -2
  47. package/src/components/Delivery/DriversGroupDeliveryDetails/index.js +84 -0
  48. package/src/components/Delivery/DriversGroupDeliveryDetails/styles.js +11 -0
  49. package/src/components/Delivery/DriversGroupDeliveryZoneInformation/index.js +278 -0
  50. package/src/components/Delivery/DriversGroupDeliveryZoneInformation/styles.js +93 -0
  51. package/src/components/Delivery/DriversGroupDeliveryZoneList/index.js +134 -0
  52. package/src/components/Delivery/DriversGroupDeliveryZoneList/styles.js +87 -0
  53. package/src/components/Delivery/DriversGroupDetails/index.js +29 -6
  54. package/src/components/Delivery/DriversGroupsDeliveryZoneDetails/index.js +123 -0
  55. package/src/components/Delivery/DriversGroupsDeliveryZoneDetails/styles.js +125 -0
  56. package/src/components/Delivery/DriversGroupsList/index.js +2 -2
  57. package/src/components/Delivery/DriversGroupsListing/index.js +4 -1
  58. package/src/components/Home/HomePage/index.js +3 -3
  59. package/src/components/Orders/Messages/index.js +1 -1
  60. package/src/components/SidebarMenu/index.js +25 -15
  61. package/src/components/SidebarMenu/styles.js +10 -2
  62. package/src/components/Stores/BusinessDelete/index.js +99 -0
  63. package/src/components/Stores/BusinessDelete/styles.js +40 -0
  64. package/src/components/Stores/BusinessDeliveryGroupsDetails/index.js +127 -0
  65. package/src/components/Stores/BusinessDeliveryGroupsDetails/styles.js +16 -0
  66. package/src/components/Stores/BusinessDeliveryPickupMore/index.js +6 -1
  67. package/src/components/Stores/BusinessDeliveryZoneInformation/index.js +35 -10
  68. package/src/components/Stores/BusinessDeliveryZoneInformation/styles.js +1 -1
  69. package/src/components/Stores/BusinessProductAddForm/index.js +2 -2
  70. package/src/components/Stores/BusinessWidgets/index.js +76 -143
  71. package/src/components/Stores/BusinessWidgets/styles.js +0 -10
  72. package/src/components/Stores/BusinessesList/index.js +83 -10
  73. package/src/components/Stores/BusinessesList/styles.js +52 -0
  74. package/src/components/Stores/BusinessesListing/index.js +27 -8
  75. package/src/components/Stores/BusinessesListing/styles.js +34 -0
  76. package/src/components/Stores/PaymentOptionMethods/index.js +9 -12
  77. package/src/components/Stores/PaymentOptionMethods/styles.js +0 -10
  78. package/src/components/Stores/PaymentOptionPaypal/index.js +9 -12
  79. package/src/components/Stores/PaymentOptionPaypal/styles.js +0 -10
  80. package/src/components/Stores/PaymentOptionSquare/index.js +1 -1
  81. package/src/components/Stores/PaymentOptionStripeDirect/index.js +9 -12
  82. package/src/components/Stores/PaymentOptionStripeDirect/styles.js +0 -10
  83. package/src/components/Stores/PaymethodOptionPaypalExpress/index.js +9 -12
  84. package/src/components/Stores/PaymethodOptionPaypalExpress/styles.js +0 -10
  85. package/src/components/Stores/PaymethodOptionStripeRedirect/index.js +9 -12
  86. package/src/components/Stores/PaymethodOptionStripeRedirect/styles.js +0 -10
  87. package/src/components/Stores/SingleBusiness/index.js +38 -13
  88. package/src/components/Stores/SingleBusiness/styles.js +30 -0
  89. package/src/components/Stores/index.js +2 -0
  90. package/template/assets/images/myProducts/driver-app-brand.png +0 -0
  91. package/template/assets/images/myProducts/driver-app-free.png +0 -0
  92. package/template/assets/images/myProducts/multi-store-customer-app.png +0 -0
  93. package/template/assets/images/myProducts/my-callcenter-app-brand.png +0 -0
  94. package/template/assets/images/myProducts/my-callcenter-app-live.png +0 -0
  95. package/template/assets/images/myProducts/my-kiosk-app-brand.png +0 -0
  96. package/template/assets/images/myProducts/my-kiosk-app-live.png +0 -0
  97. package/template/assets/images/myProducts/my-pos-app-brand.png +0 -0
  98. package/template/assets/images/myProducts/my-pos-app-live.png +0 -0
  99. package/template/assets/images/myProducts/ordering-website.png +0 -0
  100. package/template/assets/images/myProducts/single-store-customer-app.png +0 -0
  101. package/template/assets/images/myProducts/store-app-brand.png +0 -0
  102. package/template/assets/images/myProducts/store-app-free.png +0 -0
@@ -103,3 +103,55 @@ export const AddFirstStoreContainer = styled.div`
103
103
  }
104
104
  }
105
105
  `
106
+
107
+ export const CheckBoxWrapper = styled.div`
108
+ cursor: pointer;
109
+ display: flex;
110
+ ${props => props.theme?.rtl ? css`
111
+ margin-left: 10px;
112
+ ` : css`
113
+ margin-right: 10px;
114
+ `}
115
+ svg {
116
+ font-size: 16px;
117
+ color: ${props => props.theme.colors.secundaryLight};
118
+ }
119
+
120
+ ${({ isChecked }) => isChecked && css`
121
+ svg {
122
+ color: ${props => props.theme.colors?.primary};
123
+ }
124
+ `}
125
+ `
126
+
127
+ export const BusinessIdWrapper = styled.div`
128
+ display: flex;
129
+ align-items: center;
130
+ `
131
+
132
+ export const ActionWrapper = styled.div`
133
+ display: flex;
134
+ align-items: center;
135
+ justify-content: flex-end;
136
+
137
+ > label {
138
+ margin-left: 5px;
139
+ ${props => props.theme.rtl && css`
140
+ margin-right: 5px;
141
+ margin-left: 0px;
142
+ `}
143
+ }
144
+ `
145
+
146
+ export const FeaturedWrapper = styled.div`
147
+ display: flex;
148
+ align-items: center;
149
+
150
+ label {
151
+ margin-right: 5px;
152
+ ${props => props.theme.rtl && css`
153
+ margin-right: 0px;
154
+ margin-left: 5px;
155
+ `}
156
+ }
157
+ `
@@ -18,9 +18,11 @@ import {
18
18
  BusinessListingContainer,
19
19
  ViewContainer,
20
20
  WrapperView,
21
- ViewMethodButton
21
+ ViewMethodButton,
22
+ ButtonGroup
22
23
  } from './styles'
23
24
  import { BusinessSync } from '../BusinessSync'
25
+ import { BusinessDelete } from '../BusinessDelete'
24
26
 
25
27
  const BusinessesListingUI = (props) => {
26
28
  const {
@@ -37,7 +39,12 @@ const BusinessesListingUI = (props) => {
37
39
  loadBusinesses,
38
40
  onSearch,
39
41
  onBusinessRedirect,
40
- getPageBusinesses
42
+ getPageBusinesses,
43
+ businessIds,
44
+ handleChangeBusinessIds,
45
+ handleEnableAllBusiness,
46
+ handleDeleteMultiBusinesses,
47
+ setBusinessIds
41
48
  } = props
42
49
 
43
50
  const query = new URLSearchParams(useLocation().search)
@@ -170,12 +177,19 @@ const BusinessesListingUI = (props) => {
170
177
  </ViewMethodButton>
171
178
  </WrapperView>
172
179
  </ViewContainer>
173
- <BusinessTypeFilter
174
- businessTypes={props.businessTypes}
175
- defaultBusinessType={props.defaultBusinessType}
176
- handleChangeBusinessType={handleChangeBusinessType}
177
- setBusinessTypes={setBusinessTypes}
178
- />
180
+ <ButtonGroup isSelect={businessIds?.length > 0}>
181
+ <BusinessTypeFilter
182
+ businessTypes={props.businessTypes}
183
+ defaultBusinessType={props.defaultBusinessType}
184
+ handleChangeBusinessType={handleChangeBusinessType}
185
+ setBusinessTypes={setBusinessTypes}
186
+ />
187
+ {businessIds?.length > 0 && (
188
+ <BusinessDelete
189
+ handleDeleteMultiBusinesses={handleDeleteMultiBusinesses}
190
+ />
191
+ )}
192
+ </ButtonGroup>
179
193
  <BusinessesList
180
194
  viewMethod={viewMethod}
181
195
  businessList={businessList}
@@ -189,6 +203,11 @@ const BusinessesListingUI = (props) => {
189
203
  handleOpenBusinessDetails={handleOpenBusinessDetails}
190
204
  handleOpenAddBusiness={handleOpenAddBusiness}
191
205
  isTutorialMode={isTutorialMode}
206
+ businessIds={businessIds}
207
+ setBusinessIds={setBusinessIds}
208
+ handleChangeBusinessIds={handleChangeBusinessIds}
209
+ handleEnableAllBusiness={handleEnableAllBusiness}
210
+ selectedBusinessActiveState={selectedBusinessActiveState}
192
211
  />
193
212
  </BusinessListingContainer>
194
213
  {openBusinessDetails && (
@@ -50,3 +50,37 @@ export const ViewMethodButton = styled.span`
50
50
  }
51
51
  }
52
52
  `
53
+
54
+ export const ButtonGroup = styled.div`
55
+ display: flex;
56
+ justify-content: space-between;
57
+ align-items: flex-end;
58
+ flex-direction: column;
59
+ > div {
60
+ width: 100%;
61
+ }
62
+
63
+ @media (min-width: 769px) {
64
+ flex-direction: row;
65
+ align-items: center;
66
+ ${({ isSelect }) => isSelect && css`
67
+ > div {
68
+ width: calc(100% - 100px);
69
+ }
70
+ `}
71
+ }
72
+
73
+ > button {
74
+ height: 42px;
75
+ display: flex;
76
+ align-items: center;
77
+ svg {
78
+ min-width: 14px;
79
+ margin-left: 5px;
80
+ ${props => props.theme.rtl && css`
81
+ margin-left: 0px;
82
+ margin-right: 5px;
83
+ `}
84
+ }
85
+ }
86
+ `
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
3
  import RiCheckboxBlankLine from '@meronex/icons/ri/RiCheckboxBlankLine'
4
4
  import RiCheckboxFill from '@meronex/icons/ri/RiCheckboxFill'
5
- import { Button, Input, IconButton } from '../../../styles'
5
+ import { Button, Input, IconButton, Checkbox } from '../../../styles'
6
6
  import { useWindowSize } from '../../../hooks/useWindowSize'
7
7
  import { useTheme } from 'styled-components'
8
8
  import { ThreeDots, XLg } from 'react-bootstrap-icons'
@@ -46,7 +46,7 @@ export const PaymentOptionMethods = (props) => {
46
46
  const [isMenuOpen, setIsMenuOpen] = useState(false)
47
47
  const [paymentTabs, setPaymentTabs] = useState(0)
48
48
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
49
- const [localState, setLocalState] = useState({allowed_order_types: businessPaymethod?.allowed_order_types, sites: businessPaymethod?.sites})
49
+ const [localState, setLocalState] = useState({ allowed_order_types: businessPaymethod?.allowed_order_types, sites: businessPaymethod?.sites })
50
50
 
51
51
  const setPaymethodInfo = (values) => {
52
52
  const data = {}
@@ -112,10 +112,10 @@ export const PaymentOptionMethods = (props) => {
112
112
 
113
113
  useEffect(() => {
114
114
  if (changesState?.allowed_order_types) {
115
- setLocalState({allowed_order_types: changesState?.allowed_order_types})
115
+ setLocalState({ allowed_order_types: changesState?.allowed_order_types })
116
116
  }
117
117
  if (changesState?.sites) {
118
- setLocalState({sites: changesState?.sites})
118
+ setLocalState({ sites: changesState?.sites })
119
119
  }
120
120
  }, [changesState?.sites, changesState?.allowed_order_types])
121
121
 
@@ -172,14 +172,11 @@ export const PaymentOptionMethods = (props) => {
172
172
 
173
173
  {paymentTabs === 0 && (
174
174
  <>
175
- <SandboxWrapper
176
- onClick={() => handleChangeSandbox()}
177
- >
178
- {changesState?.sandbox ?? businessPaymethod?.sandbox ? (
179
- <RiCheckboxFill className='fill' />
180
- ) : (
181
- <RiCheckboxBlankLine />
182
- )}
175
+ <SandboxWrapper>
176
+ <Checkbox
177
+ checked={changesState?.sandbox ?? businessPaymethod?.sandbox ?? false}
178
+ onChange={e => handleChangeSandbox(e.target.checked)}
179
+ />
183
180
  <span>{t('SANDBOX', 'Sandbox')}</span>
184
181
  </SandboxWrapper>
185
182
  <FieldName>{t('PUBLISHABLE_KEY', 'Publishable key')}</FieldName>
@@ -29,7 +29,6 @@ export const Container = styled.div`
29
29
  `
30
30
 
31
31
  export const SandboxWrapper = styled.div`
32
- cursor: pointer;
33
32
  margin-top: 30px;
34
33
  display: flex;
35
34
  align-items: center;
@@ -41,15 +40,6 @@ export const SandboxWrapper = styled.div`
41
40
  margin-left: 10px;
42
41
  `}
43
42
  }
44
-
45
- svg {
46
- font-size: 20px;
47
- color: ${props => props.theme.colors.lightGray};
48
-
49
- &.fill {
50
- color: ${props => props.theme.colors.primary};
51
- }
52
- }
53
43
  `
54
44
 
55
45
  export const FieldName = styled.p`
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
3
  import RiCheckboxBlankLine from '@meronex/icons/ri/RiCheckboxBlankLine'
4
4
  import RiCheckboxFill from '@meronex/icons/ri/RiCheckboxFill'
5
- import { Button, Input, IconButton } from '../../../styles'
5
+ import { Button, Input, IconButton, Checkbox } from '../../../styles'
6
6
  import { useWindowSize } from '../../../hooks/useWindowSize'
7
7
  import { useTheme } from 'styled-components'
8
8
  import { ThreeDots, XLg } from 'react-bootstrap-icons'
@@ -44,7 +44,7 @@ export const PaymentOptionPaypal = (props) => {
44
44
  const [isMenuOpen, setIsMenuOpen] = useState(false)
45
45
  const [paymentTabs, setPaymentTabs] = useState(0)
46
46
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
47
- const [localState, setLocalState] = useState({allowed_order_types: businessPaymethod?.allowed_order_types, sites: businessPaymethod?.sites})
47
+ const [localState, setLocalState] = useState({ allowed_order_types: businessPaymethod?.allowed_order_types, sites: businessPaymethod?.sites })
48
48
 
49
49
  const actionSidebar = (value) => {
50
50
  if (!value) {
@@ -112,10 +112,10 @@ export const PaymentOptionPaypal = (props) => {
112
112
 
113
113
  useEffect(() => {
114
114
  if (changesState?.allowed_order_types) {
115
- setLocalState({allowed_order_types: changesState?.allowed_order_types})
115
+ setLocalState({ allowed_order_types: changesState?.allowed_order_types })
116
116
  }
117
117
  if (changesState?.sites) {
118
- setLocalState({sites: changesState?.sites})
118
+ setLocalState({ sites: changesState?.sites })
119
119
  }
120
120
  }, [changesState?.sites, changesState?.allowed_order_types])
121
121
 
@@ -172,14 +172,11 @@ export const PaymentOptionPaypal = (props) => {
172
172
 
173
173
  {paymentTabs === 0 && (
174
174
  <>
175
- <SandboxWrapper
176
- onClick={() => handleChangeSandbox()}
177
- >
178
- {changesState?.sandbox ? (
179
- <RiCheckboxFill className='fill' />
180
- ) : (
181
- <RiCheckboxBlankLine />
182
- )}
175
+ <SandboxWrapper>
176
+ <Checkbox
177
+ checked={changesState?.sandbox ?? businessPaymethod?.sandbox}
178
+ onChange={e => handleChangeSandbox(e.target.checked)}
179
+ />
183
180
  <span>{t('SANDBOX', 'Sandbox')}</span>
184
181
  </SandboxWrapper>
185
182
  <FieldName>{t('CLIENT_ID', 'Client ID')}</FieldName>
@@ -29,7 +29,6 @@ export const Container = styled.div`
29
29
  `
30
30
 
31
31
  export const SandboxWrapper = styled.div`
32
- cursor: pointer;
33
32
  margin-top: 30px;
34
33
  display: flex;
35
34
  align-items: center;
@@ -41,15 +40,6 @@ export const SandboxWrapper = styled.div`
41
40
  margin-left: 10px;
42
41
  `}
43
42
  }
44
-
45
- svg {
46
- font-size: 20px;
47
- color: ${props => props.theme.colors.lightGray};
48
-
49
- &.fill {
50
- color: ${props => props.theme.colors.primary};
51
- }
52
- }
53
43
  `
54
44
 
55
45
  export const FieldName = styled.p`
@@ -174,7 +174,7 @@ const PaymentOptionSquareUI = (props) => {
174
174
  <FormContainer>
175
175
  <SandboxWrapper>
176
176
  <Checkbox
177
- defaultChecked={squareData?.sandbox ?? businessPaymethod?.sandbox ?? false}
177
+ checked={squareData?.sandbox ?? businessPaymethod?.sandbox ?? false}
178
178
  onChange={e => handleChangeSandbox(e.target.checked)}
179
179
  />
180
180
  <span>{t('SANDBOX', 'Sandbox')}</span>
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
3
  import RiCheckboxBlankLine from '@meronex/icons/ri/RiCheckboxBlankLine'
4
4
  import RiCheckboxFill from '@meronex/icons/ri/RiCheckboxFill'
5
- import { Button, Input, IconButton } from '../../../styles'
5
+ import { Button, Input, IconButton, Checkbox } from '../../../styles'
6
6
  import { useWindowSize } from '../../../hooks/useWindowSize'
7
7
  import { useTheme } from 'styled-components'
8
8
  import { ThreeDots, XLg } from 'react-bootstrap-icons'
@@ -44,7 +44,7 @@ export const PaymentOptionStripeDirect = (props) => {
44
44
  const [isMenuOpen, setIsMenuOpen] = useState(false)
45
45
  const [paymentTabs, setPaymentTabs] = useState(0)
46
46
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
47
- const [localState, setLocalState] = useState({allowed_order_types: businessPaymethod?.allowed_order_types, sites: businessPaymethod?.sites})
47
+ const [localState, setLocalState] = useState({ allowed_order_types: businessPaymethod?.allowed_order_types, sites: businessPaymethod?.sites })
48
48
 
49
49
  const setPaymethodInfo = (values) => {
50
50
  const data = {}
@@ -110,10 +110,10 @@ export const PaymentOptionStripeDirect = (props) => {
110
110
 
111
111
  useEffect(() => {
112
112
  if (changesState?.allowed_order_types) {
113
- setLocalState({allowed_order_types: changesState?.allowed_order_types})
113
+ setLocalState({ allowed_order_types: changesState?.allowed_order_types })
114
114
  }
115
115
  if (changesState?.sites) {
116
- setLocalState({sites: changesState?.sites})
116
+ setLocalState({ sites: changesState?.sites })
117
117
  }
118
118
  }, [changesState?.sites, changesState?.allowed_order_types])
119
119
 
@@ -170,14 +170,11 @@ export const PaymentOptionStripeDirect = (props) => {
170
170
 
171
171
  {paymentTabs === 0 && (
172
172
  <>
173
- <SandboxWrapper
174
- onClick={() => handleChangeSandbox()}
175
- >
176
- {changesState?.sandbox ? (
177
- <RiCheckboxFill className='fill' />
178
- ) : (
179
- <RiCheckboxBlankLine />
180
- )}
173
+ <SandboxWrapper>
174
+ <Checkbox
175
+ checked={changesState?.sandbox ?? businessPaymethod?.sandbox ?? false}
176
+ onChange={e => handleChangeSandbox(e.target.checked)}
177
+ />
181
178
  <span>{t('SANDBOX', 'Sandbox')}</span>
182
179
  </SandboxWrapper>
183
180
  <FieldName>{t('PUBLISHABLE_KEY', 'Publishable key')}</FieldName>
@@ -29,7 +29,6 @@ export const Container = styled.div`
29
29
  `
30
30
 
31
31
  export const SandboxWrapper = styled.div`
32
- cursor: pointer;
33
32
  margin-top: 30px;
34
33
  display: flex;
35
34
  align-items: center;
@@ -41,15 +40,6 @@ export const SandboxWrapper = styled.div`
41
40
  margin-left: 10px;
42
41
  `}
43
42
  }
44
-
45
- svg {
46
- font-size: 20px;
47
- color: ${props => props.theme.colors.lightGray};
48
-
49
- &.fill {
50
- color: ${props => props.theme.colors.primary};
51
- }
52
- }
53
43
  `
54
44
 
55
45
  export const FieldName = styled.p`
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
3
  import RiCheckboxBlankLine from '@meronex/icons/ri/RiCheckboxBlankLine'
4
4
  import RiCheckboxFill from '@meronex/icons/ri/RiCheckboxFill'
5
- import { Button, Input, IconButton } from '../../../styles'
5
+ import { Button, Input, IconButton, Checkbox } from '../../../styles'
6
6
  import { useWindowSize } from '../../../hooks/useWindowSize'
7
7
  import { useTheme } from 'styled-components'
8
8
  import { ThreeDots, XLg } from 'react-bootstrap-icons'
@@ -44,7 +44,7 @@ export const PaymethodOptionPaypalExpress = (props) => {
44
44
  const [isMenuOpen, setIsMenuOpen] = useState(false)
45
45
  const [paymentTabs, setPaymentTabs] = useState(0)
46
46
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
47
- const [localState, setLocalState] = useState({allowed_order_types: businessPaymethod?.allowed_order_types, sites: businessPaymethod?.sites})
47
+ const [localState, setLocalState] = useState({ allowed_order_types: businessPaymethod?.allowed_order_types, sites: businessPaymethod?.sites })
48
48
 
49
49
  const setPaymethodInfo = (values) => {
50
50
  const data = {}
@@ -114,10 +114,10 @@ export const PaymethodOptionPaypalExpress = (props) => {
114
114
 
115
115
  useEffect(() => {
116
116
  if (changesState?.allowed_order_types) {
117
- setLocalState({allowed_order_types: changesState?.allowed_order_types})
117
+ setLocalState({ allowed_order_types: changesState?.allowed_order_types })
118
118
  }
119
119
  if (changesState?.sites) {
120
- setLocalState({sites: changesState?.sites})
120
+ setLocalState({ sites: changesState?.sites })
121
121
  }
122
122
  }, [changesState?.sites, changesState?.allowed_order_types])
123
123
 
@@ -174,14 +174,11 @@ export const PaymethodOptionPaypalExpress = (props) => {
174
174
 
175
175
  {paymentTabs === 0 && (
176
176
  <>
177
- <SandboxWrapper
178
- onClick={() => handleChangeSandbox()}
179
- >
180
- {changesState?.sandbox ? (
181
- <RiCheckboxFill className='fill' />
182
- ) : (
183
- <RiCheckboxBlankLine />
184
- )}
177
+ <SandboxWrapper>
178
+ <Checkbox
179
+ checked={changesState?.sandbox ?? businessPaymethod?.sandbox ?? false}
180
+ onChange={e => handleChangeSandbox(e.target.checked)}
181
+ />
185
182
  <span>{t('SANDBOX', 'Sandbox')}</span>
186
183
  </SandboxWrapper>
187
184
  <FieldName>{t('CLIENT_ID', 'Client ID')}</FieldName>
@@ -29,7 +29,6 @@ export const Container = styled.div`
29
29
  `
30
30
 
31
31
  export const SandboxWrapper = styled.div`
32
- cursor: pointer;
33
32
  margin-top: 30px;
34
33
  display: flex;
35
34
  align-items: center;
@@ -41,15 +40,6 @@ export const SandboxWrapper = styled.div`
41
40
  margin-left: 10px;
42
41
  `}
43
42
  }
44
-
45
- svg {
46
- font-size: 20px;
47
- color: ${props => props.theme.colors.lightGray};
48
-
49
- &.fill {
50
- color: ${props => props.theme.colors.primary};
51
- }
52
- }
53
43
  `
54
44
 
55
45
  export const FieldName = styled.p`
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
3
  import RiCheckboxBlankLine from '@meronex/icons/ri/RiCheckboxBlankLine'
4
4
  import RiCheckboxFill from '@meronex/icons/ri/RiCheckboxFill'
5
- import { Button, Input, IconButton } from '../../../styles'
5
+ import { Button, Input, IconButton, Checkbox } from '../../../styles'
6
6
  import { useWindowSize } from '../../../hooks/useWindowSize'
7
7
  import { useTheme } from 'styled-components'
8
8
  import { ThreeDots, XLg } from 'react-bootstrap-icons'
@@ -44,7 +44,7 @@ export const PaymethodOptionStripeRedirect = (props) => {
44
44
  const [isMenuOpen, setIsMenuOpen] = useState(false)
45
45
  const [paymentTabs, setPaymentTabs] = useState(0)
46
46
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
47
- const [localState, setLocalState] = useState({allowed_order_types: businessPaymethod?.allowed_order_types, sites: businessPaymethod?.sites})
47
+ const [localState, setLocalState] = useState({ allowed_order_types: businessPaymethod?.allowed_order_types, sites: businessPaymethod?.sites })
48
48
 
49
49
  const setPaymethodInfo = (values) => {
50
50
  const data = {}
@@ -110,10 +110,10 @@ export const PaymethodOptionStripeRedirect = (props) => {
110
110
 
111
111
  useEffect(() => {
112
112
  if (changesState?.allowed_order_types) {
113
- setLocalState({allowed_order_types: changesState?.allowed_order_types})
113
+ setLocalState({ allowed_order_types: changesState?.allowed_order_types })
114
114
  }
115
115
  if (changesState?.sites) {
116
- setLocalState({sites: changesState?.sites})
116
+ setLocalState({ sites: changesState?.sites })
117
117
  }
118
118
  }, [changesState?.sites, changesState?.allowed_order_types])
119
119
 
@@ -170,14 +170,11 @@ export const PaymethodOptionStripeRedirect = (props) => {
170
170
 
171
171
  {paymentTabs === 0 && (
172
172
  <>
173
- <SandboxWrapper
174
- onClick={() => handleChangeSandbox()}
175
- >
176
- {changesState?.sandbox ? (
177
- <RiCheckboxFill className='fill' />
178
- ) : (
179
- <RiCheckboxBlankLine />
180
- )}
173
+ <SandboxWrapper>
174
+ <Checkbox
175
+ checked={changesState?.sandbox ?? businessPaymethod?.sandbox ?? false}
176
+ onChange={e => handleChangeSandbox(e.target.checked)}
177
+ />
181
178
  <span>{t('SANDBOX', 'Sandbox')}</span>
182
179
  </SandboxWrapper>
183
180
  <FieldName>{t('PUBLISHABLE_KEY', 'Publishable key')}</FieldName>
@@ -29,7 +29,6 @@ export const Container = styled.div`
29
29
  `
30
30
 
31
31
  export const SandboxWrapper = styled.div`
32
- cursor: pointer;
33
32
  margin-top: 30px;
34
33
  display: flex;
35
34
  align-items: center;
@@ -41,15 +40,6 @@ export const SandboxWrapper = styled.div`
41
40
  margin-left: 10px;
42
41
  `}
43
42
  }
44
-
45
- svg {
46
- font-size: 20px;
47
- color: ${props => props.theme.colors.lightGray};
48
-
49
- &.fill {
50
- color: ${props => props.theme.colors.primary};
51
- }
52
- }
53
43
  `
54
44
 
55
45
  export const FieldName = styled.p`
@@ -3,7 +3,7 @@ import Skeleton from 'react-loading-skeleton'
3
3
  import { useUtils, useLanguage, BusinessDetails as BusinessController } from 'ordering-components-admin-external'
4
4
  import { useTheme } from 'styled-components'
5
5
  import { Switch } from '../../../styles'
6
- import { StarFill } from 'react-bootstrap-icons'
6
+ import { StarFill, CheckSquareFill, Square } from 'react-bootstrap-icons'
7
7
 
8
8
  import {
9
9
  SingleBusinessContainer,
@@ -17,7 +17,10 @@ import {
17
17
  BusinessLogo,
18
18
  BusinessContent,
19
19
  BusinessActionContainer,
20
- BusinessHeaderContent
20
+ BusinessHeaderContent,
21
+ BusinessIdWrapper,
22
+ CheckBoxWrapper,
23
+ FeaturedWrapper
21
24
  } from './styles'
22
25
 
23
26
  const SingleBusinessUI = (props) => {
@@ -28,7 +31,9 @@ const SingleBusinessUI = (props) => {
28
31
  businessState,
29
32
  handleChangeActiveBusiness,
30
33
  handleOpenBusinessDetails,
31
- detailsBusinessId
34
+ detailsBusinessId,
35
+ businessIds,
36
+ handleChangeBusinessIds
32
37
  } = props
33
38
 
34
39
  const [, t] = useLanguage()
@@ -36,7 +41,10 @@ const SingleBusinessUI = (props) => {
36
41
  const theme = useTheme()
37
42
 
38
43
  const handleClickBusiness = (e) => {
39
- const isInvalid = e.target.closest('.business_enable_control') || e.target.closest('.business_actions')
44
+ const isInvalid = e.target.closest('.business_enable_control') ||
45
+ e.target.closest('.business_actions') ||
46
+ e.target.closest('.business-id') ||
47
+ e.target.closest('.featured')
40
48
  if (isInvalid) return
41
49
  handleOpenBusinessDetails(businessState?.business)
42
50
  }
@@ -48,8 +56,11 @@ const SingleBusinessUI = (props) => {
48
56
  {(businessState?.loading || isSkeleton) ? (
49
57
  <SingleBusinessContainer>
50
58
  <tr>
51
- <td className='business-id'>
52
- <Skeleton width={30} />
59
+ <td>
60
+ <BusinessIdWrapper>
61
+ <Skeleton width={18} height={18} />
62
+ <Skeleton width={40} style={{ margin: '0px 5px' }} />
63
+ </BusinessIdWrapper>
53
64
  </td>
54
65
  {allowColumns?.business && (
55
66
  <td className='business'>
@@ -90,8 +101,21 @@ const SingleBusinessUI = (props) => {
90
101
  onClick={(e) => handleClickBusiness(e)}
91
102
  >
92
103
  <tr>
93
- <td className='business-id'>
94
- {businessState?.business?.id}
104
+ <td>
105
+ <BusinessIdWrapper>
106
+ <CheckBoxWrapper
107
+ className='business-id'
108
+ isChecked={businessIds.includes(businessState?.business?.id)}
109
+ onClick={() => handleChangeBusinessIds(businessState?.business?.id)}
110
+ >
111
+ {(!businessState?.loading && businessIds.includes(businessState?.business?.id)) ? (
112
+ <CheckSquareFill />
113
+ ) : (
114
+ <Square />
115
+ )}
116
+ </CheckBoxWrapper>
117
+ {businessState?.business?.id}
118
+ </BusinessIdWrapper>
95
119
  </td>
96
120
  {allowColumns?.business && (
97
121
  <td className='business'>
@@ -108,11 +132,12 @@ const SingleBusinessUI = (props) => {
108
132
  )}
109
133
  {allowColumns?.featured && (
110
134
  <td>
111
- <InfoBlock>
112
- {businessState?.business?.featured && (
113
- <span>{t('FEATURE', 'Featured')}</span>
114
- )}
115
- </InfoBlock>
135
+ <FeaturedWrapper className='featured'>
136
+ <Switch
137
+ defaultChecked={businessState?.business?.featured}
138
+ onChange={(enabled) => handleChangeActiveBusiness(enabled, true)}
139
+ />
140
+ </FeaturedWrapper>
116
141
  </td>
117
142
  )}
118
143
  {allowColumns?.ratings && (