@riosst100/pwa-marketplace 1.0.0 → 1.0.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.
- package/package.json +1 -1
- package/src/Utilities/graphQL.js +1 -1
- package/src/componentOverrideMapping.js +9 -9
- package/src/components/BecomeSeller/becomeSeller.js +220 -0
- package/src/components/BecomeSeller/becomeSeller.module.css +47 -0
- package/src/components/BecomeSeller/index.js +1 -0
- package/src/components/BecomeSellerPage/becomeSellerPage.js +49 -0
- package/src/components/BecomeSellerPage/index.js +1 -0
- package/src/components/Header/becomeSellerLink.js +28 -0
- package/src/components/Header/becomeSellerLink.module.css +13 -0
- package/src/components/Header/websiteSwitcher.js +1 -1
- package/src/intercept.js +20 -0
- package/src/overwrites/venia-ui/lib/components/Adapter/adapter.js +1 -1
- package/src/overwrites/venia-ui/lib/components/Header/header.js +3 -1
- package/src/talons/Header/useBecomeSellerLink.js +13 -0
package/package.json
CHANGED
package/src/Utilities/graphQL.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const debug = require('@magento/pwa-buildpack/lib/util/debug').makeFileLogger(__filename);
|
|
2
2
|
|
|
3
3
|
const fetch = require('node-fetch');
|
|
4
|
-
const graphQLQueries = require('@riosst100/pwa-
|
|
4
|
+
const graphQLQueries = require('@riosst100/pwa-marketplace/src/queries');
|
|
5
5
|
const https = require('https');
|
|
6
6
|
|
|
7
7
|
// To be used with `node-fetch` in order to allow self-signed certificates.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
module.exports = componentOverrideMapping = {
|
|
2
|
-
[`@magento/venia-ui/lib/components/Adapter/adapter.js`]: '@riosst100/pwa-
|
|
3
|
-
[`@magento/venia-ui/lib/components/Header/header.js`]: '@riosst100/pwa-
|
|
4
|
-
[`@magento/venia-ui/lib/components/Header/storeSwitcher.js`]: '@riosst100/pwa-
|
|
5
|
-
[`@magento/venia-ui/lib/components/Header/switcherItem.js`]: '@riosst100/pwa-
|
|
6
|
-
[`@magento/venia-ui/lib/components/StoreCodeRoute/storeCodeRoute.js`]: '@riosst100/pwa-
|
|
7
|
-
[`@magento/peregrine/lib/talons/Adapter/useAdapter.js`]: '@riosst100/pwa-
|
|
8
|
-
[`@magento/peregrine/lib/talons/Header/useStoreSwitcher.js`]: '@riosst100/pwa-
|
|
9
|
-
[`@magento/peregrine/lib/talons/Header/storeSwitcher.gql.js`]: '@riosst100/pwa-
|
|
10
|
-
[`@magento/pwa-buildpack/lib/queries/getAvailableStoresConfigData.graphql`]: '@riosst100/pwa-
|
|
2
|
+
[`@magento/venia-ui/lib/components/Adapter/adapter.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Adapter/adapter.js',
|
|
3
|
+
[`@magento/venia-ui/lib/components/Header/header.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Header/header.js',
|
|
4
|
+
[`@magento/venia-ui/lib/components/Header/storeSwitcher.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Header/storeSwitcher.js',
|
|
5
|
+
[`@magento/venia-ui/lib/components/Header/switcherItem.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Header/switcherItem.js',
|
|
6
|
+
[`@magento/venia-ui/lib/components/StoreCodeRoute/storeCodeRoute.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/StoreCodeRoute/storeCodeRoute.js',
|
|
7
|
+
[`@magento/peregrine/lib/talons/Adapter/useAdapter.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/Adapter/useAdapter.js',
|
|
8
|
+
[`@magento/peregrine/lib/talons/Header/useStoreSwitcher.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/Header/useStoreSwitcher.js',
|
|
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'
|
|
11
11
|
};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
3
|
+
import { Form } from 'informed';
|
|
4
|
+
import { func, shape, string, bool } from 'prop-types';
|
|
5
|
+
import { useBecomeSeller } from '@riosst100/pwa-seller-registration/src/talons/BecomeSeller/useBecomeSeller';
|
|
6
|
+
|
|
7
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
8
|
+
import combine from '@magento/venia-ui/lib/util/combineValidators';
|
|
9
|
+
import {
|
|
10
|
+
hasLengthAtLeast,
|
|
11
|
+
isRequired,
|
|
12
|
+
validatePassword
|
|
13
|
+
} from '@magento/venia-ui/lib/util/formValidators';
|
|
14
|
+
import Button from '@magento/venia-ui/lib/components/Button';
|
|
15
|
+
import Checkbox from '@magento/venia-ui/lib/components/Checkbox';
|
|
16
|
+
import Field from '@magento/venia-ui/lib/components/Field';
|
|
17
|
+
import TextInput from '@magento/venia-ui/lib/components/TextInput';
|
|
18
|
+
import defaultClasses from './becomeSeller.module.css';
|
|
19
|
+
import FormError from '@magento/venia-ui/lib/components/FormError';
|
|
20
|
+
import Password from '@magento/venia-ui/lib/components/Password';
|
|
21
|
+
import GoogleRecaptcha from '@magento/venia-ui/lib/components/GoogleReCaptcha';
|
|
22
|
+
|
|
23
|
+
const BecomeSeller = props => {
|
|
24
|
+
const talonProps = useBecomeSeller({
|
|
25
|
+
initialValues: props.initialValues,
|
|
26
|
+
onSubmit: props.onSubmit,
|
|
27
|
+
onCancel: props.onCancel
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const {
|
|
31
|
+
errors,
|
|
32
|
+
handleCancel,
|
|
33
|
+
handleSubmit,
|
|
34
|
+
handleEnterKeyPress,
|
|
35
|
+
handleCancelKeyPress,
|
|
36
|
+
isDisabled,
|
|
37
|
+
initialValues,
|
|
38
|
+
recaptchaWidgetProps
|
|
39
|
+
} = talonProps;
|
|
40
|
+
const { formatMessage } = useIntl();
|
|
41
|
+
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
|
+
|
|
60
|
+
const submitButton = (
|
|
61
|
+
<Button
|
|
62
|
+
className={classes.submitButton}
|
|
63
|
+
disabled={isDisabled}
|
|
64
|
+
type="submit"
|
|
65
|
+
priority="high"
|
|
66
|
+
onKeyDown={handleEnterKeyPress}
|
|
67
|
+
data-cy="BecomeSeller-submitButton"
|
|
68
|
+
>
|
|
69
|
+
<FormattedMessage
|
|
70
|
+
id={'becomeSeller.becomeSellerText'}
|
|
71
|
+
defaultMessage={'Create an Account'}
|
|
72
|
+
/>
|
|
73
|
+
</Button>
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<Form
|
|
78
|
+
data-cy="BecomeSeller-form"
|
|
79
|
+
className={classes.root}
|
|
80
|
+
initialValues={initialValues}
|
|
81
|
+
onSubmit={handleSubmit}
|
|
82
|
+
>
|
|
83
|
+
<h2 data-cy="BecomeSeller-title" className={classes.title}>
|
|
84
|
+
<FormattedMessage
|
|
85
|
+
id={'becomeSeller.becomeSellerText'}
|
|
86
|
+
defaultMessage={'Create an Account'}
|
|
87
|
+
/>
|
|
88
|
+
</h2>
|
|
89
|
+
<FormError errors={Array.from(errors.values())} />
|
|
90
|
+
<Field
|
|
91
|
+
id="firstName"
|
|
92
|
+
label={formatMessage({
|
|
93
|
+
id: 'becomeSeller.firstNameText',
|
|
94
|
+
defaultMessage: 'First Name'
|
|
95
|
+
})}
|
|
96
|
+
>
|
|
97
|
+
<TextInput
|
|
98
|
+
id="firstName"
|
|
99
|
+
field="customer.firstname"
|
|
100
|
+
autoComplete="given-name"
|
|
101
|
+
validate={isRequired}
|
|
102
|
+
validateOnBlur
|
|
103
|
+
mask={value => value && value.trim()}
|
|
104
|
+
maskOnBlur={true}
|
|
105
|
+
data-cy="customer-firstname"
|
|
106
|
+
aria-label={formatMessage({
|
|
107
|
+
id: 'global.firstNameRequired',
|
|
108
|
+
defaultMessage: 'First Name Required'
|
|
109
|
+
})}
|
|
110
|
+
/>
|
|
111
|
+
</Field>
|
|
112
|
+
<Field
|
|
113
|
+
id="lastName"
|
|
114
|
+
label={formatMessage({
|
|
115
|
+
id: 'becomeSeller.lastNameText',
|
|
116
|
+
defaultMessage: 'Last Name'
|
|
117
|
+
})}
|
|
118
|
+
>
|
|
119
|
+
<TextInput
|
|
120
|
+
id="lastName"
|
|
121
|
+
field="customer.lastname"
|
|
122
|
+
autoComplete="family-name"
|
|
123
|
+
validate={isRequired}
|
|
124
|
+
validateOnBlur
|
|
125
|
+
mask={value => value && value.trim()}
|
|
126
|
+
maskOnBlur={true}
|
|
127
|
+
data-cy="customer-lastname"
|
|
128
|
+
aria-label={formatMessage({
|
|
129
|
+
id: 'global.lastNameRequired',
|
|
130
|
+
defaultMessage: 'Last Name Required'
|
|
131
|
+
})}
|
|
132
|
+
/>
|
|
133
|
+
</Field>
|
|
134
|
+
<Field
|
|
135
|
+
id="Email"
|
|
136
|
+
label={formatMessage({
|
|
137
|
+
id: 'becomeSeller.emailText',
|
|
138
|
+
defaultMessage: 'Email'
|
|
139
|
+
})}
|
|
140
|
+
>
|
|
141
|
+
<TextInput
|
|
142
|
+
id="Email"
|
|
143
|
+
field="customer.email"
|
|
144
|
+
autoComplete="email"
|
|
145
|
+
validate={isRequired}
|
|
146
|
+
validateOnBlur
|
|
147
|
+
mask={value => value && value.trim()}
|
|
148
|
+
maskOnBlur={true}
|
|
149
|
+
data-cy="customer-email"
|
|
150
|
+
aria-label={formatMessage({
|
|
151
|
+
id: 'global.emailRequired',
|
|
152
|
+
defaultMessage: 'Email Required'
|
|
153
|
+
})}
|
|
154
|
+
/>
|
|
155
|
+
</Field>
|
|
156
|
+
<Password
|
|
157
|
+
id="Password"
|
|
158
|
+
autoComplete="new-password"
|
|
159
|
+
fieldName="password"
|
|
160
|
+
isToggleButtonHidden={false}
|
|
161
|
+
label={formatMessage({
|
|
162
|
+
id: 'becomeSeller.passwordText',
|
|
163
|
+
defaultMessage: 'Password'
|
|
164
|
+
})}
|
|
165
|
+
validate={combine([
|
|
166
|
+
isRequired,
|
|
167
|
+
[hasLengthAtLeast, 8],
|
|
168
|
+
validatePassword
|
|
169
|
+
])}
|
|
170
|
+
validateOnBlur
|
|
171
|
+
mask={value => value && value.trim()}
|
|
172
|
+
maskOnBlur={true}
|
|
173
|
+
data-cy="password"
|
|
174
|
+
aria-label={formatMessage({
|
|
175
|
+
id: 'global.passwordRequired',
|
|
176
|
+
defaultMessage: 'Password Required'
|
|
177
|
+
})}
|
|
178
|
+
/>
|
|
179
|
+
<div className={classes.subscribe}>
|
|
180
|
+
<Checkbox
|
|
181
|
+
field="subscribe"
|
|
182
|
+
id="subscribe"
|
|
183
|
+
label={formatMessage({
|
|
184
|
+
id: 'becomeSeller.subscribeText',
|
|
185
|
+
defaultMessage: 'Subscribe to news and updates'
|
|
186
|
+
})}
|
|
187
|
+
/>
|
|
188
|
+
</div>
|
|
189
|
+
<GoogleRecaptcha {...recaptchaWidgetProps} />
|
|
190
|
+
<div className={classes.actions}>
|
|
191
|
+
{submitButton}
|
|
192
|
+
{cancelButton}
|
|
193
|
+
</div>
|
|
194
|
+
</Form>
|
|
195
|
+
);
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
BecomeSeller.propTypes = {
|
|
199
|
+
classes: shape({
|
|
200
|
+
actions: string,
|
|
201
|
+
lead: string,
|
|
202
|
+
root: string,
|
|
203
|
+
subscribe: string
|
|
204
|
+
}),
|
|
205
|
+
initialValues: shape({
|
|
206
|
+
email: string,
|
|
207
|
+
firstName: string,
|
|
208
|
+
lastName: string
|
|
209
|
+
}),
|
|
210
|
+
isCancelButtonHidden: bool,
|
|
211
|
+
onSubmit: func,
|
|
212
|
+
onCancel: func
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
BecomeSeller.defaultProps = {
|
|
216
|
+
onCancel: () => {},
|
|
217
|
+
isCancelButtonHidden: true
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
export default BecomeSeller;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: gap-xs from global;
|
|
3
|
+
composes: grid from global;
|
|
4
|
+
composes: justify-items-stretch from global;
|
|
5
|
+
composes: px-sm from global;
|
|
6
|
+
composes: py-xs from global;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.message {
|
|
10
|
+
composes: bg-subtle from global;
|
|
11
|
+
composes: leading-tight from global;
|
|
12
|
+
composes: p-xs from global;
|
|
13
|
+
composes: rounded from global;
|
|
14
|
+
composes: text-sm from global;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* TODO @TW: cannot compose */
|
|
18
|
+
.message:empty {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.actions {
|
|
23
|
+
composes: gap-xs from global;
|
|
24
|
+
composes: grid from global;
|
|
25
|
+
composes: grid-flow-row from global;
|
|
26
|
+
composes: justify-center from global;
|
|
27
|
+
composes: mt-xs from global;
|
|
28
|
+
composes: text-center from global;
|
|
29
|
+
|
|
30
|
+
composes: lg_grid-flow-col from global;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.cancelButton {
|
|
34
|
+
composes: root_lowPriority from '../Button/button.module.css';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.submitButton {
|
|
38
|
+
composes: root_highPriority from '../Button/button.module.css';
|
|
39
|
+
|
|
40
|
+
composes: col-start-auto from global;
|
|
41
|
+
|
|
42
|
+
composes: lg_col-start-2 from global;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.subscribe {
|
|
46
|
+
composes: -ml-1.5 from global;
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default} from './becomeSeller';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { shape, string } from 'prop-types';
|
|
3
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
4
|
+
|
|
5
|
+
import { useBecomeSellerPage } from '@riosst100/pwa-seller-registration/src/talons/BecomeSellerPage/useBecomeSellerPage';
|
|
6
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
+
import BecomeSeller from '@riosst100/pwa-seller-registration/lib/components/BecomeSeller';
|
|
8
|
+
import { StoreTitle } from '@magento/venia-ui/lib/components/Head';
|
|
9
|
+
|
|
10
|
+
const BecomeSellerPage = props => {
|
|
11
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
12
|
+
const { becomeSellerProps } = useBecomeSellerPage(props);
|
|
13
|
+
const { formatMessage } = useIntl();
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div className={classes.root}>
|
|
17
|
+
<StoreTitle>
|
|
18
|
+
{formatMessage({
|
|
19
|
+
id: 'becomeSellerPage.title',
|
|
20
|
+
defaultMessage: 'Become a Seller'
|
|
21
|
+
})}
|
|
22
|
+
</StoreTitle>
|
|
23
|
+
<h1 className={classes.header}>
|
|
24
|
+
<FormattedMessage
|
|
25
|
+
id="becomeSellerPage.header"
|
|
26
|
+
defaultMessage="Become a Seller"
|
|
27
|
+
/>
|
|
28
|
+
</h1>
|
|
29
|
+
<div className={classes.contentContainer}>
|
|
30
|
+
<BecomeSeller {...becomeSellerProps} />
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default BecomeSellerPage;
|
|
37
|
+
|
|
38
|
+
BecomeSellerPage.defaultProps = {
|
|
39
|
+
signedInRedirectUrl: '/become-seller',
|
|
40
|
+
signInPageUrl: 'https://seller-local.tcgcollective.co'
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
BecomeSellerPage.propTypes = {
|
|
44
|
+
classes: shape({
|
|
45
|
+
root: string
|
|
46
|
+
}),
|
|
47
|
+
signedInRedirectUrl: string,
|
|
48
|
+
signInPageUrl: string
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default} from './becomeSellerPage';
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
|
|
8
|
+
const BecomeSellerLink = props => {
|
|
9
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
10
|
+
const becomeSellerLabel = "Become a Seller";
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div className={classes.root} data-cy="BecomeSellerLink-root">
|
|
14
|
+
<Link
|
|
15
|
+
aria-label={becomeSellerLabel}
|
|
16
|
+
to={resourceUrl('/become-seller')}
|
|
17
|
+
>{becomeSellerLabel}</Link>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default BecomeSellerLink;
|
|
23
|
+
|
|
24
|
+
BecomeSellerLink.propTypes = {
|
|
25
|
+
classes: shape({
|
|
26
|
+
root: string
|
|
27
|
+
})
|
|
28
|
+
};
|
|
@@ -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
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { shape, string } from 'prop-types';
|
|
3
3
|
|
|
4
|
-
import { useWebsiteSwitcher } from '@riosst100/pwa-
|
|
4
|
+
import { useWebsiteSwitcher } from '@riosst100/pwa-marketplace/src/talons/Header/useWebsiteSwitcher';
|
|
5
5
|
import { availableRoutes } from '@magento/venia-ui/lib/components/Routes/routes';
|
|
6
6
|
|
|
7
7
|
import { useStyle } from '@magento/venia-ui/lib/classify';
|
package/src/intercept.js
CHANGED
|
@@ -47,4 +47,24 @@ module.exports = async targets => {
|
|
|
47
47
|
WEBSITE_CODE: process.env.WEBSITE_CODE
|
|
48
48
|
}).apply(compiler);
|
|
49
49
|
});
|
|
50
|
+
|
|
51
|
+
// targets.of("@magento/venia-ui").routes.tap(routes => {
|
|
52
|
+
// routes.push({
|
|
53
|
+
// name: "Become Seller",
|
|
54
|
+
// pattern: "/become-seller",
|
|
55
|
+
// path: require.resolve("../components/BecomeSeller/index.js")
|
|
56
|
+
// });
|
|
57
|
+
// return routes;
|
|
58
|
+
// });
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
module.exports = (targets) => {
|
|
62
|
+
targets.of("@magento/venia-ui").routes.tap((routes) => {
|
|
63
|
+
routes.push({
|
|
64
|
+
name: "BecomeSellerRoute",
|
|
65
|
+
pattern: "/become-seller",
|
|
66
|
+
path: require.resolve("./components/BecomeSellerPage/index.js"),
|
|
67
|
+
});
|
|
68
|
+
return routes;
|
|
69
|
+
});
|
|
50
70
|
};
|
|
@@ -5,7 +5,7 @@ import { BrowserRouter } from 'react-router-dom';
|
|
|
5
5
|
import { useAdapter } from '@magento/peregrine/lib/talons/Adapter/useAdapter';
|
|
6
6
|
import App, { AppContextProvider } from '@magento/venia-ui/lib/components/App';
|
|
7
7
|
import StoreCodeRoute from '@magento/venia-ui/lib/components/StoreCodeRoute';
|
|
8
|
-
import { useWebsiteByIp } from '@riosst100/pwa-
|
|
8
|
+
import { useWebsiteByIp } from '@riosst100/pwa-marketplace/src/talons/WebsiteByIp/useWebsiteByIp';
|
|
9
9
|
import { BrowserPersistence } from '@magento/peregrine/lib/util';
|
|
10
10
|
|
|
11
11
|
const storage = new BrowserPersistence();
|
|
@@ -14,8 +14,9 @@ import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
|
14
14
|
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
15
15
|
import defaultClasses from '@magento/venia-ui/lib/components/Header/header.module.css';
|
|
16
16
|
import StoreSwitcher from '@magento/venia-ui/lib/components/Header/storeSwitcher';
|
|
17
|
-
import WebsiteSwitcher from '@riosst100/pwa-
|
|
17
|
+
import WebsiteSwitcher from '@riosst100/pwa-marketplace/src/components/Header/websiteSwitcher';
|
|
18
18
|
import CurrencySwitcher from '@magento/venia-ui/lib/components/Header/currencySwitcher';
|
|
19
|
+
import BecomeSellerLink from '@riosst100/pwa-marketplace/src/components/Header/becomeSellerLink';
|
|
19
20
|
import MegaMenu from '@magento/venia-ui/lib/components/MegaMenu';
|
|
20
21
|
import PageLoadingIndicator from '@magento/venia-ui/lib/components/PageLoadingIndicator';
|
|
21
22
|
import { useIntl } from 'react-intl';
|
|
@@ -60,6 +61,7 @@ const Header = props => {
|
|
|
60
61
|
<Fragment>
|
|
61
62
|
<div className={classes.switchersContainer}>
|
|
62
63
|
<div className={classes.switchers} data-cy="Header-switchers">
|
|
64
|
+
<BecomeSellerLink />
|
|
63
65
|
<WebsiteSwitcher />
|
|
64
66
|
<StoreSwitcher />
|
|
65
67
|
<CurrencySwitcher />
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useCallback, useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
export const useWebsiteSwitcher = (props = {}) => {
|
|
4
|
+
const handleTriggerClick = useCallback(() => {
|
|
5
|
+
// Toggle Stores Menu.
|
|
6
|
+
// setStoreMenuIsOpen(isOpen => !isOpen);
|
|
7
|
+
// globalThis.location.assign(`${newPath || ''}`);
|
|
8
|
+
}, []);
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
handleTriggerClick
|
|
12
|
+
};
|
|
13
|
+
};
|