@riosst100/pwa-marketplace 1.2.7 → 1.2.9
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 +76 -76
- package/src/componentOverrideMapping.js +17 -17
- package/src/components/BecomeSeller/becomeSeller.js +335 -335
- package/src/components/BecomeSeller/becomeSeller.module.css +46 -46
- package/src/components/BecomeSellerLink/becomeSellerLink.js +52 -52
- package/src/components/BecomeSellerLink/becomeSellerLink.module.css +12 -12
- package/src/components/BecomeSellerPage/becomeSellerPage.js +45 -45
- package/src/components/BecomeSellerPage/becomeSellerPage.module.css +21 -21
- package/src/components/Filter/index.js +53 -53
- package/src/components/Header/becomeSellerLink.js +28 -28
- package/src/components/Header/becomeSellerLink.module.css +12 -12
- package/src/components/Header/websiteSwitcher.js +109 -109
- package/src/components/OperatingHours/index.js +1 -0
- package/src/components/OperatingHours/operatingHours.js +35 -0
- package/src/components/Pagination/index.js +49 -49
- package/src/components/PhoneTextInput/phoneTextInput.module.css +21 -21
- package/src/components/ProductItem/index.js +50 -50
- package/src/components/Search/index.js +16 -16
- package/src/components/Seller/index.js +1 -1
- package/src/components/Seller/seller.js +42 -249
- package/src/components/Seller/sellerAddressCard.js +48 -0
- package/src/components/SellerAccountPage/sellerAccountPage.js +110 -110
- package/src/components/SellerAccountPage/sellerAccountPage.module.css +55 -55
- package/src/components/SellerCountry/sellerCountry.gql.js +11 -11
- package/src/components/SellerDetail/index.js +1 -0
- package/src/components/SellerDetail/sellerDetail.js +166 -0
- package/src/components/SellerInformation/index.js +1 -1
- package/src/components/SellerInformation/sellerInformation.js +86 -90
- package/src/components/SellerLocation/index.js +1 -1
- package/src/components/SellerLocation/sellerLocation.js +19 -19
- package/src/components/SellerLocation/sellerLocationItem.js +27 -27
- package/src/components/SellerPage/sellerPage.js +9 -9
- package/src/components/SellerProducts/sellerProducts.js +46 -46
- package/src/components/SellerReview/index.js +1 -1
- package/src/components/SellerReview/sellerReview.js +143 -143
- package/src/components/SellerReviewItem/sellerReviewItem.js +60 -60
- package/src/components/SellerVerification/sellerVerification.js +198 -198
- package/src/components/SellerVerification/sellerVerification.module.css +47 -47
- package/src/components/SellerVerificationPage/sellerVerificationPage.js +43 -43
- package/src/components/SellerVerificationPage/sellerVerificationPage.module.css +21 -21
- package/src/components/SortBy/index.js +24 -24
- package/src/components/WebsiteSwitcher/websiteSwitcher.js +109 -109
- package/src/components/commons/Slider/index.js +13 -13
- package/src/components/commons/Tabs/index.js +64 -64
- package/src/index.js +6 -6
- package/src/intercept.js +113 -113
- package/src/moduleOverrideWebpackPlugin.js +70 -70
- package/src/overwrites/peregrine/lib/store/actions/user/asyncActions.js +96 -96
- package/src/overwrites/peregrine/lib/talons/AccountMenu/useAccountMenuItems.js +74 -74
- package/src/overwrites/peregrine/lib/talons/Adapter/useAdapter.js +208 -208
- package/src/overwrites/peregrine/lib/talons/Header/storeSwitcher.gql.js +45 -45
- package/src/overwrites/peregrine/lib/talons/Header/useStoreSwitcher.js +204 -204
- package/src/overwrites/peregrine/lib/talons/Region/useRegion.js +102 -102
- package/src/overwrites/peregrine/lib/talons/SignIn/signIn.gql.js +56 -56
- package/src/overwrites/peregrine/lib/talons/SignIn/useSignIn.js +226 -226
- package/src/overwrites/peregrine/lib/util/deriveErrorMessage.js +34 -34
- package/src/overwrites/pwa-buildpack/lib/queries/getAvailableStoresConfigData.graphql +11 -11
- package/src/overwrites/venia-ui/lib/components/Adapter/adapter.js +112 -112
- package/src/overwrites/venia-ui/lib/components/Header/header.js +130 -130
- package/src/overwrites/venia-ui/lib/components/Header/storeSwitcher.js +105 -105
- package/src/overwrites/venia-ui/lib/components/Header/switcherItem.js +47 -47
- package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/MegaMenu.spec.js +91 -91
- package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/MegaMenuItem.spec.js +123 -123
- package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/Submenu.spec.js +61 -61
- package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/SubmenuColumn.spec.js +50 -50
- package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/__snapshots__/MegaMenu.spec.js.snap +114 -114
- package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/__snapshots__/MegaMenuItem.spec.js.snap +71 -71
- package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/__snapshots__/Submenu.spec.js.snap +59 -59
- package/src/overwrites/venia-ui/lib/components/MegaMenu/__tests__/__snapshots__/SubmenuColumn.spec.js.snap +34 -34
- package/src/overwrites/venia-ui/lib/components/MegaMenu/index.js +1 -1
- package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenu.js +90 -90
- package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenu.module.css +12 -12
- package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenuItem.js +156 -156
- package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenuItem.module.css +30 -30
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.js +89 -89
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.module.css +42 -42
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenuColumn.js +99 -99
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenuColumn.module.css +28 -28
- package/src/overwrites/venia-ui/lib/components/SearchBar/__stories__/searchBar.js +11 -11
- package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/__snapshots__/searchField.spec.js.snap +72 -72
- package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/__snapshots__/suggestedCategories.spec.js.snap +30 -30
- package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/__snapshots__/suggestedProduct.spec.js.snap +69 -69
- package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/__snapshots__/suggestedProducts.spec.js.snap +7 -7
- package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/__snapshots__/suggestions.spec.js.snap +12 -12
- package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/autocomplete.spec.js +52 -52
- package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/searchBar.spec.js +82 -82
- package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/searchField.spec.js +87 -87
- package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/suggestedCategories.spec.js +45 -45
- package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/suggestedProduct.spec.js +43 -43
- package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/suggestedProducts.spec.js +45 -45
- package/src/overwrites/venia-ui/lib/components/SearchBar/__tests__/suggestions.spec.js +110 -110
- package/src/overwrites/venia-ui/lib/components/SearchBar/autocomplete.js +172 -172
- package/src/overwrites/venia-ui/lib/components/SearchBar/autocomplete.module.css +62 -62
- package/src/overwrites/venia-ui/lib/components/SearchBar/index.js +1 -1
- package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.js +74 -74
- package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.module.css +49 -49
- package/src/overwrites/venia-ui/lib/components/SearchBar/searchField.js +40 -40
- package/src/overwrites/venia-ui/lib/components/SearchBar/suggestedCategories.js +48 -48
- package/src/overwrites/venia-ui/lib/components/SearchBar/suggestedCategories.module.css +13 -13
- package/src/overwrites/venia-ui/lib/components/SearchBar/suggestedCategory.js +49 -49
- package/src/overwrites/venia-ui/lib/components/SearchBar/suggestedProduct.js +97 -97
- package/src/overwrites/venia-ui/lib/components/SearchBar/suggestedProduct.module.css +24 -24
- package/src/overwrites/venia-ui/lib/components/SearchBar/suggestedProducts.js +43 -43
- package/src/overwrites/venia-ui/lib/components/SearchBar/suggestedProducts.module.css +13 -13
- package/src/overwrites/venia-ui/lib/components/SearchBar/suggestions.js +75 -75
- package/src/overwrites/venia-ui/lib/components/SearchBar/suggestions.module.css +6 -6
- package/src/overwrites/venia-ui/lib/components/StoreCodeRoute/storeCodeRoute.js +75 -75
- package/src/overwrites/venia-ui/lib/targets/venia-ui-intercept.js +70 -70
- package/src/queries/getAvailableWebsitesConfigData.graphql +14 -14
- package/src/queries/index.js +30 -30
- package/src/talons/BecomeSeller/becomeSeller.gql.js +45 -45
- package/src/talons/BecomeSeller/useBecomeSeller.js +145 -145
- package/src/talons/BecomeSellerLink/useBecomeSellerLink.js +11 -11
- package/src/talons/BecomeSellerPage/useBecomeSellerPage.js +76 -76
- package/src/talons/Header/useBecomeSellerLink.js +13 -13
- package/src/talons/Header/useWebsiteSwitcher.js +218 -218
- package/src/talons/Seller/seller.gql.js +204 -139
- package/src/talons/Seller/useSeller.js +71 -66
- package/src/talons/SellerAccountPage/useSellerAccountPage.js +174 -174
- package/src/talons/SellerCountry/useSellerCountry.js +25 -25
- package/src/talons/WebsiteByIp/getWebsiteByIp.gql.js +13 -13
- package/src/talons/WebsiteByIp/useWebsiteByIp.js +34 -34
- package/src/talons/WebsiteSwitcher/useWebsiteSwitcher.js +218 -218
- package/src/theme/vars.js +6 -6
- package/src/util/mapSeller.js +7 -7
|
@@ -1,198 +1,198 @@
|
|
|
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-marketplace/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 Select from '@magento/venia-ui/lib/components/Select';
|
|
18
|
-
import TextInput from '@magento/venia-ui/lib/components/TextInput';
|
|
19
|
-
import defaultClasses from './sellerVerification.module.css';
|
|
20
|
-
import FormError from '@magento/venia-ui/lib/components/FormError';
|
|
21
|
-
import Password from '@magento/venia-ui/lib/components/Password';
|
|
22
|
-
import GoogleRecaptcha from '@magento/venia-ui/lib/components/GoogleReCaptcha';
|
|
23
|
-
|
|
24
|
-
const BecomeSeller = props => {
|
|
25
|
-
const talonProps = useBecomeSeller({
|
|
26
|
-
initialValues: props.initialValues,
|
|
27
|
-
onSubmit: props.onSubmit,
|
|
28
|
-
onCancel: props.onCancel
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const {
|
|
32
|
-
errors,
|
|
33
|
-
handleSubmit,
|
|
34
|
-
handleEnterKeyPress,
|
|
35
|
-
isDisabled,
|
|
36
|
-
initialValues,
|
|
37
|
-
recaptchaWidgetProps
|
|
38
|
-
} = talonProps;
|
|
39
|
-
const { formatMessage } = useIntl();
|
|
40
|
-
const classes = useStyle(defaultClasses, props.classes);
|
|
41
|
-
|
|
42
|
-
const submitButton = (
|
|
43
|
-
<Button
|
|
44
|
-
className={classes.submitButton}
|
|
45
|
-
disabled={isDisabled}
|
|
46
|
-
type="submit"
|
|
47
|
-
priority="high"
|
|
48
|
-
onKeyDown={handleEnterKeyPress}
|
|
49
|
-
data-cy="BecomeSeller-submitButton"
|
|
50
|
-
>
|
|
51
|
-
<FormattedMessage
|
|
52
|
-
id={'sellerVerification.sellerVerificationText'}
|
|
53
|
-
defaultMessage={'Become a Seller'}
|
|
54
|
-
/>
|
|
55
|
-
</Button>
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
const sellerTypeOptions = [
|
|
59
|
-
{
|
|
60
|
-
value: "individual",
|
|
61
|
-
label: "Individual"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
value: "company",
|
|
65
|
-
label: "Company"
|
|
66
|
-
}
|
|
67
|
-
];
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
<Form
|
|
71
|
-
data-cy="BecomeSeller-form"
|
|
72
|
-
className={classes.root}
|
|
73
|
-
initialValues={initialValues}
|
|
74
|
-
onSubmit={handleSubmit}
|
|
75
|
-
>
|
|
76
|
-
<h2 data-cy="BecomeSeller-title" className={classes.title}>
|
|
77
|
-
<FormattedMessage
|
|
78
|
-
id={'sellerVerification.sellerVerificationText'}
|
|
79
|
-
defaultMessage={'Become a Seller'}
|
|
80
|
-
/>
|
|
81
|
-
</h2>
|
|
82
|
-
<FormError errors={Array.from(errors.values())} />
|
|
83
|
-
<Field
|
|
84
|
-
id="sellerType"
|
|
85
|
-
label={formatMessage({
|
|
86
|
-
id: 'sellerVerification.sellerTypeText',
|
|
87
|
-
defaultMessage: 'Seller Type'
|
|
88
|
-
})}
|
|
89
|
-
>
|
|
90
|
-
<Select
|
|
91
|
-
field="seller.seller_type"
|
|
92
|
-
id={classes.root}
|
|
93
|
-
items={sellerTypeOptions}
|
|
94
|
-
/>
|
|
95
|
-
</Field>
|
|
96
|
-
<Field
|
|
97
|
-
id="sellerProfileName"
|
|
98
|
-
label={formatMessage({
|
|
99
|
-
id: 'sellerVerification.sellerProfileNameText',
|
|
100
|
-
defaultMessage: 'Seller Profile Name'
|
|
101
|
-
})}
|
|
102
|
-
>
|
|
103
|
-
<TextInput
|
|
104
|
-
id="sellerProfileName"
|
|
105
|
-
field="seller.seller_profile_name"
|
|
106
|
-
validate={isRequired}
|
|
107
|
-
validateOnBlur
|
|
108
|
-
mask={value => value && value.trim()}
|
|
109
|
-
maskOnBlur={true}
|
|
110
|
-
data-cy="seller-profilename"
|
|
111
|
-
aria-label={formatMessage({
|
|
112
|
-
id: 'global.sellerProfileNameRequired',
|
|
113
|
-
defaultMessage: 'Seller Profile Name is required.'
|
|
114
|
-
})}
|
|
115
|
-
/>
|
|
116
|
-
</Field>
|
|
117
|
-
<Field
|
|
118
|
-
id="companyName"
|
|
119
|
-
label={formatMessage({
|
|
120
|
-
id: 'sellerVerification.companyNameText',
|
|
121
|
-
defaultMessage: 'Company Name'
|
|
122
|
-
})}
|
|
123
|
-
>
|
|
124
|
-
<TextInput
|
|
125
|
-
id="companyName"
|
|
126
|
-
field="seller.company_name"
|
|
127
|
-
validate={isRequired}
|
|
128
|
-
validateOnBlur
|
|
129
|
-
mask={value => value && value.trim()}
|
|
130
|
-
maskOnBlur={true}
|
|
131
|
-
data-cy="seller-companyname"
|
|
132
|
-
aria-label={formatMessage({
|
|
133
|
-
id: 'global.companyNameRequired',
|
|
134
|
-
defaultMessage: 'Company Name Required'
|
|
135
|
-
})}
|
|
136
|
-
/>
|
|
137
|
-
</Field>
|
|
138
|
-
<Field
|
|
139
|
-
id="storeURL"
|
|
140
|
-
label={formatMessage({
|
|
141
|
-
id: 'sellerVerification.storeURLText',
|
|
142
|
-
defaultMessage: 'Store URL'
|
|
143
|
-
})}
|
|
144
|
-
>
|
|
145
|
-
<TextInput
|
|
146
|
-
id="storeUrl"
|
|
147
|
-
field="seller.store_url"
|
|
148
|
-
validate={isRequired}
|
|
149
|
-
validateOnBlur
|
|
150
|
-
mask={value => value && value.trim()}
|
|
151
|
-
maskOnBlur={true}
|
|
152
|
-
data-cy="seller-storeurl"
|
|
153
|
-
aria-label={formatMessage({
|
|
154
|
-
id: 'global.storeUrlRequired',
|
|
155
|
-
defaultMessage: 'Store URL is required.'
|
|
156
|
-
})}
|
|
157
|
-
/>
|
|
158
|
-
</Field>
|
|
159
|
-
<div className={classes.subscribe}>
|
|
160
|
-
<Checkbox
|
|
161
|
-
field="become_seller_agreement"
|
|
162
|
-
id="sellerVerificationAgreement"
|
|
163
|
-
label={formatMessage({
|
|
164
|
-
id: 'sellerVerification.sellerVerificationAgreementText',
|
|
165
|
-
defaultMessage: 'I agree the Terms and Condition (Terms and Conditions)'
|
|
166
|
-
})}
|
|
167
|
-
/>
|
|
168
|
-
</div>
|
|
169
|
-
<GoogleRecaptcha {...recaptchaWidgetProps} />
|
|
170
|
-
<div className={classes.actions}>
|
|
171
|
-
{submitButton}
|
|
172
|
-
</div>
|
|
173
|
-
</Form>
|
|
174
|
-
);
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
BecomeSeller.propTypes = {
|
|
178
|
-
classes: shape({
|
|
179
|
-
actions: string,
|
|
180
|
-
lead: string,
|
|
181
|
-
root: string,
|
|
182
|
-
subscribe: string
|
|
183
|
-
}),
|
|
184
|
-
initialValues: shape({
|
|
185
|
-
sellerProfileName: string,
|
|
186
|
-
companyName: string
|
|
187
|
-
}),
|
|
188
|
-
isCancelButtonHidden: bool,
|
|
189
|
-
onSubmit: func,
|
|
190
|
-
onCancel: func
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
BecomeSeller.defaultProps = {
|
|
194
|
-
onCancel: () => {},
|
|
195
|
-
isCancelButtonHidden: true
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
export default BecomeSeller;
|
|
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-marketplace/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 Select from '@magento/venia-ui/lib/components/Select';
|
|
18
|
+
import TextInput from '@magento/venia-ui/lib/components/TextInput';
|
|
19
|
+
import defaultClasses from './sellerVerification.module.css';
|
|
20
|
+
import FormError from '@magento/venia-ui/lib/components/FormError';
|
|
21
|
+
import Password from '@magento/venia-ui/lib/components/Password';
|
|
22
|
+
import GoogleRecaptcha from '@magento/venia-ui/lib/components/GoogleReCaptcha';
|
|
23
|
+
|
|
24
|
+
const BecomeSeller = props => {
|
|
25
|
+
const talonProps = useBecomeSeller({
|
|
26
|
+
initialValues: props.initialValues,
|
|
27
|
+
onSubmit: props.onSubmit,
|
|
28
|
+
onCancel: props.onCancel
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const {
|
|
32
|
+
errors,
|
|
33
|
+
handleSubmit,
|
|
34
|
+
handleEnterKeyPress,
|
|
35
|
+
isDisabled,
|
|
36
|
+
initialValues,
|
|
37
|
+
recaptchaWidgetProps
|
|
38
|
+
} = talonProps;
|
|
39
|
+
const { formatMessage } = useIntl();
|
|
40
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
41
|
+
|
|
42
|
+
const submitButton = (
|
|
43
|
+
<Button
|
|
44
|
+
className={classes.submitButton}
|
|
45
|
+
disabled={isDisabled}
|
|
46
|
+
type="submit"
|
|
47
|
+
priority="high"
|
|
48
|
+
onKeyDown={handleEnterKeyPress}
|
|
49
|
+
data-cy="BecomeSeller-submitButton"
|
|
50
|
+
>
|
|
51
|
+
<FormattedMessage
|
|
52
|
+
id={'sellerVerification.sellerVerificationText'}
|
|
53
|
+
defaultMessage={'Become a Seller'}
|
|
54
|
+
/>
|
|
55
|
+
</Button>
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const sellerTypeOptions = [
|
|
59
|
+
{
|
|
60
|
+
value: "individual",
|
|
61
|
+
label: "Individual"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
value: "company",
|
|
65
|
+
label: "Company"
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Form
|
|
71
|
+
data-cy="BecomeSeller-form"
|
|
72
|
+
className={classes.root}
|
|
73
|
+
initialValues={initialValues}
|
|
74
|
+
onSubmit={handleSubmit}
|
|
75
|
+
>
|
|
76
|
+
<h2 data-cy="BecomeSeller-title" className={classes.title}>
|
|
77
|
+
<FormattedMessage
|
|
78
|
+
id={'sellerVerification.sellerVerificationText'}
|
|
79
|
+
defaultMessage={'Become a Seller'}
|
|
80
|
+
/>
|
|
81
|
+
</h2>
|
|
82
|
+
<FormError errors={Array.from(errors.values())} />
|
|
83
|
+
<Field
|
|
84
|
+
id="sellerType"
|
|
85
|
+
label={formatMessage({
|
|
86
|
+
id: 'sellerVerification.sellerTypeText',
|
|
87
|
+
defaultMessage: 'Seller Type'
|
|
88
|
+
})}
|
|
89
|
+
>
|
|
90
|
+
<Select
|
|
91
|
+
field="seller.seller_type"
|
|
92
|
+
id={classes.root}
|
|
93
|
+
items={sellerTypeOptions}
|
|
94
|
+
/>
|
|
95
|
+
</Field>
|
|
96
|
+
<Field
|
|
97
|
+
id="sellerProfileName"
|
|
98
|
+
label={formatMessage({
|
|
99
|
+
id: 'sellerVerification.sellerProfileNameText',
|
|
100
|
+
defaultMessage: 'Seller Profile Name'
|
|
101
|
+
})}
|
|
102
|
+
>
|
|
103
|
+
<TextInput
|
|
104
|
+
id="sellerProfileName"
|
|
105
|
+
field="seller.seller_profile_name"
|
|
106
|
+
validate={isRequired}
|
|
107
|
+
validateOnBlur
|
|
108
|
+
mask={value => value && value.trim()}
|
|
109
|
+
maskOnBlur={true}
|
|
110
|
+
data-cy="seller-profilename"
|
|
111
|
+
aria-label={formatMessage({
|
|
112
|
+
id: 'global.sellerProfileNameRequired',
|
|
113
|
+
defaultMessage: 'Seller Profile Name is required.'
|
|
114
|
+
})}
|
|
115
|
+
/>
|
|
116
|
+
</Field>
|
|
117
|
+
<Field
|
|
118
|
+
id="companyName"
|
|
119
|
+
label={formatMessage({
|
|
120
|
+
id: 'sellerVerification.companyNameText',
|
|
121
|
+
defaultMessage: 'Company Name'
|
|
122
|
+
})}
|
|
123
|
+
>
|
|
124
|
+
<TextInput
|
|
125
|
+
id="companyName"
|
|
126
|
+
field="seller.company_name"
|
|
127
|
+
validate={isRequired}
|
|
128
|
+
validateOnBlur
|
|
129
|
+
mask={value => value && value.trim()}
|
|
130
|
+
maskOnBlur={true}
|
|
131
|
+
data-cy="seller-companyname"
|
|
132
|
+
aria-label={formatMessage({
|
|
133
|
+
id: 'global.companyNameRequired',
|
|
134
|
+
defaultMessage: 'Company Name Required'
|
|
135
|
+
})}
|
|
136
|
+
/>
|
|
137
|
+
</Field>
|
|
138
|
+
<Field
|
|
139
|
+
id="storeURL"
|
|
140
|
+
label={formatMessage({
|
|
141
|
+
id: 'sellerVerification.storeURLText',
|
|
142
|
+
defaultMessage: 'Store URL'
|
|
143
|
+
})}
|
|
144
|
+
>
|
|
145
|
+
<TextInput
|
|
146
|
+
id="storeUrl"
|
|
147
|
+
field="seller.store_url"
|
|
148
|
+
validate={isRequired}
|
|
149
|
+
validateOnBlur
|
|
150
|
+
mask={value => value && value.trim()}
|
|
151
|
+
maskOnBlur={true}
|
|
152
|
+
data-cy="seller-storeurl"
|
|
153
|
+
aria-label={formatMessage({
|
|
154
|
+
id: 'global.storeUrlRequired',
|
|
155
|
+
defaultMessage: 'Store URL is required.'
|
|
156
|
+
})}
|
|
157
|
+
/>
|
|
158
|
+
</Field>
|
|
159
|
+
<div className={classes.subscribe}>
|
|
160
|
+
<Checkbox
|
|
161
|
+
field="become_seller_agreement"
|
|
162
|
+
id="sellerVerificationAgreement"
|
|
163
|
+
label={formatMessage({
|
|
164
|
+
id: 'sellerVerification.sellerVerificationAgreementText',
|
|
165
|
+
defaultMessage: 'I agree the Terms and Condition (Terms and Conditions)'
|
|
166
|
+
})}
|
|
167
|
+
/>
|
|
168
|
+
</div>
|
|
169
|
+
<GoogleRecaptcha {...recaptchaWidgetProps} />
|
|
170
|
+
<div className={classes.actions}>
|
|
171
|
+
{submitButton}
|
|
172
|
+
</div>
|
|
173
|
+
</Form>
|
|
174
|
+
);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
BecomeSeller.propTypes = {
|
|
178
|
+
classes: shape({
|
|
179
|
+
actions: string,
|
|
180
|
+
lead: string,
|
|
181
|
+
root: string,
|
|
182
|
+
subscribe: string
|
|
183
|
+
}),
|
|
184
|
+
initialValues: shape({
|
|
185
|
+
sellerProfileName: string,
|
|
186
|
+
companyName: string
|
|
187
|
+
}),
|
|
188
|
+
isCancelButtonHidden: bool,
|
|
189
|
+
onSubmit: func,
|
|
190
|
+
onCancel: func
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
BecomeSeller.defaultProps = {
|
|
194
|
+
onCancel: () => {},
|
|
195
|
+
isCancelButtonHidden: true
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
export default BecomeSeller;
|
|
@@ -1,47 +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 '@magento/venia-ui/lib/components/Button/button.module.css';
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.submitButton {
|
|
38
|
-
composes: root_highPriority from '@magento/venia-ui/lib/components/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
|
-
}
|
|
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 '@magento/venia-ui/lib/components/Button/button.module.css';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.submitButton {
|
|
38
|
+
composes: root_highPriority from '@magento/venia-ui/lib/components/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
|
+
}
|
|
@@ -1,43 +1,43 @@
|
|
|
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-marketplace/src/talons/BecomeSellerPage/useBecomeSellerPage';
|
|
6
|
-
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
-
import BecomeSeller from '@riosst100/pwa-marketplace/src/components/BecomeSeller';
|
|
8
|
-
import { StoreTitle } from '@magento/venia-ui/lib/components/Head';
|
|
9
|
-
import defaultClasses from './sellerVerificationPage.module.css';
|
|
10
|
-
|
|
11
|
-
const BecomeSellerPage = props => {
|
|
12
|
-
const classes = useStyle(defaultClasses, props.classes);
|
|
13
|
-
const { sellerVerificationProps } = useBecomeSellerPage(props);
|
|
14
|
-
const { formatMessage } = useIntl();
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<div className={classes.root}>
|
|
18
|
-
<StoreTitle>
|
|
19
|
-
{formatMessage({
|
|
20
|
-
id: 'sellerVerificationPage.title',
|
|
21
|
-
defaultMessage: 'Become a Seller'
|
|
22
|
-
})}
|
|
23
|
-
</StoreTitle>
|
|
24
|
-
<div className={classes.contentContainer}>
|
|
25
|
-
<BecomeSeller {...sellerVerificationProps} />
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default BecomeSellerPage;
|
|
32
|
-
|
|
33
|
-
BecomeSellerPage.defaultProps = {
|
|
34
|
-
signedInRedirectUrl: '/seller-verification',
|
|
35
|
-
signInPageUrl: '/become-seller'
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
BecomeSellerPage.propTypes = {
|
|
39
|
-
classes: shape({
|
|
40
|
-
root: string
|
|
41
|
-
}),
|
|
42
|
-
signedInRedirectUrl: string
|
|
43
|
-
};
|
|
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-marketplace/src/talons/BecomeSellerPage/useBecomeSellerPage';
|
|
6
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
+
import BecomeSeller from '@riosst100/pwa-marketplace/src/components/BecomeSeller';
|
|
8
|
+
import { StoreTitle } from '@magento/venia-ui/lib/components/Head';
|
|
9
|
+
import defaultClasses from './sellerVerificationPage.module.css';
|
|
10
|
+
|
|
11
|
+
const BecomeSellerPage = props => {
|
|
12
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
13
|
+
const { sellerVerificationProps } = useBecomeSellerPage(props);
|
|
14
|
+
const { formatMessage } = useIntl();
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className={classes.root}>
|
|
18
|
+
<StoreTitle>
|
|
19
|
+
{formatMessage({
|
|
20
|
+
id: 'sellerVerificationPage.title',
|
|
21
|
+
defaultMessage: 'Become a Seller'
|
|
22
|
+
})}
|
|
23
|
+
</StoreTitle>
|
|
24
|
+
<div className={classes.contentContainer}>
|
|
25
|
+
<BecomeSeller {...sellerVerificationProps} />
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default BecomeSellerPage;
|
|
32
|
+
|
|
33
|
+
BecomeSellerPage.defaultProps = {
|
|
34
|
+
signedInRedirectUrl: '/seller-verification',
|
|
35
|
+
signInPageUrl: '/become-seller'
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
BecomeSellerPage.propTypes = {
|
|
39
|
+
classes: shape({
|
|
40
|
+
root: string
|
|
41
|
+
}),
|
|
42
|
+
signedInRedirectUrl: string
|
|
43
|
+
};
|
|
@@ -1,21 +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
|
-
}
|
|
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
|
+
}
|