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.
Files changed (87) hide show
  1. package/_bundles/{ordering-ui-admin.6c1919d6b0356a2f522f.js → ordering-ui-admin.661a37246ac77dcc4edf.js} +2 -2
  2. package/_modules/components/Delivery/DeliveryUsersListing/index.js +4 -2
  3. package/_modules/components/Delivery/DriversGroupLogistics/index.js +1 -1
  4. package/_modules/components/Delivery/DriversGroupLogs/index.js +1 -0
  5. package/_modules/components/Delivery/UsersList/index.js +47 -51
  6. package/_modules/components/Delivery/UsersList/styles.js +6 -4
  7. package/_modules/components/Home/HomePage/index.js +7 -1
  8. package/_modules/components/Login/LoginForm/index.js +7 -1
  9. package/_modules/components/Marketing/EnterprisePromotionListing/index.js +1 -1
  10. package/_modules/components/Messages/MessagesListing/index.js +1 -1
  11. package/_modules/components/MyProducts/AdvancedSettings/ButtonShadow.js +98 -0
  12. package/_modules/components/MyProducts/AdvancedSettings/FontStyleGroup.js +28 -7
  13. package/_modules/components/MyProducts/AdvancedSettings/HideCheckBox.js +47 -0
  14. package/_modules/components/MyProducts/AdvancedSettings/ImageBox.js +12 -3
  15. package/_modules/components/MyProducts/AdvancedSettings/SettingComponent.js +15 -15
  16. package/_modules/components/MyProducts/AdvancedSettings/index.js +102 -117
  17. package/_modules/components/MyProducts/AppResources/index.js +132 -0
  18. package/_modules/components/MyProducts/OrderingWebsite/index.js +47 -2
  19. package/_modules/components/MyProducts/OrderingWebsite/styles.js +13 -3
  20. package/_modules/components/OrderingProducts/SiteTheme/index.js +13 -9
  21. package/_modules/components/Orders/DeliveriesManager/index.js +1 -1
  22. package/_modules/components/Orders/Messages/index.js +25 -94
  23. package/_modules/components/Orders/OrderBill/index.js +3 -3
  24. package/_modules/components/Orders/OrderNotification/index.js +4 -2
  25. package/_modules/components/Orders/OrdersManager/index.js +3 -1
  26. package/_modules/components/SidebarMenu/index.js +34 -33
  27. package/_modules/components/Stores/BusinessAdd/DeliveryZone/index.js +1 -1
  28. package/_modules/components/Stores/BusinessDeliveryZoneInformation/index.js +1 -1
  29. package/_modules/components/Stores/BusinessDetails/index.js +27 -8
  30. package/_modules/components/Stores/BusinessLocation/index.js +8 -7
  31. package/_modules/components/Stores/BusinessPlace/index.js +127 -0
  32. package/_modules/components/Stores/BusinessPlace/styles.js +55 -0
  33. package/_modules/components/Stores/BusinessPlaceGroup/index.js +258 -0
  34. package/_modules/components/Stores/BusinessPlaceGroup/styles.js +102 -0
  35. package/_modules/components/Stores/BusinessProductList/index.js +3 -3
  36. package/_modules/components/Stores/BusinessProductsListing/index.js +2 -1
  37. package/_modules/components/Stores/BusinessSummary/index.js +12 -3
  38. package/_modules/components/Stores/ProductStep/index.js +15 -3
  39. package/_modules/components/Stores/SpoonityApiKey/index.js +97 -0
  40. package/_modules/components/Stores/SpoonityApiKey/styles.js +47 -0
  41. package/_modules/components/Stores/UploadMenuGuide/index.js +8 -0
  42. package/_modules/components/Users/CustomerPointsWallet/index.js +126 -9
  43. package/_modules/components/Users/CustomerPointsWallet/styles.js +8 -4
  44. package/package.json +2 -2
  45. package/src/components/Delivery/DeliveryUsersListing/index.js +3 -1
  46. package/src/components/Delivery/DriversGroupLogistics/index.js +1 -1
  47. package/src/components/Delivery/DriversGroupLogs/index.js +2 -0
  48. package/src/components/Delivery/UsersList/index.js +79 -61
  49. package/src/components/Delivery/UsersList/styles.js +4 -12
  50. package/src/components/Home/HomePage/index.js +2 -2
  51. package/src/components/Login/LoginForm/index.js +4 -1
  52. package/src/components/Marketing/EnterprisePromotionListing/index.js +1 -1
  53. package/src/components/Messages/MessagesListing/index.js +1 -1
  54. package/src/components/MyProducts/AdvancedSettings/ButtonShadow.js +102 -0
  55. package/src/components/MyProducts/AdvancedSettings/FontStyleGroup.js +23 -5
  56. package/src/components/MyProducts/AdvancedSettings/HideCheckBox.js +33 -0
  57. package/src/components/MyProducts/AdvancedSettings/ImageBox.js +10 -3
  58. package/src/components/MyProducts/AdvancedSettings/SettingComponent.js +10 -15
  59. package/src/components/MyProducts/AdvancedSettings/index.js +119 -149
  60. package/src/components/MyProducts/AppResources/index.js +167 -0
  61. package/src/components/MyProducts/OrderingWebsite/index.js +66 -2
  62. package/src/components/MyProducts/OrderingWebsite/styles.js +37 -0
  63. package/src/components/OrderingProducts/SiteTheme/index.js +7 -3
  64. package/src/components/Orders/DeliveriesManager/index.js +1 -1
  65. package/src/components/Orders/Messages/index.js +56 -216
  66. package/src/components/Orders/OrderBill/index.js +6 -2
  67. package/src/components/Orders/OrderNotification/index.js +6 -2
  68. package/src/components/Orders/OrdersManager/index.js +1 -1
  69. package/src/components/SidebarMenu/index.js +8 -8
  70. package/src/components/Stores/BusinessAdd/DeliveryZone/index.js +1 -1
  71. package/src/components/Stores/BusinessDeliveryZoneInformation/index.js +1 -1
  72. package/src/components/Stores/BusinessDetails/index.js +24 -1
  73. package/src/components/Stores/BusinessLocation/index.js +2 -1
  74. package/src/components/Stores/BusinessPlace/index.js +137 -0
  75. package/src/components/Stores/BusinessPlace/styles.js +132 -0
  76. package/src/components/Stores/BusinessPlaceGroup/index.js +272 -0
  77. package/src/components/Stores/BusinessPlaceGroup/styles.js +248 -0
  78. package/src/components/Stores/BusinessProductList/index.js +9 -1
  79. package/src/components/Stores/BusinessProductsListing/index.js +1 -0
  80. package/src/components/Stores/BusinessSummary/index.js +16 -5
  81. package/src/components/Stores/ProductStep/index.js +19 -2
  82. package/src/components/Stores/SpoonityApiKey/index.js +87 -0
  83. package/src/components/Stores/SpoonityApiKey/styles.js +68 -0
  84. package/src/components/Stores/UploadMenuGuide/index.js +10 -1
  85. package/src/components/Users/CustomerPointsWallet/index.js +130 -2
  86. package/src/components/Users/CustomerPointsWallet/styles.js +40 -1
  87. /package/_bundles/{ordering-ui-admin.6c1919d6b0356a2f522f.js.LICENSE.txt → ordering-ui-admin.661a37246ac77dcc4edf.js.LICENSE.txt} +0 -0
@@ -1,38 +1,37 @@
1
- import React, { useState, useMemo, useEffect } from 'react'
1
+ import React, { useState, useEffect, useRef } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
3
  import { SettingComponent } from './SettingComponent'
4
4
  import { Button, Input } from '../../../styles'
5
5
  import { ImageBox } from './ImageBox'
6
6
  import { Alert } from '../../Shared'
7
7
  import { OrderType } from './OrderType'
8
- import { CheckSquareFill as CheckedIcon, Square as UnCheckedIcon } from 'react-bootstrap-icons'
9
8
  import { FontStyleGroup } from './FontStyleGroup'
10
9
 
11
10
  import {
12
11
  Container,
13
12
  BoxLayout,
14
13
  HomePageWrapper,
15
- HideCheckWrapper,
16
14
  ShadowWrapper,
17
- ShadowInfoWrapper,
18
- ShadowInputGroup,
19
- ShadowInputControl,
20
- DropShadow,
21
- DropShadowWrapper,
22
15
  HeadingWrapper,
23
- HomeImageFullScreenWrapper,
24
16
  ImageGroup,
25
17
  FormControl,
26
18
  ButtonWrapper
27
19
  } from './styles'
20
+ import { ButtonShadow } from './ButtonShadow'
28
21
 
29
22
  export const AdvancedSettings = (props) => {
30
- const { themesList, advancedValues, setAdvancedValues, handleUpdateSiteTheme } = props
23
+ const {
24
+ themesList,
25
+ advancedValues,
26
+ handleUpdateSiteTheme,
27
+ isApp
28
+ } = props
31
29
 
32
30
  const [, t] = useLanguage()
33
31
 
34
32
  const [themeStructure, setThemeStructure] = useState({})
35
33
  const [alertState, setAlertState] = useState({ open: false, content: [] })
34
+ const themeValuesRef = useRef({})
36
35
 
37
36
  const homepageViewList = [
38
37
  { key: 'homepage_header', name: t('HOMEPAGE_HEADER', 'Homepage Header'), type: 'hidden', path: 'homepage_view.components.homepage_header.hidden' }
@@ -45,6 +44,7 @@ export const AdvancedSettings = (props) => {
45
44
  ]
46
45
 
47
46
  const businessListing = [
47
+ { name: '', type: 'hidden', path: 'business_listing_view.hidden' },
48
48
  { name: t('BUSINESS_LISTING_IMAGE', 'Business listing image'), type: 'image', path: 'business_listing_view.components.business_hero.components.image' },
49
49
  { name: t('PREVIOUS_ORDERS_BLOCK', 'Previous orders block'), type: 'hidden', path: 'business_listing_view.components.previous_orders_block.hidden' },
50
50
  { name: t('Highest_rated_business_block', 'Highest rated business block'), type: 'hidden', path: 'business_listing_view.components.highest_rated_business_block.hidden' },
@@ -158,6 +158,22 @@ export const AdvancedSettings = (props) => {
158
158
  { name: t('BODY', 'Body'), type: 'input', path: 'third_party_code.body' }
159
159
  ]
160
160
 
161
+ const buttonList = [
162
+ { name: t('BORDER_RADIUS', 'Border Radius'), type: 'input', path: 'general.components.buttons.borderRadius' }
163
+ ]
164
+
165
+ const homeImageFullScreen = [
166
+ { name: t('HOMEPAGE_IMAGE_FULLSCREEN', 'Homepage image fullscreen'), type: 'hidden', path: 'my_products.components.images.components.homepage_image_fullscreen' }
167
+ ]
168
+
169
+ const navigationBarList = [
170
+ { name: t('BROWSE', 'Browse'), type: 'hidden', path: 'bar_menu.components.browse.hidden' },
171
+ { name: t('ORDERS', 'Orders'), type: 'hidden', path: 'bar_menu.components.orders.hidden' },
172
+ { name: t('MY_CARTS', 'My carts'), type: 'hidden', path: 'bar_menu.components.my_carts.hidden' },
173
+ { name: t('WALLET', 'Wallet'), type: 'hidden', path: 'bar_menu.components.wallet.hidden' },
174
+ { name: t('PROFILE', 'Profile'), type: 'hidden', path: 'bar_menu.components.profile.hidden' }
175
+ ]
176
+
161
177
  const closeAlert = () => {
162
178
  setAlertState({
163
179
  open: false,
@@ -174,9 +190,9 @@ export const AdvancedSettings = (props) => {
174
190
  }
175
191
 
176
192
  const handleUpdateThemeValue = (value, path) => {
177
- const _advancedValues = JSON.parse(JSON.stringify(advancedValues))
193
+ const _advancedValues = JSON.parse(JSON.stringify(themeValuesRef.current))
178
194
  updateObject(_advancedValues, value, path)
179
- setAdvancedValues(_advancedValues)
195
+ themeValuesRef.current = _advancedValues
180
196
  }
181
197
 
182
198
  useEffect(() => {
@@ -185,116 +201,60 @@ export const AdvancedSettings = (props) => {
185
201
  }
186
202
  }, [themesList])
187
203
 
188
- const shadowValues = useMemo(() => {
189
- const buttonShadow = advancedValues?.general?.components?.buttons?.shadow?.components
190
- if (!buttonShadow?.x || !buttonShadow?.y || !buttonShadow?.blur || !buttonShadow?.spread) return ''
191
- return `${buttonShadow?.x}px ${buttonShadow?.y}px ${buttonShadow?.blur}px ${buttonShadow?.spread}px ${buttonShadow?.color}`
192
- }, [advancedValues?.general?.components?.buttons?.shadow?.components])
204
+ useEffect(() => {
205
+ themeValuesRef.current = JSON.parse(JSON.stringify(advancedValues))
206
+ }, [advancedValues])
193
207
 
194
208
  return (
195
209
  <>
196
210
  <Container>
197
- <BoxLayout>
198
- <h1>{t('WEBSITE_ADVANCED_SETTINGS', 'Website Advanced Settings')}</h1>
199
- <HomePageWrapper>
211
+ {isApp ? (
212
+ <BoxLayout>
213
+ <h1>{t('CUSTOMER_APP_ADVANCED_SETTINGS', 'Customer App Advanced Settings')}</h1>
200
214
  <h2>{t('HOMEPAGE', 'Homepage')}</h2>
201
- <SettingComponent
202
- settingList={homepageViewList}
203
- handleUpdateThemeValue={handleUpdateThemeValue}
204
- advancedValues={advancedValues}
215
+ <ImageBox
216
+ title={t('HOMEPAGE_IMAGE', 'Homepage image')}
217
+ ratio='1350 x 400 px'
218
+ photo={themeValuesRef?.current?.my_products?.components?.images?.components?.homepage_background?.components?.image}
219
+ path='my_products.components.images.components.homepage_background.components.image'
220
+ handleChangePhoto={handleUpdateThemeValue}
205
221
  />
206
- </HomePageWrapper>
207
- </BoxLayout>
222
+ </BoxLayout>
223
+ ) : (
224
+ <BoxLayout>
225
+ <h1>{t('WEBSITE_ADVANCED_SETTINGS', 'Website Advanced Settings')}</h1>
226
+ <HomePageWrapper>
227
+ <h2>{t('HOMEPAGE', 'Homepage')}</h2>
228
+ <SettingComponent
229
+ settingList={homepageViewList}
230
+ handleUpdateThemeValue={handleUpdateThemeValue}
231
+ advancedValues={themeValuesRef?.current}
232
+ />
233
+ </HomePageWrapper>
234
+ </BoxLayout>
235
+ )}
208
236
  <BoxLayout>
209
237
  <h2>{t('BUTTONS', 'Buttons')}</h2>
210
- <FormControl>
211
- <label>Border Radius</label>
212
- <Input
213
- value={advancedValues?.general?.components?.buttons?.borderRadius}
214
- onChange={(e) => handleUpdateThemeValue(e.target.value, 'general.components.buttons.borderRadius')}
215
- onKeyPress={(e) => {
216
- if (!/^[0-9]$/.test(e.key)) {
217
- e.preventDefault()
218
- }
219
- }}
220
- />
221
- </FormControl>
238
+ <SettingComponent
239
+ settingList={buttonList}
240
+ handleUpdateThemeValue={handleUpdateThemeValue}
241
+ advancedValues={themeValuesRef?.current}
242
+ themeStructure={themeStructure}
243
+ />
222
244
  <h3>{t('SHAPE', 'Shape')}</h3>
223
245
  <ShadowWrapper>
224
- <DropShadowWrapper>
225
- <ShadowInfoWrapper>
226
- <DropShadow
227
- style={{
228
- boxShadow: shadowValues
229
- }}
230
- />
231
- <span>{t('DROP_SHADOW', 'Drop shadow')}</span>
232
- </ShadowInfoWrapper>
233
- <ShadowInputGroup>
234
- <ShadowInputControl>
235
- <span>X</span>
236
- <input
237
- value={advancedValues?.general?.components?.buttons?.shadow?.components?.x}
238
- onKeyPress={(e) => {
239
- if (!/^[0-9]$/.test(e.key)) {
240
- e.preventDefault()
241
- }
242
- }}
243
- onChange={(e) => handleUpdateThemeValue(e.target.value, 'general.components.buttons.shadow.components.x')}
244
- />
245
- </ShadowInputControl>
246
- <ShadowInputControl>
247
- <span>Y</span>
248
- <input
249
- value={advancedValues?.general?.components?.buttons?.shadow?.components?.y}
250
- onChange={(e) => handleUpdateThemeValue(e.target.value, 'general.components.buttons.shadow.components.y')}
251
- onKeyPress={(e) => {
252
- if (!/^[0-9]$/.test(e.key)) {
253
- e.preventDefault()
254
- }
255
- }}
256
- />
257
- </ShadowInputControl>
258
- <ShadowInputControl>
259
- <span>B</span>
260
- <input
261
- value={advancedValues?.general?.components?.buttons?.shadow?.components?.blur}
262
- onChange={(e) => handleUpdateThemeValue(e.target.value, 'general.components.buttons.shadow.components.blur')}
263
- onKeyPress={(e) => {
264
- if (!/^[0-9]$/.test(e.key)) {
265
- e.preventDefault()
266
- }
267
- }}
268
- />
269
- </ShadowInputControl>
270
- <ShadowInputControl>
271
- <span>S</span>
272
- <input
273
- value={advancedValues?.general?.components?.buttons?.shadow?.components?.spread}
274
- onChange={(e) => handleUpdateThemeValue(e.target.value, 'general.components.buttons.shadow.components.spread')}
275
- onKeyPress={(e) => {
276
- if (!/^[0-9]$/.test(e.key)) {
277
- e.preventDefault()
278
- }
279
- }}
280
- />
281
- </ShadowInputControl>
282
- <ShadowInputControl>
283
- <span>C</span>
284
- <input
285
- value={advancedValues?.general?.components?.buttons?.shadow?.components?.color}
286
- onChange={(e) => handleUpdateThemeValue(e.target.value, 'general.components.buttons.shadow.components.color')}
287
- />
288
- </ShadowInputControl>
289
- </ShadowInputGroup>
290
- </DropShadowWrapper>
246
+ <ButtonShadow
247
+ initialValues={themeValuesRef?.current?.general?.components?.buttons?.shadow?.components}
248
+ handleUpdateThemeValue={handleUpdateThemeValue}
249
+ path='general.components.buttons.shadow.components'
250
+ />
291
251
  </ShadowWrapper>
292
252
  </BoxLayout>
293
253
  <BoxLayout>
294
254
  <h2>{t('TIPOGRAPHY', 'Tipography')}</h2>
295
255
  <HeadingWrapper>
296
256
  <FontStyleGroup
297
- fonts={advancedValues?.general?.components?.fonts?.primary}
257
+ fonts={themeValuesRef?.current?.general?.components?.fonts?.primary}
298
258
  path='general.components.fonts.primary'
299
259
  handleUpdateThemeValue={handleUpdateThemeValue}
300
260
  />
@@ -305,7 +265,7 @@ export const AdvancedSettings = (props) => {
305
265
  <ImageBox
306
266
  title={t('BUSINESS_LOGO_DUMMY_IMAGE', 'Business Logo dummy image')}
307
267
  ratio='512 x 512 px'
308
- photo={advancedValues?.business_view?.components?.header?.components?.logo?.dummy_image}
268
+ photo={themeValuesRef?.current?.business_view?.components?.header?.components?.logo?.dummy_image}
309
269
  path='business_view.components.header.components.logo.dummy_image'
310
270
  handleChangePhoto={handleUpdateThemeValue}
311
271
  />
@@ -313,21 +273,22 @@ export const AdvancedSettings = (props) => {
313
273
  title={t('BUSINESS_HEADER_DUMMY_IMAGE', 'Business header dummy image')}
314
274
  ratio='1350 x 400 px'
315
275
  isBig
316
- photo={advancedValues?.business_view?.components?.header?.components?.dummy_image}
276
+ photo={themeValuesRef?.current?.business_view?.components?.header?.components?.dummy_image}
317
277
  path='business_view.components.header.components.dummy_image'
318
278
  handleChangePhoto={handleUpdateThemeValue}
319
279
  />
320
- <HomeImageFullScreenWrapper
321
- onClick={() => handleUpdateThemeValue(!advancedValues?.my_products?.components?.images?.components?.homepage_image_fullscreen, 'my_products.components.images.components.homepage_image_fullscreen')}
322
- >
323
- {advancedValues?.my_products?.components?.images?.components?.homepage_image_fullscreen ? <CheckedIcon className='active' /> : <UnCheckedIcon />}
324
- <span>{t('HOMEPAGE_IMAGE_FULLSCREEN', 'Homepage image fullscreen')}</span>
325
- </HomeImageFullScreenWrapper>
280
+ <SettingComponent
281
+ settingList={homeImageFullScreen}
282
+ handleUpdateThemeValue={handleUpdateThemeValue}
283
+ advancedValues={themeValuesRef?.current}
284
+ themeStructure={themeStructure}
285
+ noLabel
286
+ />
326
287
  <ImageGroup>
327
288
  <ImageBox
328
289
  title={t('PRODUCT_DUMMY_IMAGE', 'Product dummy image')}
329
290
  ratio='900 x 200 px'
330
- photo={advancedValues?.business_view?.components?.products?.components?.photo?.components?.dummy_image}
291
+ photo={themeValuesRef?.current?.business_view?.components?.products?.components?.photo?.components?.dummy_image}
331
292
  path='business_view.components.products.components.photo.components.dummy_image'
332
293
  handleChangePhoto={handleUpdateThemeValue}
333
294
  />
@@ -338,8 +299,8 @@ export const AdvancedSettings = (props) => {
338
299
  <ImageBox
339
300
  title={t('FAVICON', 'Favicon')}
340
301
  ratio='512 x 512 px'
341
- photo={advancedValues?.general?.components?.favicon}
342
- path='general.components.favicon'
302
+ photo={themeValuesRef?.current?.general?.components?.favicon?.components?.image}
303
+ path='general.components.favicon.components.image'
343
304
  handleChangePhoto={handleUpdateThemeValue}
344
305
  />
345
306
  </BoxLayout>
@@ -348,20 +309,16 @@ export const AdvancedSettings = (props) => {
348
309
  <SettingComponent
349
310
  settingList={headerList}
350
311
  handleUpdateThemeValue={handleUpdateThemeValue}
351
- advancedValues={advancedValues}
312
+ advancedValues={themeValuesRef?.current}
352
313
  themeStructure={themeStructure}
353
314
  />
354
315
  </BoxLayout>
355
316
  <BoxLayout>
356
317
  <h2>{t('BUSINESS_LISTING', 'Business listing')}</h2>
357
- <HideCheckWrapper isBottom onClick={() => handleUpdateThemeValue(!advancedValues?.business_listing_view?.hidden, 'business_listing_view.hidden')}>
358
- {advancedValues?.business_listing_view?.hidden ? <CheckedIcon className='active' /> : <UnCheckedIcon />}
359
- <span>{t('HIDDEN', 'Hidden')}</span>
360
- </HideCheckWrapper>
361
318
  <SettingComponent
362
319
  settingList={businessListing}
363
320
  handleUpdateThemeValue={handleUpdateThemeValue}
364
- advancedValues={advancedValues}
321
+ advancedValues={themeValuesRef?.current}
365
322
  themeStructure={themeStructure}
366
323
  />
367
324
  </BoxLayout>
@@ -370,7 +327,7 @@ export const AdvancedSettings = (props) => {
370
327
  <SettingComponent
371
328
  settingList={businessBlockList}
372
329
  handleUpdateThemeValue={handleUpdateThemeValue}
373
- advancedValues={advancedValues}
330
+ advancedValues={themeValuesRef?.current}
374
331
  themeStructure={themeStructure}
375
332
  />
376
333
  </BoxLayout>
@@ -379,7 +336,7 @@ export const AdvancedSettings = (props) => {
379
336
  <SettingComponent
380
337
  settingList={businessPageList}
381
338
  handleUpdateThemeValue={handleUpdateThemeValue}
382
- advancedValues={advancedValues}
339
+ advancedValues={themeValuesRef?.current}
383
340
  themeStructure={themeStructure}
384
341
  />
385
342
  </BoxLayout>
@@ -388,7 +345,7 @@ export const AdvancedSettings = (props) => {
388
345
  <SettingComponent
389
346
  settingList={businessInfoList}
390
347
  handleUpdateThemeValue={handleUpdateThemeValue}
391
- advancedValues={advancedValues}
348
+ advancedValues={themeValuesRef?.current}
392
349
  themeStructure={themeStructure}
393
350
  />
394
351
  </BoxLayout>
@@ -406,7 +363,7 @@ export const AdvancedSettings = (props) => {
406
363
  <SettingComponent
407
364
  settingList={reviewsPopups}
408
365
  handleUpdateThemeValue={handleUpdateThemeValue}
409
- advancedValues={advancedValues}
366
+ advancedValues={themeValuesRef?.current}
410
367
  themeStructure={themeStructure}
411
368
  />
412
369
  </BoxLayout>
@@ -424,7 +381,7 @@ export const AdvancedSettings = (props) => {
424
381
  <SettingComponent
425
382
  settingList={checkoutList}
426
383
  handleUpdateThemeValue={handleUpdateThemeValue}
427
- advancedValues={advancedValues}
384
+ advancedValues={themeValuesRef?.current}
428
385
  themeStructure={themeStructure}
429
386
  />
430
387
  <h3>{t('CONFIRMATION_PAGE', 'Confirmation page')}</h3>
@@ -432,21 +389,21 @@ export const AdvancedSettings = (props) => {
432
389
  <SettingComponent
433
390
  settingList={orderBlockList}
434
391
  handleUpdateThemeValue={handleUpdateThemeValue}
435
- advancedValues={advancedValues}
392
+ advancedValues={themeValuesRef?.current}
436
393
  themeStructure={themeStructure}
437
394
  />
438
395
  <h3>{t('POPUP_ADDRESS', 'Popup: Address')}</h3>
439
396
  <SettingComponent
440
397
  settingList={popupAddressList}
441
398
  handleUpdateThemeValue={handleUpdateThemeValue}
442
- advancedValues={advancedValues}
399
+ advancedValues={themeValuesRef?.current}
443
400
  themeStructure={themeStructure}
444
401
  />
445
402
  <h3>{t('MY_ACCOUNT_PAGE', 'My account page')}</h3>
446
403
  <SettingComponent
447
404
  settingList={myAccountList}
448
405
  handleUpdateThemeValue={handleUpdateThemeValue}
449
- advancedValues={advancedValues}
406
+ advancedValues={themeValuesRef?.current}
450
407
  themeStructure={themeStructure}
451
408
  />
452
409
  <h3>{t('MY_ORDERS', 'My orders')}</h3>
@@ -454,56 +411,58 @@ export const AdvancedSettings = (props) => {
454
411
  <SettingComponent
455
412
  settingList={activeOrderBlockList}
456
413
  handleUpdateThemeValue={handleUpdateThemeValue}
457
- advancedValues={advancedValues}
458
- themeStructure={themeStructure}
459
- />
460
- </BoxLayout>
461
- <BoxLayout>
462
- <h2>{t('MENU_OPTIONS', 'Menu options')}</h2>
463
- <SettingComponent
464
- settingList={menuOptionList}
465
- handleUpdateThemeValue={handleUpdateThemeValue}
466
- advancedValues={advancedValues}
414
+ advancedValues={themeValuesRef?.current}
467
415
  themeStructure={themeStructure}
468
416
  />
469
417
  </BoxLayout>
418
+ {!isApp && (
419
+ <BoxLayout>
420
+ <h2>{t('MENU_OPTIONS', 'Menu options')}</h2>
421
+ <SettingComponent
422
+ settingList={menuOptionList}
423
+ handleUpdateThemeValue={handleUpdateThemeValue}
424
+ advancedValues={advancedValues}
425
+ themeStructure={themeStructure}
426
+ />
427
+ </BoxLayout>
428
+ )}
470
429
  <BoxLayout>
471
430
  <h2>{t('POPUP_ORDER_TYPES', 'Popup: Order types ')}</h2>
472
431
  <FormControl>
473
432
  <label>{t('TITLE_MENU_OPTIONS', 'Title Menu options')}</label>
474
433
  <Input
475
434
  placeholder={t('TITLE_MENU_OPTIONS', 'Title Menu options')}
476
- defaultValue={advancedValues?.order_types?.components?.title_menu}
435
+ defaultValue={themeValuesRef?.current?.order_types?.components?.title_menu}
477
436
  onChange={(e) => handleUpdateThemeValue(e.target.value, 'order_types.components.title_menu')}
478
437
  />
479
438
  </FormControl>
480
439
  <h3>{t('DELIVERY', 'Delivery')}</h3>
481
440
  <OrderType
482
- typeValues={advancedValues?.order_types?.components?.delivery?.components}
441
+ typeValues={themeValuesRef?.current?.order_types?.components?.delivery?.components}
483
442
  path='order_types.components.delivery.components'
484
443
  handleUpdateThemeValue={handleUpdateThemeValue}
485
444
  />
486
445
  <h3>{t('PICKUP', 'Pickup')}</h3>
487
446
  <OrderType
488
- typeValues={advancedValues?.order_types?.components?.pickup?.components}
447
+ typeValues={themeValuesRef?.current?.order_types?.components?.pickup?.components}
489
448
  path='order_types.components.pickup.components'
490
449
  handleUpdateThemeValue={handleUpdateThemeValue}
491
450
  />
492
451
  <h3>{t('EAT_IN', 'Eat in')}</h3>
493
452
  <OrderType
494
- typeValues={advancedValues?.order_types?.components?.eat_in?.components}
453
+ typeValues={themeValuesRef?.current?.order_types?.components?.eat_in?.components}
495
454
  path='order_types.components.eat_in.components'
496
455
  handleUpdateThemeValue={handleUpdateThemeValue}
497
456
  />
498
457
  <h3>{t('CURBSIDE', 'Curbside')}</h3>
499
458
  <OrderType
500
- typeValues={advancedValues?.order_types?.components?.curbside?.components}
459
+ typeValues={themeValuesRef?.current?.order_types?.components?.curbside?.components}
501
460
  path='order_types.components.curbside.components'
502
461
  handleUpdateThemeValue={handleUpdateThemeValue}
503
462
  />
504
463
  <h3>{t('DRIVE_THRU', 'Drive thru')}</h3>
505
464
  <OrderType
506
- typeValues={advancedValues?.order_types?.components?.drive_thru?.components}
465
+ typeValues={themeValuesRef?.current?.order_types?.components?.drive_thru?.components}
507
466
  path='order_types.components.drive_thru.components'
508
467
  handleUpdateThemeValue={handleUpdateThemeValue}
509
468
  />
@@ -513,15 +472,26 @@ export const AdvancedSettings = (props) => {
513
472
  <SettingComponent
514
473
  settingList={thirdPartyCodeList}
515
474
  handleUpdateThemeValue={handleUpdateThemeValue}
516
- advancedValues={advancedValues}
475
+ advancedValues={themeValuesRef?.current}
517
476
  themeStructure={themeStructure}
518
477
  />
519
478
  </BoxLayout>
479
+ {isApp && (
480
+ <BoxLayout>
481
+ <h2>{t('NAVIGATION_BAR_MENU', 'Navigation bar menu')}</h2>
482
+ <SettingComponent
483
+ settingList={navigationBarList}
484
+ handleUpdateThemeValue={handleUpdateThemeValue}
485
+ advancedValues={themeValuesRef?.current}
486
+ themeStructure={themeStructure}
487
+ />
488
+ </BoxLayout>
489
+ )}
520
490
  <ButtonWrapper>
521
491
  <Button
522
492
  color='primary'
523
493
  borderRadius='8px'
524
- onClick={() => handleUpdateSiteTheme(true)}
494
+ onClick={() => handleUpdateSiteTheme(themeValuesRef?.current)}
525
495
  >
526
496
  {t('SAVE', 'Save')}
527
497
  </Button>
@@ -0,0 +1,167 @@
1
+ import React from 'react'
2
+ import { useLanguage } from 'ordering-components-admin-external'
3
+ import { BoxLayout } from '../AdvancedSettings/styles'
4
+ import { ImageBox } from '../AdvancedSettings/ImageBox'
5
+ import {
6
+ Container,
7
+ ImageGroup,
8
+ ButtonWrapper
9
+ } from './styles'
10
+ import { Button } from '../../../styles'
11
+
12
+ export const AppResources = (props) => {
13
+ const {
14
+ handleUpdateSiteTheme,
15
+ advancedValues,
16
+ setAdvancedValues
17
+ } = props
18
+
19
+ const [, t] = useLanguage()
20
+
21
+ const updateObject = (object, newValue, path) => {
22
+ const stack = path.split('.')
23
+ while (stack.length > 1) {
24
+ object = object[stack.shift()]
25
+ }
26
+ object[stack.shift()] = newValue
27
+ }
28
+
29
+ const handleUpdateThemeValue = (value, path) => {
30
+ const _advancedValues = JSON.parse(JSON.stringify(advancedValues))
31
+ updateObject(_advancedValues, value, path)
32
+ setAdvancedValues(_advancedValues)
33
+ }
34
+
35
+ return (
36
+ <Container>
37
+ <BoxLayout>
38
+ <h2>{t('ANDROID_SPLASH', 'Android splash')}</h2>
39
+ <h2>{t('PORTRAIT', 'Portrait')}</h2>
40
+ <ImageGroup>
41
+ <ImageBox
42
+ title='ldpi'
43
+ ratio='200 x 320 px'
44
+ photo={advancedValues?.android?.components?.portrait?.dimensions?.idpi?.image}
45
+ path='android.components.portrait.dimensions.idpi.image'
46
+ handleChangePhoto={handleUpdateThemeValue}
47
+ />
48
+ <ImageBox
49
+ title='xhdpi'
50
+ ratio='720 x 1280 px'
51
+ photo={advancedValues?.android?.components?.portrait?.dimensions?.xhdpi?.image}
52
+ path='android.components.portrait.dimensions.xhdpi.image'
53
+ handleChangePhoto={handleUpdateThemeValue}
54
+ />
55
+ <ImageBox
56
+ title='xxhdpi/hdpi'
57
+ ratio='960 x 1600 px'
58
+ photo={advancedValues?.android?.components?.portrait?.dimensions?.xxhdpi?.image}
59
+ path='android.components.portrait.dimensions.xxhdpi.image'
60
+ handleChangePhoto={handleUpdateThemeValue}
61
+ />
62
+ <ImageBox
63
+ title='xxxhdpi/mdpi'
64
+ ratio='1280 x 1920 px'
65
+ photo={advancedValues?.android?.components?.portrait?.dimensions?.xxxhdpi?.image}
66
+ path='android.components.portrait.dimensions.xxxhdpi.image'
67
+ handleChangePhoto={handleUpdateThemeValue}
68
+ />
69
+ </ImageGroup>
70
+ <h2>{t('LANDSCAPE', 'Landscape')}</h2>
71
+ <ImageGroup>
72
+ <ImageBox
73
+ title='ldpi'
74
+ ratio='200 x 320 px'
75
+ photo={advancedValues?.android?.components?.landscape?.dimensions?.idpi?.image}
76
+ path='android.components.landscape.dimensions.idpi.image'
77
+ handleChangePhoto={handleUpdateThemeValue}
78
+ />
79
+ <ImageBox
80
+ title='xhdpi'
81
+ ratio='720 x 1280 px'
82
+ photo={advancedValues?.android?.components?.landscape?.dimensions?.xhdpi?.image}
83
+ path='android.components.landscape.dimensions.xhdpi.image'
84
+ handleChangePhoto={handleUpdateThemeValue}
85
+ />
86
+ <ImageBox
87
+ title='xxhdpi/hdpi'
88
+ ratio='960 x 1600 px'
89
+ photo={advancedValues?.android?.components?.landscape?.dimensions?.xxhdpi?.image}
90
+ path='android.components.landscape.dimensions.xxhdpi.image'
91
+ handleChangePhoto={handleUpdateThemeValue}
92
+ />
93
+ <ImageBox
94
+ title='xxxhdpi/mdpi'
95
+ ratio='1280 x 1920 px'
96
+ photo={advancedValues?.android?.components?.landscape?.dimensions?.xxxhdpi?.image}
97
+ path='android.components.landscape.dimensions.xxxhdpi.image'
98
+ handleChangePhoto={handleUpdateThemeValue}
99
+ />
100
+ </ImageGroup>
101
+ </BoxLayout>
102
+ <BoxLayout>
103
+ <h2>{t('iOS_SPLASH', 'iOS splash')}</h2>
104
+ <h2>{t('PORTRAIT', 'Portrait')}</h2>
105
+ <ImageGroup>
106
+ <ImageBox
107
+ title='Ipad'
108
+ ratio='1536 x 2048 px'
109
+ photo={advancedValues?.ios?.components?.portrait?.dimensions?.ipad?.image}
110
+ path='ios.components.portrait.dimensions.ipad.image'
111
+ handleChangePhoto={handleUpdateThemeValue}
112
+ />
113
+ <ImageBox
114
+ title='Iphone 3/4'
115
+ ratio='640 x 960 px'
116
+ photo={advancedValues?.ios?.components?.portrait?.dimensions?.iphone?.image}
117
+ path='ios.components.portrait.dimensions.iphone.image'
118
+ handleChangePhoto={handleUpdateThemeValue}
119
+ />
120
+ <ImageBox
121
+ title='Iphone 5/6 plus'
122
+ ratio='640 x 960 px'
123
+ photo={advancedValues?.ios?.components?.portrait?.dimensions?.iphone_plus?.image}
124
+ path='ios.components.portrait.dimensions.iphone_plus.image'
125
+ handleChangePhoto={handleUpdateThemeValue}
126
+ />
127
+ </ImageGroup>
128
+ <h2>{t('LANDSCAPE', 'Landscape')}</h2>
129
+ <ImageGroup>
130
+ <ImageBox
131
+ title='Ipad'
132
+ ratio='2048 x 1536 px'
133
+ photo={advancedValues?.ios?.components?.landscape?.dimensions?.ipad?.image}
134
+ path='ios.components.landscape.dimensions.ipad.image'
135
+ handleChangePhoto={handleUpdateThemeValue}
136
+ />
137
+ <ImageBox
138
+ title='Iphone'
139
+ ratio='2208 x 1242 px'
140
+ photo={advancedValues?.ios?.components?.landscape?.dimensions?.iphone?.image}
141
+ path='ios.components.landscape.dimensions.iphone.image'
142
+ handleChangePhoto={handleUpdateThemeValue}
143
+ />
144
+ </ImageGroup>
145
+ <h2>{t('ANY', 'Any')}</h2>
146
+ <ImageGroup>
147
+ <ImageBox
148
+ title={t('ANY', 'Any')}
149
+ ratio='2732 x 2732 px'
150
+ photo={advancedValues?.ios?.components?.any?.image}
151
+ path='ios.components.any.image'
152
+ handleChangePhoto={handleUpdateThemeValue}
153
+ />
154
+ </ImageGroup>
155
+ </BoxLayout>
156
+ <ButtonWrapper>
157
+ <Button
158
+ color='primary'
159
+ borderRadius='8px'
160
+ onClick={() => handleUpdateSiteTheme(advancedValues)}
161
+ >
162
+ {t('SAVE', 'Save')}
163
+ </Button>
164
+ </ButtonWrapper>
165
+ </Container>
166
+ )
167
+ }