ordering-ui-external 1.2.3 → 1.3.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 (99) hide show
  1. package/_bundles/{0.ordering-ui.fc62fe574704c7c4d033.js → 0.ordering-ui.51c00e5a30bb4c51b2e4.js} +1 -1
  2. package/_bundles/{1.ordering-ui.fc62fe574704c7c4d033.js → 1.ordering-ui.51c00e5a30bb4c51b2e4.js} +1 -1
  3. package/_bundles/{3.ordering-ui.fc62fe574704c7c4d033.js → 3.ordering-ui.51c00e5a30bb4c51b2e4.js} +1 -1
  4. package/_bundles/{4.ordering-ui.fc62fe574704c7c4d033.js → 4.ordering-ui.51c00e5a30bb4c51b2e4.js} +1 -1
  5. package/_bundles/5.ordering-ui.51c00e5a30bb4c51b2e4.js +1 -0
  6. package/_bundles/{6.ordering-ui.fc62fe574704c7c4d033.js → 6.ordering-ui.51c00e5a30bb4c51b2e4.js} +1 -1
  7. package/_bundles/7.ordering-ui.51c00e5a30bb4c51b2e4.js +2 -0
  8. package/_bundles/{7.ordering-ui.fc62fe574704c7c4d033.js.LICENSE.txt → 7.ordering-ui.51c00e5a30bb4c51b2e4.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.fc62fe574704c7c4d033.js → 8.ordering-ui.51c00e5a30bb4c51b2e4.js} +1 -1
  10. package/_bundles/{9.ordering-ui.fc62fe574704c7c4d033.js → 9.ordering-ui.51c00e5a30bb4c51b2e4.js} +1 -1
  11. package/_bundles/ordering-ui.51c00e5a30bb4c51b2e4.js +2 -0
  12. package/_bundles/{ordering-ui.fc62fe574704c7c4d033.js.LICENSE.txt → ordering-ui.51c00e5a30bb4c51b2e4.js.LICENSE.txt} +0 -0
  13. package/_modules/components/AutoScroll/styles.js +3 -3
  14. package/_modules/hooks/useIsMounted.js +24 -0
  15. package/_modules/index.js +8 -0
  16. package/_modules/themes/five/index.js +33 -1
  17. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +2 -2
  18. package/_modules/themes/five/src/components/BusinessController/styles.js +42 -42
  19. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +12 -2
  20. package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +5 -2
  21. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +10 -3
  22. package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +7 -3
  23. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -0
  24. package/_modules/themes/five/src/components/Checkout/index.js +1 -1
  25. package/_modules/themes/five/src/components/MultiCheckout/styles.js +1 -1
  26. package/_modules/themes/five/src/components/MyOrders/index.js +9 -3
  27. package/_modules/themes/five/src/components/NavigationBar/index.js +159 -0
  28. package/_modules/themes/five/src/components/NavigationBar/styles.js +33 -0
  29. package/_modules/themes/five/src/components/OrderDetails/index.js +71 -41
  30. package/_modules/themes/five/src/components/ProfessionalBusinessFilter/index.js +96 -0
  31. package/_modules/themes/five/src/components/ProfessionalBusinessFilter/styles.js +48 -0
  32. package/_modules/themes/five/src/components/ProfessionalFilter/index.js +35 -7
  33. package/_modules/themes/five/src/components/ProfessionalFilter/styles.js +10 -4
  34. package/_modules/themes/five/src/components/ProfessionalInfo/index.js +120 -0
  35. package/_modules/themes/five/src/components/ProfessionalInfo/styles.js +100 -0
  36. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +36 -13
  37. package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +21 -18
  38. package/_modules/themes/five/src/components/ReviewProfessional/index.js +314 -0
  39. package/_modules/themes/five/src/components/ReviewProfessional/styles.js +137 -0
  40. package/_modules/themes/five/src/components/SignUpApproval/index.js +106 -0
  41. package/_modules/themes/five/src/components/SignUpApproval/styles.js +71 -0
  42. package/_modules/themes/five/src/components/SignUpBusiness/index.js +7 -383
  43. package/_modules/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +405 -0
  44. package/_modules/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/styles.js +110 -0
  45. package/_modules/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +400 -0
  46. package/_modules/themes/five/src/components/SignUpBusiness/{styles.js → layouts/OldSignUpBusiness/styles.js} +0 -0
  47. package/_modules/themes/five/src/components/SignUpDriver/index.js +7 -383
  48. package/_modules/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +405 -0
  49. package/_modules/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/styles.js +106 -0
  50. package/_modules/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +400 -0
  51. package/_modules/themes/five/src/components/SignUpDriver/{styles.js → layouts/OldSignUpDriver/styles.js} +0 -0
  52. package/_modules/themes/five/src/components/SingleProductCard/styles.js +1 -1
  53. package/_modules/utils/index.js +103 -0
  54. package/package.json +2 -2
  55. package/src/components/AutoScroll/styles.js +11 -12
  56. package/src/hooks/useIsMounted.js +18 -0
  57. package/src/index.js +2 -0
  58. package/src/themes/five/index.js +9 -1
  59. package/src/themes/five/src/components/BusinessBasicInformation/index.js +1 -1
  60. package/src/themes/five/src/components/BusinessController/styles.js +3 -6
  61. package/src/themes/five/src/components/BusinessProductsCategories/index.js +10 -2
  62. package/src/themes/five/src/components/BusinessProductsCategories/styles.js +5 -0
  63. package/src/themes/five/src/components/BusinessProductsListing/index.js +8 -2
  64. package/src/themes/five/src/components/BusinessProductsListing/styles.js +1 -1
  65. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +2 -0
  66. package/src/themes/five/src/components/Checkout/index.js +1 -1
  67. package/src/themes/five/src/components/MultiCheckout/index.js +1 -0
  68. package/src/themes/five/src/components/MultiCheckout/styles.js +1 -0
  69. package/src/themes/five/src/components/MyOrders/index.js +6 -3
  70. package/src/themes/five/src/components/NavigationBar/index.js +104 -0
  71. package/src/themes/five/src/components/NavigationBar/styles.js +44 -0
  72. package/src/themes/five/src/components/OrderDetails/index.js +19 -11
  73. package/src/themes/five/src/components/ProfessionalBusinessFilter/index.js +82 -0
  74. package/src/themes/five/src/components/ProfessionalBusinessFilter/styles.js +71 -0
  75. package/src/themes/five/src/components/ProfessionalFilter/index.js +30 -7
  76. package/src/themes/five/src/components/ProfessionalFilter/styles.js +15 -2
  77. package/src/themes/five/src/components/ProfessionalInfo/index.js +133 -0
  78. package/src/themes/five/src/components/ProfessionalInfo/styles.js +140 -0
  79. package/src/themes/five/src/components/RenderProductsLayout/index.js +37 -16
  80. package/src/themes/five/src/components/RenderProductsLayout/styles.js +6 -1
  81. package/src/themes/five/src/components/ReviewProfessional/index.js +239 -0
  82. package/src/themes/five/src/components/ReviewProfessional/styles.js +233 -0
  83. package/src/themes/five/src/components/SignUpApproval/index.js +108 -0
  84. package/src/themes/five/src/components/SignUpApproval/styles.js +98 -0
  85. package/src/themes/five/src/components/SignUpBusiness/index.js +10 -374
  86. package/src/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +382 -0
  87. package/src/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/styles.js +256 -0
  88. package/src/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +378 -0
  89. package/src/themes/five/src/components/SignUpBusiness/{styles.js → layouts/OldSignUpBusiness/styles.js} +0 -0
  90. package/src/themes/five/src/components/SignUpDriver/index.js +10 -374
  91. package/src/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +382 -0
  92. package/src/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/styles.js +262 -0
  93. package/src/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +378 -0
  94. package/src/themes/five/src/components/SignUpDriver/{styles.js → layouts/OldSignUpDriver/styles.js} +0 -0
  95. package/src/themes/five/src/components/SingleProductCard/styles.js +3 -1
  96. package/src/utils/index.js +54 -0
  97. package/_bundles/5.ordering-ui.fc62fe574704c7c4d033.js +0 -1
  98. package/_bundles/7.ordering-ui.fc62fe574704c7c4d033.js +0 -2
  99. package/_bundles/ordering-ui.fc62fe574704c7c4d033.js +0 -2
@@ -0,0 +1,239 @@
1
+ import React, { useState, useEffect } from 'react'
2
+ import { useForm } from 'react-hook-form'
3
+ import { useLanguage, useUtils, ReviewDriver } from 'ordering-components-external'
4
+ import MdClose from '@meronex/icons/md/MdClose'
5
+ import FaUserAlt from '@meronex/icons/fa/FaUserAlt'
6
+
7
+ import { Alert } from '../Confirm'
8
+ import { TextArea } from '../../styles/Inputs'
9
+ import { Button } from '../../styles/Buttons'
10
+ import { useTheme } from 'styled-components'
11
+
12
+ import {
13
+ ReviewProfessionalContainer,
14
+ Comments,
15
+ ActionBtnWrapper,
16
+ DriverPhoto,
17
+ WrapperDriverPhoto,
18
+ ReviewsProgressWrapper,
19
+ ReviewsProgressContent,
20
+ ReviewsProgressBar,
21
+ ReviewsMarkPoint,
22
+ LogoAndReviewWrapper,
23
+ CommentsList,
24
+ DriverInfoBlock,
25
+ CommentButton
26
+ } from './styles'
27
+ import { reviewCommentList } from '../../../../../utils'
28
+
29
+ const ReviewProfessionalUI = (props) => {
30
+ const {
31
+ dirverReviews,
32
+ order,
33
+ formState,
34
+ setDriverReviews,
35
+ closeReviewProfessional,
36
+ setIsProfessionalReviewed,
37
+ handleSendDriverReview
38
+ } = props
39
+
40
+ const theme = useTheme()
41
+ const [, t] = useLanguage()
42
+ const [{ optimizeImage }] = useUtils()
43
+ const { handleSubmit, errors } = useForm()
44
+ const [comments, setComments] = useState([])
45
+ const [extraComment, setExtraComment] = useState('')
46
+ const [alertState, setAlertState] = useState({ open: false, content: [], success: false })
47
+
48
+ const commentsList = reviewCommentList('professional')
49
+
50
+ const qualificationList = [
51
+ { key: 1, text: t('TERRIBLE', 'Terrible'), middleNode: false, left: 0, right: 'initial' },
52
+ { key: 2, text: t('BAD', 'Bad'), middleNode: true, left: '25%', right: '75%' },
53
+ { key: 3, text: t('OKAY', 'Okay'), middleNode: true, left: '50%', right: '50%' },
54
+ { key: 4, text: t('GOOD', 'Good'), middleNode: true, left: '75%', right: '25%' },
55
+ { key: 5, text: t('GREAT', 'Great'), middleNode: false, left: 'initial', right: 0 }
56
+ ]
57
+
58
+ const handleChangeReviews = (index) => {
59
+ if (index) setDriverReviews({ ...dirverReviews, qualification: index, comment: '' })
60
+ setComments([])
61
+ }
62
+
63
+ const onSubmit = values => {
64
+ if (dirverReviews?.qualification === 0) {
65
+ setAlertState({
66
+ open: true,
67
+ content: [`${t('REVIEW_QUALIFICATION_REQUIRED', 'Review qualification is required')}`]
68
+ })
69
+ return
70
+ }
71
+ setAlertState({ ...alertState, success: true })
72
+ handleSendDriverReview()
73
+ }
74
+
75
+ const handleChangeComment = (commentItem) => {
76
+ const found = comments.find((comment) => comment?.key === commentItem.key)
77
+ if (found) {
78
+ const _comments = comments.filter((comment) => comment?.key !== commentItem.key)
79
+ setComments(_comments)
80
+ } else {
81
+ setComments([...comments, commentItem])
82
+ }
83
+ }
84
+
85
+ const closeAlert = () => {
86
+ setAlertState({
87
+ open: false,
88
+ content: []
89
+ })
90
+ }
91
+
92
+ const isSelectedComment = (commentKey) => {
93
+ const found = comments.find((comment) => comment?.key === commentKey)
94
+ return found
95
+ }
96
+
97
+ useEffect(() => {
98
+ if (!formState.loading && formState.result?.error) {
99
+ setAlertState({
100
+ open: true,
101
+ success: false,
102
+ content: formState.result?.result || [t('ERROR', 'Error')]
103
+ })
104
+ }
105
+ if (!formState.loading && !formState.result?.error && alertState.success) {
106
+ setIsProfessionalReviewed && setIsProfessionalReviewed(true)
107
+ closeReviewProfessional && closeReviewProfessional()
108
+ }
109
+ }, [formState])
110
+
111
+ useEffect(() => {
112
+ if (Object.keys(errors).length > 0) {
113
+ setAlertState({
114
+ open: true,
115
+ success: false,
116
+ content: Object.values(errors).map(error => error.message)
117
+ })
118
+ }
119
+ }, [errors])
120
+
121
+ useEffect(() => {
122
+ let _comments = ''
123
+ if (comments.length > 0) {
124
+ comments.map(comment => (_comments += comment.content + '. '))
125
+ }
126
+ const _comment = _comments + extraComment
127
+ setDriverReviews({ ...dirverReviews, comment: _comment })
128
+ }, [comments, extraComment])
129
+
130
+ return (
131
+ <>
132
+ <LogoAndReviewWrapper>
133
+ <WrapperDriverPhoto>
134
+ {(order?.products[0]?.calendar_event?.professional?.photo) ? (
135
+ <DriverPhoto bgimage={optimizeImage(order?.products[0]?.calendar_event?.professional?.photo, 'h_200,c_limit')} />
136
+ ) : <FaUserAlt />}
137
+ </WrapperDriverPhoto>
138
+ {
139
+ order?.products[0]?.calendar_event?.professional?.name && (
140
+ <DriverInfoBlock>{order?.products[0]?.calendar_event?.professional?.name}</DriverInfoBlock>
141
+ )
142
+ }
143
+ <ReviewsProgressWrapper>
144
+ <p>{t('HOW_WAS_YOUR_SERVICE', 'How was your service?')}</p>
145
+ <ReviewsProgressContent>
146
+ <ReviewsProgressBar style={{ width: `${(dirverReviews?.qualification === 0 ? 0 : (dirverReviews?.qualification - 1) / 4) * 100}%` }} />
147
+ {
148
+ qualificationList?.map(qualification => (
149
+ <ReviewsMarkPoint
150
+ key={qualification?.key}
151
+ style={{
152
+ left: theme.rtl ? (qualification?.middleNode ? 'initial' : qualification?.right) : qualification?.left,
153
+ right: theme?.rtl ? qualification?.left : (qualification?.middleNode ? 'initial' : qualification?.right)
154
+ }}
155
+ active={dirverReviews?.qualification === qualification?.key}
156
+ pass={dirverReviews?.qualification >= qualification?.key}
157
+ className={qualification?.middleNode ? 'mark-point' : ''}
158
+ onClick={() => handleChangeReviews(qualification?.key)}
159
+ >
160
+ <span>{qualification?.text}<span /></span>
161
+ </ReviewsMarkPoint>
162
+ ))
163
+ }
164
+ </ReviewsProgressContent>
165
+ </ReviewsProgressWrapper>
166
+ <CommentsList>
167
+ <p>{commentsList[dirverReviews?.qualification || 1]?.title}</p>
168
+ {
169
+ commentsList[dirverReviews?.qualification || 1]?.list?.map((commentItem, i) => (
170
+ <CommentButton
171
+ key={i}
172
+ active={isSelectedComment(commentItem.key)}
173
+ onClick={() => handleChangeComment(commentItem)}
174
+ initialIcon
175
+ >
176
+ {commentItem.content}
177
+ {
178
+ isSelectedComment(commentItem.key) && <MdClose />
179
+ }
180
+ </CommentButton>
181
+ ))
182
+ }
183
+ </CommentsList>
184
+ </LogoAndReviewWrapper>
185
+ <ReviewProfessionalContainer onSubmit={handleSubmit(onSubmit)}>
186
+ <Comments>
187
+ <p>{t('DO_YOU_WANT_TO_ADD_SOMETHING', 'Do you want to add something?')}</p>
188
+ <TextArea
189
+ name='comment'
190
+ value={extraComment}
191
+ onChange={(e) => setExtraComment(e.target.value)}
192
+ autoComplete='off'
193
+ />
194
+ </Comments>
195
+ {
196
+ props.afterMidElements?.map((MidElement, i) => (
197
+ <React.Fragment key={i}>
198
+ {MidElement}
199
+ </React.Fragment>))
200
+ }
201
+ {
202
+ props.afterMidComponents?.map((MidComponent, i) => (
203
+ <MidComponent key={i} {...props} />))
204
+ }
205
+ <ActionBtnWrapper>
206
+ <Button
207
+ color={!formState.loading ? 'primary' : 'secondary'}
208
+ type='submit'
209
+ disabled={formState.loading}
210
+ className='review-sent'
211
+ >
212
+ {!formState.loading ? (
213
+ t('SEND_REVIEW', 'Send review')
214
+ ) : t('LOADING', 'Loading')}
215
+ </Button>
216
+ </ActionBtnWrapper>
217
+ <Alert
218
+ title={t('DRIVER_REVIEW', 'Driver Review')}
219
+ content={alertState.content}
220
+ acceptText={t('ACCEPT', 'Accept')}
221
+ open={alertState.open}
222
+ onClose={() => closeAlert()}
223
+ onAccept={() => closeAlert()}
224
+ closeOnBackdrop={false}
225
+ />
226
+ </ReviewProfessionalContainer>
227
+ </>
228
+ )
229
+ }
230
+
231
+ export const ReviewProfessional = (props) => {
232
+ const reviewDriverProps = {
233
+ ...props,
234
+ UIComponent: ReviewProfessionalUI,
235
+ isToast: true
236
+ }
237
+
238
+ return <ReviewDriver {...reviewDriverProps} />
239
+ }
@@ -0,0 +1,233 @@
1
+ import React from 'react'
2
+ import styled, { css } from 'styled-components'
3
+ import { Button } from '../../styles/Buttons'
4
+
5
+ export const ReviewProfessionalContainer = styled.form`
6
+ display: flex;
7
+ flex-direction: column;
8
+ align-items: center;
9
+ width: 100%;
10
+ `
11
+
12
+ export const Comments = styled.div`
13
+ display: flex;
14
+ width: 100%;
15
+ flex-direction: column;
16
+ margin-top: 10px;
17
+
18
+ p {
19
+ margin-top: 0;
20
+ margin-bottom: 10px;
21
+ font-size: 15px;
22
+ color: ${props => props.theme?.colors.darkTextColor};
23
+ }
24
+
25
+ textarea {
26
+ min-height: 104px;
27
+ }
28
+ `
29
+ export const ActionBtnWrapper = styled.div`
30
+ margin-top: 30px;
31
+ width: 100%;
32
+
33
+ button {
34
+ font-size: 14px;
35
+ padding: 6px 20px;
36
+ width: 100%;
37
+ }
38
+ `
39
+
40
+ const DriverPhotoStyled = styled.div`
41
+ display: flex;
42
+ width: 124px;
43
+ height: 124px;
44
+ box-sizing: border-box;
45
+ position: relative;
46
+ background-repeat: no-repeat, repeat;
47
+ background-size: cover;
48
+ object-fit: cover;
49
+ background-position: center;
50
+ min-height: 124px;
51
+ border-radius: 7.6px;
52
+
53
+ @media (min-width: 481px){
54
+ width: 100%;
55
+ height: 100%;
56
+ min-height: 124px;
57
+ }
58
+ `
59
+
60
+ export const DriverPhoto = (props) => {
61
+ const style = {}
62
+ if (props.bgimage) {
63
+ style.backgroundImage = `url(${props.bgimage})`
64
+ }
65
+
66
+ return (
67
+ <DriverPhotoStyled {...props} style={style}>
68
+ {props.children}
69
+ </DriverPhotoStyled>
70
+ )
71
+ }
72
+
73
+ export const WrapperDriverPhoto = styled.div`
74
+ align-self: center;
75
+ width: 124px;
76
+ height: 124px;
77
+ min-height: 124px;
78
+ max-width: 124px;
79
+ box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
80
+ border-radius: 7.6px;
81
+
82
+ svg {
83
+ width: 124px;
84
+ height: 124px;
85
+ }
86
+ `
87
+
88
+ export const ReviewsProgressWrapper = styled.div`
89
+ width: 100%;
90
+ margin-top: 50px;
91
+ margin-bottom: 35px;
92
+
93
+ p {
94
+ margin-top: 0;
95
+ margin-bottom: 17px;
96
+ font-size: 15px;
97
+ color: ${props => props.theme?.colors.darkTextColor};
98
+ }
99
+ `
100
+
101
+ export const ReviewsProgressContent = styled.div`
102
+ background: #E9ECEF;
103
+ border-radius: 50px;
104
+ width: 100%;
105
+ height: 6px;
106
+ position: relative;
107
+ margin-bottom: 30px;
108
+ `
109
+
110
+ export const ReviewsProgressBar = styled.div`
111
+ height: 6px;
112
+ border-radius: 50px;
113
+ background: #344050;
114
+ transition: all 0.2s linear;
115
+ `
116
+
117
+ export const ReviewsMarkPoint = styled.div`
118
+ position: absolute;
119
+ top: 15px;
120
+ font-size: 12px;
121
+ color: #CED4DA;
122
+ cursor: pointer;
123
+
124
+ ${({ active }) => active && css`
125
+ > span {
126
+ color: #344050;
127
+ }
128
+ `}
129
+
130
+ &.mark-point {
131
+ span {
132
+ position: relative;
133
+ margin-left: -50%;
134
+ ${props => props.theme?.rtl && css`
135
+ margin-right: -50%;
136
+ margin-left: 0;
137
+ `}
138
+
139
+ > span {
140
+ position: absolute;
141
+ height: 6px;
142
+ top: -15px;
143
+ width: 2px;
144
+ background: #CED4DA;
145
+ transition: all 0.3s;
146
+ }
147
+ }
148
+ }
149
+
150
+ ${({ pass }) => pass && css`
151
+ span {
152
+ > span {
153
+ background: transparent !important;
154
+ }
155
+ }
156
+ `}
157
+ `
158
+
159
+ export const LogoAndReviewWrapper = styled.div`
160
+ width: 100%;
161
+ display: flex;
162
+ flex-direction: column;
163
+ `
164
+
165
+ export const CommentsList = styled.div`
166
+ p {
167
+ margin-top: 0;
168
+ margin-bottom: 10px;
169
+ font-size: 15px;
170
+ color: ${props => props.theme?.colors.darkTextColor};
171
+ }
172
+
173
+ button {
174
+ border-radius: 50px;
175
+ margin-bottom: 18px;
176
+ margin-right: 40px;
177
+
178
+ ${props => props.theme?.rtl && css`
179
+ margin-left: 40px;
180
+ margin-right: 0;
181
+ `}
182
+
183
+ svg {
184
+ vertical-align: middle;
185
+ margin-left: 5px;
186
+
187
+ ${props => props.theme?.rtl && css`
188
+ margin-right: 5px;
189
+ margin-left: 0;
190
+ `}
191
+ }
192
+ }
193
+ `
194
+
195
+ export const DriverInfoBlock = styled.p`
196
+ margin-top: 16px;
197
+ margin-bottom: 0;
198
+ font-size: 14px;
199
+ text-align: center;
200
+ color: #344050;
201
+ `
202
+
203
+ export const CommentButton = styled(Button)`
204
+ border-radius: 50px;
205
+ margin-bottom: 18px;
206
+ margin-right: 18px;
207
+ font-size: 13px;
208
+ color: #414954;
209
+ background: #E9ECEF;
210
+ border: 1px solid #E9ECEF;
211
+ transition: all 0.3s linear;
212
+
213
+ ${props => props.theme?.rtl && css`
214
+ margin-left: 18px;
215
+ margin-right: 0;
216
+ `}
217
+
218
+ svg {
219
+ vertical-align: middle;
220
+ margin-left: 5px;
221
+
222
+ ${props => props.theme?.rtl && css`
223
+ margin-right: 5px;
224
+ margin-left: 0;
225
+ `}
226
+ }
227
+
228
+ ${({ active }) => active && css`
229
+ background: ${props => props.theme?.colors.primary};
230
+ border: 1px solid ${props => props.theme?.colors.primary};
231
+ color: white;
232
+ `}
233
+ `
@@ -0,0 +1,108 @@
1
+ import React from 'react'
2
+ import { useTheme } from 'styled-components'
3
+ import { Button } from '../../styles/Buttons'
4
+
5
+ import { useLanguage } from 'ordering-components-external'
6
+
7
+ import {
8
+ Container,
9
+ HeaderSection,
10
+ Title,
11
+ LogoImage,
12
+ BodySection,
13
+ DescriptionContainer,
14
+ Description,
15
+ ProjectInfoContainer,
16
+ FooterSection,
17
+ ActionGroup,
18
+ ContactSection
19
+ } from './styles'
20
+
21
+ export const SignUpApproval = (props) => {
22
+ const theme = useTheme()
23
+ const [, t] = useLanguage()
24
+ const { content: { project, dashboardUrl, dashboardLoginUrl, approvalType, businessType }, onAccept, onCancel } = props
25
+ const contactEmail = 'support@ordering.co'
26
+ const showDomain = false
27
+
28
+ const logoImgUrl = businessType === '2'
29
+ ? approvalType === 'automatic' ? theme.images?.general?.CongratulationApproval : theme.images?.general?.CongratulationNoApproval
30
+ : approvalType === 'automatic' ? theme.images?.general?.driverCongratulationApproval : theme.images?.general?.driverCongratulationNoApproval
31
+ const userType = businessType === '2' ? 'business' : 'driver'
32
+ return (
33
+ <Container>
34
+ <HeaderSection>
35
+ {showDomain && <Title>Domain or Brand</Title>}
36
+ <LogoImage
37
+ approvalType={approvalType === 'automatic'}
38
+ src={logoImgUrl}
39
+ />
40
+ </HeaderSection>
41
+ {approvalType === 'automatic' ? (
42
+ <BodySection>
43
+ {userType === 'business' ? (
44
+ <DescriptionContainer>
45
+ <Description>{t('GET_IN_OUR_DASHBOARD_USING_OWNER_ACCOUNT', 'Get in our Dashboard using the business owner account you just created.')}</Description>
46
+ <Description><span className='bigger'>{t('VERY_IMPORTANT', 'Very important')}</span> {t('USE_PROJECT_TO', 'use the project')} (<span className='italic'>{project}</span>) {t('TO_SETUP_YOUR_STORE', ', to get inside and set up your store.')}</Description>
47
+ </DescriptionContainer>
48
+ ) : (
49
+ <DescriptionContainer>
50
+ <Description>{t('GET_IN_OUR_DASHBOARD_USING_DRIVER_OWNER_ACCOUNT', 'Get in our Dashboard using the driver owner account you just created.')}</Description>
51
+ <Description><span className='bigger'>{t('VERY_IMPORTANT', 'Very important')}</span> {t('USE_PROJECT_TO', 'use the project')} (<span className='italic'>{project}</span>) {t('TO_GET_DRIVER_APP', ', to get inside the driver app')}</Description>
52
+ </DescriptionContainer>
53
+ )}
54
+ <ProjectInfoContainer>
55
+ <tbody>
56
+ <tr>
57
+ <td className='bigger td-text-right'>{t('PROJECT', 'Project')}: </td>
58
+ <td className='td-text-left'>({project})</td>
59
+ </tr>
60
+ <tr>
61
+ <td className='bigger td-text-right'>{t('DASHBOARD_WEBPAGE', 'Dashboard webpage')}: </td>
62
+ <td className='td-text-left'><a className='green-text' href={dashboardLoginUrl} target='_blank' rel='noopener noreferrer'>{dashboardUrl}</a></td>
63
+ </tr>
64
+ </tbody>
65
+ </ProjectInfoContainer>
66
+ </BodySection>
67
+ ) : (
68
+ <BodySection>
69
+ {businessType === 'business' ? (
70
+ <DescriptionContainer>
71
+ <Description><span className='bigger'>{t('YOUR_STORE_UNDER_APPROVAL', 'Your store is under approval')}</span></Description>
72
+ <Description>{t('BUSINESS_SIGNUP_MESSAGE', 'We will contact you as soon as possible')}</Description>
73
+ <Description>{t('FEEL_FREE_CONTACT_US', 'feel free to contact us at ')} <a className='green-text' href={`mailto:${contactEmail}`}>{contactEmail}</a></Description>
74
+ </DescriptionContainer>
75
+ ) : (
76
+ <DescriptionContainer>
77
+ <Description><span className='bigger'>{t('REQUEST_TO_START_UNDER_APPROVAL', 'Your request to start as a driver is under approval.')}</span></Description>
78
+ <Description>{t('BUSINESS_SIGNUP_MESSAGE', 'We will contact you as soon as possible')}</Description>
79
+ <Description>{t('FEEL_FREE_CONTACT_US', 'feel free to contact us at ')} <a className='green-text' href={`mailto:${contactEmail}`}>{contactEmail}</a></Description>
80
+ </DescriptionContainer>
81
+ )}
82
+ </BodySection>
83
+ )}
84
+ <FooterSection>
85
+ <ActionGroup>
86
+ <Button
87
+ outline
88
+ color='primary'
89
+ type='button'
90
+ onClick={() => onCancel()}
91
+ >
92
+ {t('CANCEL', 'Cancel')}
93
+ </Button>
94
+ <Button
95
+ color='primary'
96
+ type='button'
97
+ onClick={() => onAccept()}
98
+ >
99
+ {t('ACCEPT', 'Accept')}
100
+ </Button>
101
+ </ActionGroup>
102
+ {(approvalType === 'automatic' && userType === 'business') && (
103
+ <ContactSection>{t('CONTACT_US_QUESTIONS', 'If you have some questions do no hestitate to contact us at ')} <a className='green-text' href={`mailto:${contactEmail}`}>{contactEmail}</a></ContactSection>
104
+ )}
105
+ </FooterSection>
106
+ </Container>
107
+ )
108
+ }
@@ -0,0 +1,98 @@
1
+ import styled, { css } from 'styled-components'
2
+
3
+ export const Container = styled.div`
4
+ text-align: center;
5
+ box-sizing: border-box;
6
+ * {
7
+ box-sizing: border-box;
8
+ }
9
+ `
10
+ export const HeaderSection = styled.div`
11
+
12
+ `
13
+ export const Title = styled.p`
14
+ margin: 0;
15
+ font-size: 24px;
16
+ transform: translate(0px, -22px);
17
+ `
18
+ export const LogoImage = styled.img`
19
+ width: 100%;
20
+ object-fit: cover;
21
+
22
+ ${({ approvalType }) => css`
23
+ ${approvalType ? `
24
+ @media (min-width: 450px) {
25
+ width: 395px;
26
+ }
27
+ ` : `
28
+ @media (min-width: 600px) {
29
+ width: 540px;
30
+ }
31
+ `}
32
+ `}
33
+ `
34
+ export const BodySection = styled.div`
35
+ margin-top: 25px;
36
+ `
37
+ export const DescriptionContainer = styled.div`
38
+
39
+ `
40
+ export const Description = styled.p`
41
+ font-size: 20px;
42
+ margin-top: 0;
43
+ margin-bottom: 5px;
44
+ word-break: break-all;
45
+ > .bigger {
46
+ font-weight: 600;
47
+ }
48
+ > .italic {
49
+ font-style: italic;
50
+ }
51
+ > .green-text {
52
+ color: ${props => props.theme.colors.links} !important;
53
+ }
54
+ `
55
+ export const ProjectInfoContainer = styled.table`
56
+ margin: 35px auto 0;
57
+ width: 100%;
58
+ .bigger {
59
+ font-weight: 600;
60
+ }
61
+ .td-text-right {
62
+ text-align: right;
63
+ padding-right: 20px;
64
+ }
65
+ .td-text-left {
66
+ text-align: left;
67
+ }
68
+ .green-text {
69
+ color: ${props => props.theme.colors.links} !important;
70
+ }
71
+ td {
72
+ > a {
73
+ word-break: break-all;
74
+ }
75
+ }
76
+ `
77
+ export const FooterSection = styled.div`
78
+ margin: 35px auto 25px;
79
+ `
80
+ export const ActionGroup = styled.div`
81
+ width: 90%;
82
+ margin: auto;
83
+ display: flex;
84
+ justify-content: space-between;
85
+ align-items: center;
86
+ > button {
87
+ width: 48.5%;
88
+ padding: 5px;
89
+ }
90
+ `
91
+ export const ContactSection = styled.div`
92
+ margin: 25px auto 0;
93
+ font-style: italic;
94
+
95
+ > a.green-text {
96
+ color: ${props => props.theme.colors.links} !important;
97
+ }
98
+ `