ordering-ui-admin-external 1.8.0 → 1.8.1

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 (25) hide show
  1. package/_bundles/{ordering-ui-admin.22db20d62f2d39ead727.js → ordering-ui-admin.454226bc68f34a7e18d9.js} +2 -2
  2. package/_bundles/{ordering-ui-admin.22db20d62f2d39ead727.js.LICENSE.txt → ordering-ui-admin.454226bc68f34a7e18d9.js.LICENSE.txt} +0 -0
  3. package/_modules/components/MyProducts/AppLayout/index.js +36 -26
  4. package/_modules/components/MyProducts/AppLayout/styles.js +12 -15
  5. package/_modules/components/MyProducts/CallCenterApp/index.js +12 -3
  6. package/_modules/components/MyProducts/CustomerApp/index.js +21 -4
  7. package/_modules/components/MyProducts/DriverApp/index.js +23 -6
  8. package/_modules/components/MyProducts/KioskApp/index.js +21 -5
  9. package/_modules/components/MyProducts/PosApp/index.js +21 -5
  10. package/_modules/components/MyProducts/StoreApp/index.js +21 -5
  11. package/_modules/utils/index.js +33 -2
  12. package/index-template.js +5 -1
  13. package/package.json +1 -1
  14. package/src/components/MyProducts/AppLayout/index.js +41 -27
  15. package/src/components/MyProducts/AppLayout/styles.js +34 -29
  16. package/src/components/MyProducts/CallCenterApp/index.js +10 -2
  17. package/src/components/MyProducts/CustomerApp/index.js +14 -3
  18. package/src/components/MyProducts/DriverApp/index.js +15 -5
  19. package/src/components/MyProducts/KioskApp/index.js +14 -4
  20. package/src/components/MyProducts/PosApp/index.js +14 -4
  21. package/src/components/MyProducts/StoreApp/index.js +14 -4
  22. package/src/utils/index.js +30 -0
  23. package/template/assets/images/myProducts/app-store.png +0 -0
  24. package/template/assets/images/myProducts/driver-app-free.png +0 -0
  25. package/template/assets/images/myProducts/play-store.png +0 -0
@@ -3,7 +3,7 @@ import { useLanguage } from 'ordering-components-admin-external'
3
3
  import { useInfoShare } from '../../../contexts/InfoShareContext'
4
4
  import { IconButton, Button } from '../../../styles'
5
5
  import { List as MenuIcon } from 'react-bootstrap-icons'
6
- import { useTheme } from 'styled-components'
6
+ import { insertIntercom } from '../../../utils'
7
7
  import {
8
8
  Container,
9
9
  HeaderTitleContainer,
@@ -11,17 +11,21 @@ import {
11
11
  BoxWrapper,
12
12
  AppInfoContainer,
13
13
  ImageWrapper,
14
- AppStoreLinksWrapper,
15
14
  DownloadLink,
16
- ButtonWRapper
15
+ ButtonWRapper,
16
+ DownLoadWrapper
17
17
  } from './styles'
18
18
 
19
19
  export const AppLayout = (props) => {
20
- const { appInfo } = props
20
+ const { appInfo, isDriver } = props
21
21
  const [, t] = useLanguage()
22
- const theme = useTheme()
23
22
  const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
24
23
 
24
+ const showMessage = (message) => {
25
+ insertIntercom()
26
+ window.Intercom && window.Intercom('showNewMessage', message)
27
+ }
28
+
25
29
  return (
26
30
  <Container>
27
31
  <HeaderTitleContainer>
@@ -40,42 +44,52 @@ export const AppLayout = (props) => {
40
44
  <p>{appInfo.description}</p>
41
45
  <BoxWrapper>
42
46
  <AppInfoContainer>
43
- <ImageWrapper>
47
+ <ImageWrapper isDriver={isDriver}>
44
48
  <img src={appInfo.images.live} alt='' />
45
49
  </ImageWrapper>
46
50
  <h2>{appInfo.live_title}</h2>
51
+ {appInfo?.downloads && (
52
+ <DownLoadWrapper>
53
+ {appInfo.downloads.map(item => (
54
+ <img
55
+ src={item.icon}
56
+ alt=''
57
+ key={item.id}
58
+ onClick={() => window.open(item.link, '_blank')}
59
+ />
60
+ ))}
61
+ </DownLoadWrapper>
62
+ )}
63
+ {appInfo?.web_url && (
64
+ <DownloadLink href={appInfo.web_url} target='_blank' isSingle className='download-link'>
65
+ {appInfo.web_link_title}
66
+ </DownloadLink>
67
+ )}
47
68
  <p>{appInfo.live_description}</p>
48
- {appInfo?.live_purchase_link ? (
69
+ {appInfo?.purchase_message && (
49
70
  <ButtonWRapper>
50
71
  <Button
51
72
  color='primary'
52
73
  borderRadius='8px'
53
- onClick={() => window.open(`${appInfo.live_purchase_link}`, '_blank')}
74
+ onClick={() => showMessage(appInfo?.purchase_message)}
54
75
  >
55
76
  {t('PURCHASE_NOW', 'Purchase Now')}
56
77
  </Button>
57
- </ButtonWRapper>
58
- ) : (
59
- <AppStoreLinksWrapper>
60
- {appInfo.web_url ? (
61
- <DownloadLink href={appInfo.web_url} target='_blank' isSingle className='download-link'>
62
- {appInfo.web_link_title}
63
- </DownloadLink>
64
- ) : (
65
- <>
66
- <DownloadLink href={appInfo.apple_store_link} target='_blank' className='download-link'>
67
- <img src={theme.images.general.appStore} alt='App store' />
68
- </DownloadLink>
69
- <DownloadLink href={appInfo.google_play_link} target='_blank' className='download-link'>
70
- <img src={theme.images.general.googlePlay} alt='Google play' />
71
- </DownloadLink>
72
- </>
78
+ {appInfo?.demo_book_message && (
79
+ <Button
80
+ color='primary'
81
+ outline
82
+ borderRadius='8px'
83
+ onClick={() => showMessage(appInfo?.demo_book_message)}
84
+ >
85
+ {t('BOOK_A_DEMO', 'Book a demo')}
86
+ </Button>
73
87
  )}
74
- </AppStoreLinksWrapper>
88
+ </ButtonWRapper>
75
89
  )}
76
90
  </AppInfoContainer>
77
91
  <AppInfoContainer>
78
- <ImageWrapper>
92
+ <ImageWrapper isDriver={isDriver}>
79
93
  <img src={appInfo.images.brand} alt='' />
80
94
  </ImageWrapper>
81
95
  <h2>{appInfo.brand_title}</h2>
@@ -84,7 +98,7 @@ export const AppLayout = (props) => {
84
98
  <Button
85
99
  color='primary'
86
100
  borderRadius='8px'
87
- onClick={() => window.open(`${appInfo.purchase_link}`, '_blank')}
101
+ onClick={() => showMessage(appInfo?.purchase_message)}
88
102
  >
89
103
  {t('PURCHASE_NOW', 'Purchase Now')}
90
104
  </Button>
@@ -79,12 +79,13 @@ export const AppInfoContainer = styled.div`
79
79
  h2 {
80
80
  font-size: 24px;
81
81
  margin-top: 0;
82
- margin-bottom: 32px;
82
+ margin-bottom: 16px;
83
83
  }
84
84
 
85
85
  p {
86
86
  font-size: 14px;
87
- margin: 0;
87
+ margin-top: 16px;
88
+ margin-bottom: 0;
88
89
  }
89
90
  @media (min-width: 1024px) {
90
91
  width: calc(50% - 23px);
@@ -102,44 +103,48 @@ export const ImageWrapper = styled.div`
102
103
  flex: 1;
103
104
  margin-bottom: 25px;
104
105
  display: flex;
105
- align-items: center;
106
+ align-items: flex-start;
106
107
  justify-content: center;
107
108
  img {
108
109
  width: 100%;
109
110
  max-width: 430px;
110
111
  }
111
- `
112
- export const AppStoreLinksWrapper = styled.div`
113
- margin-top: 33px;
114
- display: flex;
115
- > a {
116
- &:not(:first-child) {
117
- ${props => props.theme?.rtl ? css`
118
- margin-right: 24px;
119
- ` : css`
120
- margin-left: 24px;
121
- `}
112
+ ${({ isDriver }) => isDriver && css`
113
+ img {
114
+ max-width: 500px;
122
115
  }
123
- }
116
+ `}
124
117
  `
125
- export const DownloadLink = styled.a`
126
- flex: 1;
127
- img {
128
- width: 100%;
129
- object-fit: cover;
130
- }
131
118
 
132
- ${({ isSingle }) => isSingle ? css`
133
- margin: 0 auto;
134
- text-decoration: underline;
135
- ` : css`
136
- max-width: 200px;
137
- `}
119
+ export const DownloadLink = styled.a`
120
+ text-decoration: underline;
138
121
  `
139
122
  export const ButtonWRapper = styled.div`
140
- margin-top: 31px;
123
+ display: flex;
124
+ justify-content: space-between;
125
+ flex-direction: column;
126
+ padding-top: 15px;
141
127
  button {
142
128
  height: 44px;
143
- min-width: 250px;
129
+ width: 100%;
130
+ margin-top: 16px;
131
+ }
132
+
133
+ @media (min-width: 768px) {
134
+ flex-direction: row;
135
+ button {
136
+ width: calc(50% - 10px);
137
+ }
138
+ }
139
+ `
140
+
141
+ export const DownLoadWrapper = styled.div`
142
+ display: flex;
143
+ align-items: center;
144
+ img {
145
+ cursor: pointer;
146
+ &:last-child {
147
+ margin: 0px 15px;
148
+ }
144
149
  }
145
150
  `
@@ -1,7 +1,8 @@
1
- import React from 'react'
1
+ import React, { useEffect } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
3
  import { useTheme } from 'styled-components'
4
4
  import { AppLayout } from '../AppLayout'
5
+ import { removeIntercom } from '../../../utils'
5
6
 
6
7
  export const CallCenterApp = () => {
7
8
  const [, t] = useLanguage()
@@ -20,9 +21,16 @@ export const CallCenterApp = () => {
20
21
  web_link_title: t('CALL_CENTER', 'Call center'),
21
22
  brand_title: t('YOUR_BRANDED_KIOSK', 'Your Branded Kiosk'),
22
23
  brand_description: t('CALL_CENTER_BRANDED_DESCRIPTION', 'The Call Center is delivered in less than five working days, fully branded with your guidelines, and ready to be used on any tablet or device you add it to.'),
23
- purchase_link: 'https://www.ordering.co/ordering-sales'
24
+ demo_book_message: 'I would like to book a Demo about the Call center , can you assist me?',
25
+ purchase_message: 'I would like to know about the Call center, can you assist me?'
24
26
  }
25
27
 
28
+ useEffect(() => {
29
+ return () => {
30
+ removeIntercom()
31
+ }
32
+ }, [])
33
+
26
34
  return (
27
35
  <AppLayout appInfo={appInfo} />
28
36
  )
@@ -1,7 +1,8 @@
1
- import React from 'react'
1
+ import React, { useEffect } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
3
  import { useTheme } from 'styled-components'
4
4
  import { AppLayout } from '../AppLayout'
5
+ import { removeIntercom } from '../../../utils'
5
6
 
6
7
  export const CustomerApp = () => {
7
8
  const [, t] = useLanguage()
@@ -16,12 +17,22 @@ export const CustomerApp = () => {
16
17
  },
17
18
  live_title: t('MULTI-STORE-CUSTOMER-APP', 'Multi-store Customer App'),
18
19
  live_description: t('FREE_TO_USE_DESCRIPTION', 'This is a branded Ordering.co product. use it with your project, email, and password for free. features might be limited.'),
19
- live_purchase_link: 'https://www.ordering.co/ordering-sales',
20
+ demo_book_message: 'I would like to book a Demo for the customer app , can you assist me?',
20
21
  brand_title: t('SINGLE_STORE_CUSTOMER_APP', 'Single Store Customer App'),
21
22
  brand_description: t('BRANDED_APP_DESCRIPTION', 'This App is delivered in less than five working days, fully branded with your guidelines, removing all ordering.co presence to give your brand more awareness.'),
22
- purchase_link: 'https://www.ordering.co/ordering-sales'
23
+ purchase_message: 'I would like to know about the customer app, can you assist me?',
24
+ downloads: [
25
+ { id: 1, icon: theme.images.myProducts.appStoreSmall, link: 'https://apps.apple.com/us/app/customer-app-2-0/id1607414555' },
26
+ { id: 2, icon: theme.images.myProducts.playStoreSmall, link: 'https://play.google.com/store/apps/details?id=com.ordering.onlineorderingappv5&hl=en&gl=US' }
27
+ ]
23
28
  }
24
29
 
30
+ useEffect(() => {
31
+ return () => {
32
+ removeIntercom()
33
+ }
34
+ }, [])
35
+
25
36
  return (
26
37
  <AppLayout appInfo={appInfo} />
27
38
  )
@@ -1,7 +1,8 @@
1
- import React from 'react'
1
+ import React, { useEffect } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
3
  import { useTheme } from 'styled-components'
4
4
  import { AppLayout } from '../AppLayout'
5
+ import { removeIntercom } from '../../../utils'
5
6
 
6
7
  export const DriverApp = () => {
7
8
  const [, t] = useLanguage()
@@ -16,14 +17,23 @@ export const DriverApp = () => {
16
17
  },
17
18
  live_title: t('FREE_TO_USE', 'Free to use'),
18
19
  live_description: t('FREE_TO_USE_DESCRIPTION', 'This is a branded Ordering.co product. use it with your project, email, and password for free. features might be limited.'),
19
- apple_store_link: 'https://apps.apple.com/us/app/driver-app-2-0/id1606257815',
20
- google_play_link: 'https://play.google.com/store/apps/details?id=com.ordering.deliveryv5',
21
20
  brand_title: t('YOUR_BRANDED_APP', 'Your Branded App'),
22
21
  brand_description: t('BRANDED_APP_DESCRIPTION', 'This App is delivered in less than five working days, fully branded with your guidelines, removing all ordering.co presence to give your brand more awareness.'),
23
- purchase_link: 'https://www.ordering.co/ordering-sales'
22
+ demo_book_message: 'I would like to book a Demo about the Driver app , can you assist me?',
23
+ purchase_message: 'I would like to know about the Driver app, can you assist me?',
24
+ downloads: [
25
+ { id: 1, icon: theme.images.myProducts.appStoreSmall, link: 'https://apps.apple.com/us/app/driver-app-2-0/id1606257815' },
26
+ { id: 2, icon: theme.images.myProducts.playStoreSmall, link: 'https://play.google.com/store/apps/details?id=com.ordering.deliveryv5' }
27
+ ]
24
28
  }
25
29
 
30
+ useEffect(() => {
31
+ return () => {
32
+ removeIntercom()
33
+ }
34
+ }, [])
35
+
26
36
  return (
27
- <AppLayout appInfo={appInfo} />
37
+ <AppLayout appInfo={appInfo} isDriver />
28
38
  )
29
39
  }
@@ -1,7 +1,8 @@
1
- import React from 'react'
1
+ import React, { useEffect } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
3
  import { useTheme } from 'styled-components'
4
4
  import { AppLayout } from '../AppLayout'
5
+ import { removeIntercom } from '../../../utils'
5
6
 
6
7
  export const KioskApp = () => {
7
8
  const [, t] = useLanguage()
@@ -16,13 +17,22 @@ export const KioskApp = () => {
16
17
  },
17
18
  live_title: t('LIVE_DEMO', 'Live Demo'),
18
19
  live_description: t('APP_LIVE_DEMO_DESCRIPTION', 'This is a branded Ordering.co product. play with it and understand how it works'),
19
- apple_store_link: 'https://apps.apple.com/us/app/ordering-kiosk-2-0/id1609314960',
20
- google_play_link: 'https://play.google.com/store/apps/details?id=com.ordering.orderingkioskv5&hl=en&gl=US',
21
20
  brand_title: t('YOUR_BRANDED_KIOSK', 'Your Branded Kiosk'),
22
21
  brand_description: t('KIOSK_BRANDED_DESCRIPTION', 'This App is delivered in less than five working days, fully branded with your guidelines, and ready to be used on any tablet you add it to.'),
23
- purchase_link: 'https://www.ordering.co/ordering-sales'
22
+ demo_book_message: 'I would like to book a Demo about the Kiosk app, can you assist me?',
23
+ purchase_message: 'I would like to know about the Kiosk app, can you assist me?',
24
+ downloads: [
25
+ { id: 1, icon: theme.images.myProducts.appStoreSmall, link: 'https://apps.apple.com/us/app/ordering-kiosk-2-0/id1615828153' },
26
+ { id: 2, icon: theme.images.myProducts.playStoreSmall, link: 'https://play.google.com/store/apps/details?id=com.ordering.orderingkioskv5&hl=en&gl=US' }
27
+ ]
24
28
  }
25
29
 
30
+ useEffect(() => {
31
+ return () => {
32
+ removeIntercom()
33
+ }
34
+ }, [])
35
+
26
36
  return (
27
37
  <AppLayout appInfo={appInfo} />
28
38
  )
@@ -1,7 +1,8 @@
1
- import React from 'react'
1
+ import React, { useEffect } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
3
  import { useTheme } from 'styled-components'
4
4
  import { AppLayout } from '../AppLayout'
5
+ import { removeIntercom } from '../../../utils'
5
6
 
6
7
  export const PosApp = () => {
7
8
  const [, t] = useLanguage()
@@ -16,13 +17,22 @@ export const PosApp = () => {
16
17
  },
17
18
  live_title: t('FREE_TO_USE', 'Free to use'),
18
19
  live_description: t('FREE_TO_USE_DESCRIPTION', 'This is a branded Ordering.co product. use it with your project, email, and password for free. features might be limited.'),
19
- apple_store_link: 'https://apps.apple.com/us/app/ordering-pos-2-0/id1609520468',
20
- google_play_link: 'https://play.google.com/store/apps/details?id=com.ordering.posv5&hl=en&gl=US',
21
20
  brand_title: t('YOUR_BRANDED_POS', 'Your Branded POS'),
22
21
  brand_description: t('POS_BRANDED_DESCRIPTION', 'The POS is delivered in less than five working days, fully branded with your guidelines, and ready to be used on any tablet or device you add it to.'),
23
- purchase_link: 'https://www.ordering.co/ordering-sales'
22
+ demo_book_message: 'I would like to book a Demo about the POS app , can you assist me?',
23
+ purchase_message: 'I would like to know about the POS app, can you assist me?',
24
+ downloads: [
25
+ { id: 1, icon: theme.images.myProducts.appStoreSmall, link: 'https://apps.apple.com/us/app/ordering-pos-2-0/id1609520468' },
26
+ { id: 2, icon: theme.images.myProducts.playStoreSmall, link: 'https://play.google.com/store/apps/details?id=com.ordering.posv5&hl=en&gl=US' }
27
+ ]
24
28
  }
25
29
 
30
+ useEffect(() => {
31
+ return () => {
32
+ removeIntercom()
33
+ }
34
+ }, [])
35
+
26
36
  return (
27
37
  <AppLayout appInfo={appInfo} />
28
38
  )
@@ -1,7 +1,8 @@
1
- import React from 'react'
1
+ import React, { useEffect } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
3
  import { useTheme } from 'styled-components'
4
4
  import { AppLayout } from '../AppLayout'
5
+ import { removeIntercom } from '../../../utils'
5
6
 
6
7
  export const StoreApp = () => {
7
8
  const [, t] = useLanguage()
@@ -16,13 +17,22 @@ export const StoreApp = () => {
16
17
  },
17
18
  live_title: t('FREE_TO_USE', 'Free to use'),
18
19
  live_description: t('FREE_TO_USE_DESCRIPTION', 'This is a branded Ordering.co product. use it with your project, email, and password for free. features might be limited.'),
19
- apple_store_link: 'https://apps.apple.com/us/app/store-app-2-0/id1608192050',
20
- google_play_link: 'https://play.google.com/store/apps/details?id=com.ordering.storeappv5&pli=1',
20
+ demo_book_message: 'I would like to book a Demo about the Store app , can you assist me?',
21
21
  brand_title: t('YOUR_BRANDED_APP', 'Your Branded App'),
22
22
  brand_description: t('BRANDED_APP_DESCRIPTION', 'This App is delivered in less than five working days, fully branded with your guidelines, removing all ordering.co presence to give your brand more awareness.'),
23
- purchase_link: 'https://www.ordering.co/ordering-sales'
23
+ purchase_message: 'I would like to know about the Store app, can you assist me?',
24
+ downloads: [
25
+ { id: 1, icon: theme.images.myProducts.appStoreSmall, link: 'https://apps.apple.com/us/app/store-app-2-0/id1608192050' },
26
+ { id: 2, icon: theme.images.myProducts.playStoreSmall, link: 'https://play.google.com/store/apps/details?id=com.ordering.storeappv5&pli=1' }
27
+ ]
24
28
  }
25
29
 
30
+ useEffect(() => {
31
+ return () => {
32
+ removeIntercom()
33
+ }
34
+ }, [])
35
+
26
36
  return (
27
37
  <AppLayout appInfo={appInfo} />
28
38
  )
@@ -292,6 +292,36 @@ export const checkSiteUrl = (url, fallback) => {
292
292
  return url[url?.length - 1] === '/' ? url : `${url}/`
293
293
  }
294
294
 
295
+ /**
296
+ * Function to insert intercom script dynamically
297
+ */
298
+ export const insertIntercom = () => {
299
+ if (document.getElementById('intercom-sdk')) return
300
+
301
+ const script = document.createElement('script')
302
+ script.async = true
303
+ script.id = 'intercom-sdk'
304
+ script.defer = true
305
+ script.innerHTML = 'window.intercomSettings = { api_base: \'https://api-iam.intercom.io\', app_id: \'o912y2nt\' };(function () { var w = window; var ic = w.Intercom; if (typeof ic === \'function\') { ic(\'reattach_activator\'); ic(\'update\', w.intercomSettings) } else { var d = document; var i = function () { i.c(arguments) }; i.q = []; i.c = function (args) { i.q.push(args) }; w.Intercom = i; var l = function () { var s = d.createElement(\'script\'); s.type = \'text/javascript\'; s.async = true; s.src = \'https://widget.intercom.io/widget/o912y2nt\'; var x = d.getElementsByTagName(\'script\')[0]; x.parentNode.insertBefore(s, x) }; if (document.readyState === \'complete\') { l() } else if (w.attachEvent) { w.attachEvent(\'onload\', l) } else { w.addEventListener(\'load\', l, false) } } })();'
306
+ document.body.appendChild(script)
307
+ }
308
+
309
+ /**
310
+ * Function to remove intercom script dynamically
311
+ */
312
+ export const removeIntercom = () => {
313
+ const intercomSDK = document.getElementById('intercom-sdk')
314
+ const intercomContainer = document.getElementById('intercom-container')
315
+ const intercomFrame = document.getElementById('intercom-frame')
316
+ const intercomLightWeight = document.querySelector('.intercom-lightweight-app')
317
+ intercomSDK && document.body.removeChild(intercomSDK)
318
+ intercomContainer && document.body.removeChild(intercomContainer)
319
+ intercomFrame && document.body.removeChild(intercomFrame)
320
+ intercomLightWeight && document.body.removeChild(intercomLightWeight)
321
+ window.Intercom = null
322
+ window.intercomSettings = null
323
+ }
324
+
295
325
  /**
296
326
  * function to manage review comment list
297
327
  * @param {number} param0 type of reviews to return