@riosst100/pwa-marketplace 1.2.5 → 1.2.7
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/.github/workflows/dependabot.yml +28 -28
- package/package.json +18 -18
- 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/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 +249 -250
- 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/SellerInformation/index.js +1 -1
- package/src/components/SellerInformation/sellerInformation.js +90 -118
- package/src/components/SellerLocation/index.js +1 -1
- package/src/components/SellerLocation/sellerLocation.js +19 -23
- package/src/components/SellerLocation/sellerLocationItem.js +27 -25
- package/src/components/SellerPage/sellerPage.js +9 -9
- package/src/components/SellerProducts/sellerProducts.js +47 -67
- 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 +139 -204
- package/src/talons/Seller/useSeller.js +66 -71
- 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
- package/src/components/OperatingHours/index.js +0 -1
- package/src/components/OperatingHours/operatingHours.js +0 -32
- package/src/components/Seller/sellerAddressCard.js +0 -48
- package/src/components/SellerDetail/index.js +0 -1
- package/src/components/SellerDetail/sellerDetail.js +0 -158
- package/src/components/SellerPage/core.js +0 -10
- package/src/talons/SellerProducts/useSellerProducts.js +0 -129
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Star1 } from 'iconsax-react';
|
|
3
|
-
|
|
4
|
-
const SellerReviewItem = () => {
|
|
5
|
-
return (
|
|
6
|
-
<>
|
|
7
|
-
<div class="flex flex-col items-start gap-[10px] p-[25px] relative self-stretch w-full flex-[0_0_auto] bg-white rounded-[6px] border border-solid border-[#e6e9ea]">
|
|
8
|
-
<div class="flex flex-col items-start gap-[20px] relative self-stretch w-full flex-[0_0_auto]">
|
|
9
|
-
<div class="inline-flex flex-col items-start gap-[10px] relative flex-[0_0_auto]">
|
|
10
|
-
<div class="inline-flex items-center gap-[15px] relative flex-[0_0_auto]">
|
|
11
|
-
<div class="flex w-[40px] h-[40px] items-center justify-around gap-[10px] p-[10px] relative bg-[#4e31db] rounded-[30px]">
|
|
12
|
-
<div class="relative w-fit font-semibold text-white text-[16px] text-center tracking-[0] leading-[18px] whitespace-nowrap">JD</div>
|
|
13
|
-
</div>
|
|
14
|
-
<div class="inline-flex flex-col items-start gap-[10px] relative flex-[0_0_auto]">
|
|
15
|
-
<div class="relative w-fit mt-[-1.00px] font-medium text-[14px] text-center tracking-[0] leading-[18px] whitespace-nowrap">John Doe</div>
|
|
16
|
-
<div class="relative w-fit font-medium text-[#999999] text-[12px] text-center tracking-[0] leading-[18px] whitespace-nowrap">18 January 2024</div>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
<div class="flex xs_flex-col sm_flex-row items-start xs_gap-1 sm_gap-[20px] relative flex-[0_0_auto]">
|
|
20
|
-
<div class="inline-flex items-center gap-[10px] relative flex-[0_0_auto]">
|
|
21
|
-
<div class="relative w-fit font-normal text-[14px] tracking-[0] leading-[18px] whitespace-nowrap">Price</div>
|
|
22
|
-
<div class="inline-flex items-start gap-[6px] relative flex-[0_0_auto]">
|
|
23
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
24
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
25
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
26
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
27
|
-
<Star1 color='#D9D9D9' size={14} className='fill-[#D9D9D9]' />
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
<div class="inline-flex items-center gap-[10px] relative flex-[0_0_auto]">
|
|
31
|
-
<div class="relative w-[37px] font-normal text-[14px] tracking-[0] leading-[18px]">Value</div>
|
|
32
|
-
<div class="inline-flex items-start gap-[6px] relative flex-[0_0_auto]">
|
|
33
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
34
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
35
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
36
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
37
|
-
<Star1 color='#D9D9D9' size={14} className='fill-[#D9D9D9]' />
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
<div class="inline-flex items-center gap-[10px] relative flex-[0_0_auto]">
|
|
41
|
-
<div class="relative w-fit font-normal text-[14px] tracking-[0] leading-[18px] whitespace-nowrap">Quality</div>
|
|
42
|
-
<div class="inline-flex items-start gap-[6px] relative flex-[0_0_auto]">
|
|
43
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
44
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
45
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
46
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
47
|
-
<Star1 color='#D9D9D9' size={14} className='fill-[#D9D9D9]' />
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
<p class="relative self-stretch font-normal text-[14px] tracking-[0] leading-[18px]">
|
|
53
|
-
Got item at a great price. Arrived way quicker than expected, extremely well packaged and exactly as described. Highly recommend the seller.
|
|
54
|
-
</p>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
</>
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Star1 } from 'iconsax-react';
|
|
3
|
+
|
|
4
|
+
const SellerReviewItem = () => {
|
|
5
|
+
return (
|
|
6
|
+
<>
|
|
7
|
+
<div class="flex flex-col items-start gap-[10px] p-[25px] relative self-stretch w-full flex-[0_0_auto] bg-white rounded-[6px] border border-solid border-[#e6e9ea]">
|
|
8
|
+
<div class="flex flex-col items-start gap-[20px] relative self-stretch w-full flex-[0_0_auto]">
|
|
9
|
+
<div class="inline-flex flex-col items-start gap-[10px] relative flex-[0_0_auto]">
|
|
10
|
+
<div class="inline-flex items-center gap-[15px] relative flex-[0_0_auto]">
|
|
11
|
+
<div class="flex w-[40px] h-[40px] items-center justify-around gap-[10px] p-[10px] relative bg-[#4e31db] rounded-[30px]">
|
|
12
|
+
<div class="relative w-fit font-semibold text-white text-[16px] text-center tracking-[0] leading-[18px] whitespace-nowrap">JD</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="inline-flex flex-col items-start gap-[10px] relative flex-[0_0_auto]">
|
|
15
|
+
<div class="relative w-fit mt-[-1.00px] font-medium text-[14px] text-center tracking-[0] leading-[18px] whitespace-nowrap">John Doe</div>
|
|
16
|
+
<div class="relative w-fit font-medium text-[#999999] text-[12px] text-center tracking-[0] leading-[18px] whitespace-nowrap">18 January 2024</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="flex xs_flex-col sm_flex-row items-start xs_gap-1 sm_gap-[20px] relative flex-[0_0_auto]">
|
|
20
|
+
<div class="inline-flex items-center gap-[10px] relative flex-[0_0_auto]">
|
|
21
|
+
<div class="relative w-fit font-normal text-[14px] tracking-[0] leading-[18px] whitespace-nowrap">Price</div>
|
|
22
|
+
<div class="inline-flex items-start gap-[6px] relative flex-[0_0_auto]">
|
|
23
|
+
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
24
|
+
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
25
|
+
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
26
|
+
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
27
|
+
<Star1 color='#D9D9D9' size={14} className='fill-[#D9D9D9]' />
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="inline-flex items-center gap-[10px] relative flex-[0_0_auto]">
|
|
31
|
+
<div class="relative w-[37px] font-normal text-[14px] tracking-[0] leading-[18px]">Value</div>
|
|
32
|
+
<div class="inline-flex items-start gap-[6px] relative flex-[0_0_auto]">
|
|
33
|
+
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
34
|
+
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
35
|
+
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
36
|
+
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
37
|
+
<Star1 color='#D9D9D9' size={14} className='fill-[#D9D9D9]' />
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="inline-flex items-center gap-[10px] relative flex-[0_0_auto]">
|
|
41
|
+
<div class="relative w-fit font-normal text-[14px] tracking-[0] leading-[18px] whitespace-nowrap">Quality</div>
|
|
42
|
+
<div class="inline-flex items-start gap-[6px] relative flex-[0_0_auto]">
|
|
43
|
+
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
44
|
+
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
45
|
+
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
46
|
+
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
47
|
+
<Star1 color='#D9D9D9' size={14} className='fill-[#D9D9D9]' />
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
<p class="relative self-stretch font-normal text-[14px] tracking-[0] leading-[18px]">
|
|
53
|
+
Got item at a great price. Arrived way quicker than expected, extremely well packaged and exactly as described. Highly recommend the seller.
|
|
54
|
+
</p>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
61
|
export default SellerReviewItem;
|
|
@@ -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
|
+
}
|