@riosst100/pwa-marketplace 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/componentOverrideMapping.js +5 -1
- package/src/components/BecomeSeller/becomeSeller.js +184 -81
- package/src/components/BecomeSeller/becomeSeller.module.css +2 -3
- package/src/components/BecomeSellerLink/becomeSellerLink.js +45 -0
- package/src/components/BecomeSellerLink/becomeSellerLink.module.css +13 -0
- package/src/components/BecomeSellerPage/becomeSellerPage.js +9 -13
- package/src/components/BecomeSellerPage/becomeSellerPage.module.css +21 -0
- package/src/components/SellerAccountPage/index.js +1 -0
- package/src/components/SellerAccountPage/sellerAccountPage.js +138 -0
- package/src/components/SellerAccountPage/sellerAccountPage.module.css +55 -0
- package/src/components/SellerVerification/index.js +1 -0
- package/src/components/SellerVerification/sellerVerification.js +198 -0
- package/src/components/SellerVerification/sellerVerification.module.css +47 -0
- package/src/components/SellerVerificationPage/index.js +1 -0
- package/src/components/SellerVerificationPage/sellerVerificationPage.js +43 -0
- package/src/components/SellerVerificationPage/sellerVerificationPage.module.css +21 -0
- package/src/components/WebsiteSwitcher/websiteSwitcher.js +109 -0
- package/src/components/WebsiteSwitcher/websiteSwitcher.module.css +111 -0
- package/src/components/WebsiteSwitcher/websiteSwitcher.shimmer.js +6 -0
- package/src/components/WebsiteSwitcher/websiteSwitcherItem.js +47 -0
- package/src/components/WebsiteSwitcher/websiteSwitcherItem.module.css +20 -0
- package/src/intercept.js +40 -37
- package/src/overwrites/peregrine/lib/store/actions/user/asyncActions.js +96 -0
- package/src/overwrites/peregrine/lib/talons/AccountMenu/useAccountMenuItems.js +65 -0
- package/src/overwrites/peregrine/lib/talons/SignIn/signIn.gql.js +56 -0
- package/src/overwrites/peregrine/lib/talons/SignIn/useSignIn.js +226 -0
- package/src/overwrites/venia-ui/lib/components/Header/header.js +2 -2
- package/src/overwrites/venia-ui/lib/components/Header/storeSwitcher.js +2 -2
- package/src/talons/BecomeSeller/becomeSeller.gql.js +46 -0
- package/src/talons/BecomeSeller/useBecomeSeller.js +146 -0
- package/src/talons/BecomeSellerLink/useBecomeSellerLink.js +11 -0
- package/src/talons/BecomeSellerPage/useBecomeSellerPage.js +66 -0
- package/src/talons/SellerAccountPage/useSellerAccountPage.js +174 -0
- package/src/talons/WebsiteByIp/useWebsiteByIp.js +2 -0
- package/src/talons/WebsiteSwitcher/useWebsiteSwitcher.js +218 -0
- package/src/talons/WebsiteSwitcher/websiteSwitcher.gql.js +45 -0
package/package.json
CHANGED
|
@@ -7,5 +7,9 @@ module.exports = componentOverrideMapping = {
|
|
|
7
7
|
[`@magento/peregrine/lib/talons/Adapter/useAdapter.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/Adapter/useAdapter.js',
|
|
8
8
|
[`@magento/peregrine/lib/talons/Header/useStoreSwitcher.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/Header/useStoreSwitcher.js',
|
|
9
9
|
[`@magento/peregrine/lib/talons/Header/storeSwitcher.gql.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/Header/storeSwitcher.gql.js',
|
|
10
|
-
[`@magento/pwa-buildpack/lib/queries/getAvailableStoresConfigData.graphql`]: '@riosst100/pwa-marketplace/src/overwrites/pwa-buildpack/lib/queries/getAvailableStoresConfigData.graphql'
|
|
10
|
+
[`@magento/pwa-buildpack/lib/queries/getAvailableStoresConfigData.graphql`]: '@riosst100/pwa-marketplace/src/overwrites/pwa-buildpack/lib/queries/getAvailableStoresConfigData.graphql',
|
|
11
|
+
[`@magento/peregrine/lib/store/actions/user/asyncActions.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/store/actions/user/asyncActions.js',
|
|
12
|
+
[`@magento/peregrine/lib/talons/SignIn/signIn.gql.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/SignIn/signIn.gql.js',
|
|
13
|
+
[`@magento/peregrine/lib/talons/SignIn/useSignIn.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/SignIn/useSignIn.js',
|
|
14
|
+
[`@magento/peregrine/lib/talons/AccountMenu/useAccountMenuItems.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/AccountMenu/useAccountMenuItems.js'
|
|
11
15
|
};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
3
3
|
import { Form } from 'informed';
|
|
4
4
|
import { func, shape, string, bool } from 'prop-types';
|
|
5
|
-
import { useBecomeSeller } from '@riosst100/pwa-
|
|
5
|
+
import { useBecomeSeller } from '@riosst100/pwa-marketplace/src/talons/BecomeSeller/useBecomeSeller';
|
|
6
6
|
|
|
7
7
|
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
8
8
|
import combine from '@magento/venia-ui/lib/util/combineValidators';
|
|
@@ -14,11 +14,14 @@ import {
|
|
|
14
14
|
import Button from '@magento/venia-ui/lib/components/Button';
|
|
15
15
|
import Checkbox from '@magento/venia-ui/lib/components/Checkbox';
|
|
16
16
|
import Field from '@magento/venia-ui/lib/components/Field';
|
|
17
|
+
import Select from '@magento/venia-ui/lib/components/Select';
|
|
17
18
|
import TextInput from '@magento/venia-ui/lib/components/TextInput';
|
|
18
19
|
import defaultClasses from './becomeSeller.module.css';
|
|
19
20
|
import FormError from '@magento/venia-ui/lib/components/FormError';
|
|
20
|
-
import Password from '@magento/venia-ui/lib/components/Password';
|
|
21
21
|
import GoogleRecaptcha from '@magento/venia-ui/lib/components/GoogleReCaptcha';
|
|
22
|
+
import Country from '@magento/venia-ui/lib/components/Country';
|
|
23
|
+
import Region from '@magento/venia-ui/lib/components/Region';
|
|
24
|
+
import Postcode from '@magento/venia-ui/lib/components/Postcode';
|
|
22
25
|
|
|
23
26
|
const BecomeSeller = props => {
|
|
24
27
|
const talonProps = useBecomeSeller({
|
|
@@ -29,34 +32,18 @@ const BecomeSeller = props => {
|
|
|
29
32
|
|
|
30
33
|
const {
|
|
31
34
|
errors,
|
|
32
|
-
handleCancel,
|
|
33
35
|
handleSubmit,
|
|
36
|
+
handleChange,
|
|
37
|
+
sellerType,
|
|
34
38
|
handleEnterKeyPress,
|
|
35
|
-
handleCancelKeyPress,
|
|
36
39
|
isDisabled,
|
|
37
40
|
initialValues,
|
|
38
|
-
recaptchaWidgetProps
|
|
41
|
+
recaptchaWidgetProps,
|
|
42
|
+
isSeller
|
|
39
43
|
} = talonProps;
|
|
40
44
|
const { formatMessage } = useIntl();
|
|
41
45
|
const classes = useStyle(defaultClasses, props.classes);
|
|
42
|
-
|
|
43
|
-
const cancelButton = props.isCancelButtonHidden ? null : (
|
|
44
|
-
<Button
|
|
45
|
-
data-cy="BecomeSeller-cancelButton"
|
|
46
|
-
className={classes.cancelButton}
|
|
47
|
-
disabled={isDisabled}
|
|
48
|
-
type="button"
|
|
49
|
-
priority="low"
|
|
50
|
-
onClick={handleCancel}
|
|
51
|
-
onKeyDown={handleCancelKeyPress}
|
|
52
|
-
>
|
|
53
|
-
<FormattedMessage
|
|
54
|
-
id={'becomeSeller.cancelText'}
|
|
55
|
-
defaultMessage={'Cancel'}
|
|
56
|
-
/>
|
|
57
|
-
</Button>
|
|
58
|
-
);
|
|
59
|
-
|
|
46
|
+
|
|
60
47
|
const submitButton = (
|
|
61
48
|
<Button
|
|
62
49
|
className={classes.submitButton}
|
|
@@ -68,131 +55,248 @@ const BecomeSeller = props => {
|
|
|
68
55
|
>
|
|
69
56
|
<FormattedMessage
|
|
70
57
|
id={'becomeSeller.becomeSellerText'}
|
|
71
|
-
defaultMessage={'
|
|
58
|
+
defaultMessage={'Become a Seller'}
|
|
72
59
|
/>
|
|
73
60
|
</Button>
|
|
74
61
|
);
|
|
75
62
|
|
|
76
|
-
|
|
63
|
+
const sellerTypeOptions = [
|
|
64
|
+
{
|
|
65
|
+
value: "individual",
|
|
66
|
+
label: "Individual"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
value: "company",
|
|
70
|
+
label: "Company"
|
|
71
|
+
}
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
if (isSeller) {
|
|
75
|
+
return '';
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return !isSeller ? (
|
|
77
79
|
<Form
|
|
78
80
|
data-cy="BecomeSeller-form"
|
|
79
81
|
className={classes.root}
|
|
80
82
|
initialValues={initialValues}
|
|
81
83
|
onSubmit={handleSubmit}
|
|
84
|
+
onChange={handleChange}
|
|
82
85
|
>
|
|
83
86
|
<h2 data-cy="BecomeSeller-title" className={classes.title}>
|
|
84
87
|
<FormattedMessage
|
|
85
88
|
id={'becomeSeller.becomeSellerText'}
|
|
86
|
-
defaultMessage={'
|
|
89
|
+
defaultMessage={'Become a Seller'}
|
|
87
90
|
/>
|
|
88
91
|
</h2>
|
|
89
92
|
<FormError errors={Array.from(errors.values())} />
|
|
90
93
|
<Field
|
|
91
|
-
id="
|
|
94
|
+
id="sellerType"
|
|
95
|
+
label={formatMessage({
|
|
96
|
+
id: 'becomeSeller.sellerTypeText',
|
|
97
|
+
defaultMessage: 'Seller Type'
|
|
98
|
+
})}
|
|
99
|
+
>
|
|
100
|
+
<Select
|
|
101
|
+
field="seller.seller_type"
|
|
102
|
+
id={classes.root}
|
|
103
|
+
items={sellerTypeOptions}
|
|
104
|
+
/>
|
|
105
|
+
</Field>
|
|
106
|
+
{sellerType == "company" && (
|
|
107
|
+
<>
|
|
108
|
+
<Field
|
|
109
|
+
id="companyName"
|
|
110
|
+
label={formatMessage({
|
|
111
|
+
id: 'becomeSeller.companyNameText',
|
|
112
|
+
defaultMessage: 'Company Name'
|
|
113
|
+
})}
|
|
114
|
+
>
|
|
115
|
+
<TextInput
|
|
116
|
+
id="companyName"
|
|
117
|
+
field="seller.company_name"
|
|
118
|
+
validate={isRequired}
|
|
119
|
+
validateOnBlur
|
|
120
|
+
mask={value => value && value.trim()}
|
|
121
|
+
maskOnBlur={true}
|
|
122
|
+
data-cy="seller-companyname"
|
|
123
|
+
aria-label={formatMessage({
|
|
124
|
+
id: 'global.companyNameRequired',
|
|
125
|
+
defaultMessage: 'Company Name Required'
|
|
126
|
+
})}
|
|
127
|
+
/>
|
|
128
|
+
</Field>
|
|
129
|
+
<Field
|
|
130
|
+
id="companyRegistrationNumber"
|
|
131
|
+
label={formatMessage({
|
|
132
|
+
id: 'becomeSeller.companyRegistrationNumberText',
|
|
133
|
+
defaultMessage: 'Company Registration Number'
|
|
134
|
+
})}
|
|
135
|
+
>
|
|
136
|
+
<TextInput
|
|
137
|
+
id="companyRegistrationNumber"
|
|
138
|
+
field="seller.company_registration_number"
|
|
139
|
+
validate={isRequired}
|
|
140
|
+
validateOnBlur
|
|
141
|
+
mask={value => value && value.trim()}
|
|
142
|
+
maskOnBlur={true}
|
|
143
|
+
data-cy="seller-registrationnumber"
|
|
144
|
+
aria-label={formatMessage({
|
|
145
|
+
id: 'global.registration_numberRequired',
|
|
146
|
+
defaultMessage: 'Company Registration Number Required'
|
|
147
|
+
})}
|
|
148
|
+
/>
|
|
149
|
+
</Field>
|
|
150
|
+
</>
|
|
151
|
+
)}
|
|
152
|
+
<Field
|
|
153
|
+
id="sellerProfileName"
|
|
154
|
+
label={formatMessage({
|
|
155
|
+
id: 'becomeSeller.sellerProfileNameText',
|
|
156
|
+
defaultMessage: 'Store Name'
|
|
157
|
+
})}
|
|
158
|
+
>
|
|
159
|
+
<TextInput
|
|
160
|
+
id="sellerProfileName"
|
|
161
|
+
field="seller.seller_profile_name"
|
|
162
|
+
validate={isRequired}
|
|
163
|
+
validateOnBlur
|
|
164
|
+
mask={value => value && value.trim()}
|
|
165
|
+
maskOnBlur={true}
|
|
166
|
+
data-cy="seller-profilename"
|
|
167
|
+
aria-label={formatMessage({
|
|
168
|
+
id: 'global.sellerProfileNameRequired',
|
|
169
|
+
defaultMessage: 'Store Name is required.'
|
|
170
|
+
})}
|
|
171
|
+
/>
|
|
172
|
+
</Field>
|
|
173
|
+
<Field
|
|
174
|
+
id="storeURL"
|
|
92
175
|
label={formatMessage({
|
|
93
|
-
id: 'becomeSeller.
|
|
94
|
-
defaultMessage: '
|
|
176
|
+
id: 'becomeSeller.storeURLText',
|
|
177
|
+
defaultMessage: 'Store URL'
|
|
95
178
|
})}
|
|
96
179
|
>
|
|
97
180
|
<TextInput
|
|
98
|
-
id="
|
|
99
|
-
field="
|
|
100
|
-
autoComplete="given-name"
|
|
181
|
+
id="storeUrl"
|
|
182
|
+
field="seller.store_url"
|
|
101
183
|
validate={isRequired}
|
|
102
184
|
validateOnBlur
|
|
103
185
|
mask={value => value && value.trim()}
|
|
104
186
|
maskOnBlur={true}
|
|
105
|
-
data-cy="
|
|
187
|
+
data-cy="seller-storeurl"
|
|
106
188
|
aria-label={formatMessage({
|
|
107
|
-
id: 'global.
|
|
108
|
-
defaultMessage: '
|
|
189
|
+
id: 'global.storeUrlRequired',
|
|
190
|
+
defaultMessage: 'Store URL is required.'
|
|
109
191
|
})}
|
|
110
192
|
/>
|
|
111
193
|
</Field>
|
|
194
|
+
<Country
|
|
195
|
+
field="seller.country_id"
|
|
196
|
+
validate={isRequired}
|
|
197
|
+
/>
|
|
112
198
|
<Field
|
|
113
|
-
id="
|
|
199
|
+
id="addressLine1"
|
|
114
200
|
label={formatMessage({
|
|
115
|
-
id: 'becomeSeller.
|
|
116
|
-
defaultMessage: '
|
|
201
|
+
id: 'becomeSeller.addressLine1Text',
|
|
202
|
+
defaultMessage: 'Address Line 1'
|
|
117
203
|
})}
|
|
118
204
|
>
|
|
119
205
|
<TextInput
|
|
120
|
-
id="
|
|
121
|
-
field="
|
|
122
|
-
autoComplete="family-name"
|
|
206
|
+
id="addressLine1"
|
|
207
|
+
field="seller.address_line_1"
|
|
123
208
|
validate={isRequired}
|
|
124
209
|
validateOnBlur
|
|
125
210
|
mask={value => value && value.trim()}
|
|
126
211
|
maskOnBlur={true}
|
|
127
|
-
data-cy="
|
|
212
|
+
data-cy="seller-addressline1"
|
|
128
213
|
aria-label={formatMessage({
|
|
129
|
-
id: 'global.
|
|
130
|
-
defaultMessage: '
|
|
214
|
+
id: 'global.addressLine1Required',
|
|
215
|
+
defaultMessage: 'Address Line 1 is required'
|
|
131
216
|
})}
|
|
132
217
|
/>
|
|
133
218
|
</Field>
|
|
134
219
|
<Field
|
|
135
|
-
id="
|
|
220
|
+
id="addressLine2"
|
|
136
221
|
label={formatMessage({
|
|
137
|
-
id: 'becomeSeller.
|
|
138
|
-
defaultMessage: '
|
|
222
|
+
id: 'becomeSeller.addressLine2Text',
|
|
223
|
+
defaultMessage: 'Address Line 2'
|
|
139
224
|
})}
|
|
140
225
|
>
|
|
141
226
|
<TextInput
|
|
142
|
-
id="
|
|
143
|
-
field="
|
|
144
|
-
autoComplete="email"
|
|
227
|
+
id="addressLine2"
|
|
228
|
+
field="seller.address_line_2"
|
|
145
229
|
validate={isRequired}
|
|
146
230
|
validateOnBlur
|
|
147
231
|
mask={value => value && value.trim()}
|
|
148
232
|
maskOnBlur={true}
|
|
149
|
-
data-cy="
|
|
233
|
+
data-cy="seller-addressline2"
|
|
150
234
|
aria-label={formatMessage({
|
|
151
|
-
id: 'global.
|
|
152
|
-
defaultMessage: '
|
|
235
|
+
id: 'global.addressLine2Required',
|
|
236
|
+
defaultMessage: 'Address Line 2 is required'
|
|
153
237
|
})}
|
|
154
238
|
/>
|
|
155
239
|
</Field>
|
|
156
|
-
<
|
|
157
|
-
id="
|
|
158
|
-
autoComplete="new-password"
|
|
159
|
-
fieldName="password"
|
|
160
|
-
isToggleButtonHidden={false}
|
|
240
|
+
<Field
|
|
241
|
+
id="city"
|
|
161
242
|
label={formatMessage({
|
|
162
|
-
id: '
|
|
163
|
-
defaultMessage: '
|
|
243
|
+
id: 'global.city',
|
|
244
|
+
defaultMessage: 'City'
|
|
164
245
|
})}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
246
|
+
>
|
|
247
|
+
<TextInput
|
|
248
|
+
id="city"
|
|
249
|
+
field="seller.city"
|
|
250
|
+
validate={isRequired}
|
|
251
|
+
/>
|
|
252
|
+
</Field>
|
|
253
|
+
<Region
|
|
254
|
+
fieldInput="seller.region"
|
|
255
|
+
fieldSelect="seller.region_id"
|
|
256
|
+
label={formatMessage({
|
|
257
|
+
id: 'global.region',
|
|
258
|
+
defaultMessage: 'Region'
|
|
177
259
|
})}
|
|
260
|
+
countryCodeField="seller.country_id"
|
|
261
|
+
validate={isRequired}
|
|
178
262
|
/>
|
|
263
|
+
<Postcode
|
|
264
|
+
validate={isRequired}
|
|
265
|
+
fieldInput="seller.postcode"
|
|
266
|
+
label={formatMessage({
|
|
267
|
+
id: 'global.postcode',
|
|
268
|
+
defaultMessage: 'Postal Code'
|
|
269
|
+
})}
|
|
270
|
+
/>
|
|
271
|
+
<Field
|
|
272
|
+
id="contactNumber"
|
|
273
|
+
label={formatMessage({
|
|
274
|
+
id: 'global.contactNumber',
|
|
275
|
+
defaultMessage: 'Contact Number'
|
|
276
|
+
})}
|
|
277
|
+
>
|
|
278
|
+
<TextInput
|
|
279
|
+
id="contactNumber"
|
|
280
|
+
field="seller.contact_number"
|
|
281
|
+
validate={isRequired}
|
|
282
|
+
/>
|
|
283
|
+
</Field>
|
|
179
284
|
<div className={classes.subscribe}>
|
|
180
285
|
<Checkbox
|
|
181
|
-
field="
|
|
182
|
-
id="
|
|
286
|
+
field="become_seller_agreement"
|
|
287
|
+
id="becomeSellerAgreement"
|
|
183
288
|
label={formatMessage({
|
|
184
|
-
id: 'becomeSeller.
|
|
185
|
-
defaultMessage: '
|
|
289
|
+
id: 'becomeSeller.becomeSellerAgreementText',
|
|
290
|
+
defaultMessage: 'I agree the Terms and Condition (Terms and Conditions)'
|
|
186
291
|
})}
|
|
187
292
|
/>
|
|
188
293
|
</div>
|
|
189
294
|
<GoogleRecaptcha {...recaptchaWidgetProps} />
|
|
190
295
|
<div className={classes.actions}>
|
|
191
296
|
{submitButton}
|
|
192
|
-
{cancelButton}
|
|
193
297
|
</div>
|
|
194
298
|
</Form>
|
|
195
|
-
);
|
|
299
|
+
) : '';
|
|
196
300
|
};
|
|
197
301
|
|
|
198
302
|
BecomeSeller.propTypes = {
|
|
@@ -203,9 +307,8 @@ BecomeSeller.propTypes = {
|
|
|
203
307
|
subscribe: string
|
|
204
308
|
}),
|
|
205
309
|
initialValues: shape({
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
lastName: string
|
|
310
|
+
sellerProfileName: string,
|
|
311
|
+
companyName: string
|
|
209
312
|
}),
|
|
210
313
|
isCancelButtonHidden: bool,
|
|
211
314
|
onSubmit: func,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
.root {
|
|
2
2
|
composes: gap-xs from global;
|
|
3
|
-
composes: grid from global;
|
|
4
3
|
composes: justify-items-stretch from global;
|
|
5
4
|
composes: px-sm from global;
|
|
6
5
|
composes: py-xs from global;
|
|
@@ -31,11 +30,11 @@
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
.cancelButton {
|
|
34
|
-
composes: root_lowPriority from '
|
|
33
|
+
composes: root_lowPriority from '@magento/venia-ui/lib/components/Button/button.module.css';
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
.submitButton {
|
|
38
|
-
composes: root_highPriority from '
|
|
37
|
+
composes: root_highPriority from '@magento/venia-ui/lib/components/Button/button.module.css';
|
|
39
38
|
|
|
40
39
|
composes: col-start-auto from global;
|
|
41
40
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
3
|
+
import defaultClasses from './becomeSellerLink.module.css';
|
|
4
|
+
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
5
|
+
import { Link } from 'react-router-dom';
|
|
6
|
+
import { shape, string } from 'prop-types';
|
|
7
|
+
import { useIntl } from 'react-intl';
|
|
8
|
+
import { useBecomeSellerLink } from '@riosst100/pwa-marketplace/src/talons/BecomeSellerLink/useBecomeSellerLink';
|
|
9
|
+
|
|
10
|
+
const BecomeSellerLink = props => {
|
|
11
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
12
|
+
const { formatMessage } = useIntl();
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
isSeller
|
|
16
|
+
} = useBecomeSellerLink(props);
|
|
17
|
+
|
|
18
|
+
return isSeller ? (
|
|
19
|
+
<div className={classes.root} data-cy="BecomeSellerLink-root">
|
|
20
|
+
<a href="https://seller-local.tcgcollective.co/lofmarketplace/seller/login/">
|
|
21
|
+
{formatMessage({
|
|
22
|
+
id: 'sellerDashboard.title',
|
|
23
|
+
defaultMessage: 'Seller Dashboard'
|
|
24
|
+
})}
|
|
25
|
+
</a>
|
|
26
|
+
</div>
|
|
27
|
+
) : (
|
|
28
|
+
<div className={classes.root} data-cy="BecomeSellerLink-root">
|
|
29
|
+
<Link
|
|
30
|
+
to={resourceUrl('/become-seller')}
|
|
31
|
+
>{formatMessage({
|
|
32
|
+
id: 'becomeSellerPage.title',
|
|
33
|
+
defaultMessage: 'Become a Seller'
|
|
34
|
+
})}</Link>
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default BecomeSellerLink;
|
|
40
|
+
|
|
41
|
+
BecomeSellerLink.propTypes = {
|
|
42
|
+
classes: shape({
|
|
43
|
+
root: string
|
|
44
|
+
})
|
|
45
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: grid from global;
|
|
3
|
+
composes: items-center from global;
|
|
4
|
+
composes: justify-items-start from global;
|
|
5
|
+
composes: max-w-site from global;
|
|
6
|
+
composes: mx-auto from global;
|
|
7
|
+
composes: my-0 from global;
|
|
8
|
+
composes: px-xs from global;
|
|
9
|
+
composes: py-2xs from global;
|
|
10
|
+
composes: relative from global;
|
|
11
|
+
|
|
12
|
+
composes: sm_justify-items-end from global;
|
|
13
|
+
}
|
|
@@ -2,17 +2,20 @@ import React from 'react';
|
|
|
2
2
|
import { shape, string } from 'prop-types';
|
|
3
3
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
4
4
|
|
|
5
|
-
import { useBecomeSellerPage } from '@riosst100/pwa-
|
|
5
|
+
import { useBecomeSellerPage } from '@riosst100/pwa-marketplace/src/talons/BecomeSellerPage/useBecomeSellerPage';
|
|
6
6
|
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
-
import BecomeSeller from '@riosst100/pwa-
|
|
7
|
+
import BecomeSeller from '@riosst100/pwa-marketplace/src/components/BecomeSeller';
|
|
8
8
|
import { StoreTitle } from '@magento/venia-ui/lib/components/Head';
|
|
9
|
+
import defaultClasses from './becomeSellerPage.module.css';
|
|
9
10
|
|
|
10
11
|
const BecomeSellerPage = props => {
|
|
11
12
|
const classes = useStyle(defaultClasses, props.classes);
|
|
12
13
|
const { becomeSellerProps } = useBecomeSellerPage(props);
|
|
13
14
|
const { formatMessage } = useIntl();
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
const { isSeller } = becomeSellerProps
|
|
17
|
+
|
|
18
|
+
return !isSeller ? (
|
|
16
19
|
<div className={classes.root}>
|
|
17
20
|
<StoreTitle>
|
|
18
21
|
{formatMessage({
|
|
@@ -20,30 +23,23 @@ const BecomeSellerPage = props => {
|
|
|
20
23
|
defaultMessage: 'Become a Seller'
|
|
21
24
|
})}
|
|
22
25
|
</StoreTitle>
|
|
23
|
-
<h1 className={classes.header}>
|
|
24
|
-
<FormattedMessage
|
|
25
|
-
id="becomeSellerPage.header"
|
|
26
|
-
defaultMessage="Become a Seller"
|
|
27
|
-
/>
|
|
28
|
-
</h1>
|
|
29
26
|
<div className={classes.contentContainer}>
|
|
30
27
|
<BecomeSeller {...becomeSellerProps} />
|
|
31
28
|
</div>
|
|
32
29
|
</div>
|
|
33
|
-
)
|
|
30
|
+
) : ''
|
|
34
31
|
}
|
|
35
32
|
|
|
36
33
|
export default BecomeSellerPage;
|
|
37
34
|
|
|
38
35
|
BecomeSellerPage.defaultProps = {
|
|
39
36
|
signedInRedirectUrl: '/become-seller',
|
|
40
|
-
signInPageUrl: '
|
|
37
|
+
signInPageUrl: '/sign-in'
|
|
41
38
|
};
|
|
42
39
|
|
|
43
40
|
BecomeSellerPage.propTypes = {
|
|
44
41
|
classes: shape({
|
|
45
42
|
root: string
|
|
46
43
|
}),
|
|
47
|
-
signedInRedirectUrl: string
|
|
48
|
-
signInPageUrl: string
|
|
44
|
+
signedInRedirectUrl: string
|
|
49
45
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: gap-y-md from global;
|
|
3
|
+
composes: grid from global;
|
|
4
|
+
composes: justify-center from global;
|
|
5
|
+
composes: px-0 from global;
|
|
6
|
+
composes: py-md from global;
|
|
7
|
+
composes: text-center from global;
|
|
8
|
+
grid-template-columns: minmax(auto, 512px);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.header {
|
|
12
|
+
composes: font-serif from global;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.contentContainer {
|
|
16
|
+
composes: lg_border-2 from global;
|
|
17
|
+
composes: lg_border-solid from global;
|
|
18
|
+
composes: lg_border-subtle from global;
|
|
19
|
+
composes: lg_pb-md from global;
|
|
20
|
+
composes: lg_rounded-md from global;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default} from './sellerAccountPage';
|