@riosst100/pwa-marketplace 1.0.4 → 1.0.6
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/components/BecomeSeller/becomeSeller.js +20 -4
- package/src/components/SellerAccountPage/sellerAccountPage.js +0 -26
- package/src/overwrites/peregrine/lib/talons/AccountMenu/useAccountMenuItems.js +16 -7
- package/src/overwrites/peregrine/lib/talons/SignIn/useSignIn.js +3 -1
package/package.json
CHANGED
|
@@ -22,6 +22,8 @@ import GoogleRecaptcha from '@magento/venia-ui/lib/components/GoogleReCaptcha';
|
|
|
22
22
|
import Country from '@magento/venia-ui/lib/components/Country';
|
|
23
23
|
import Region from '@magento/venia-ui/lib/components/Region';
|
|
24
24
|
import Postcode from '@magento/venia-ui/lib/components/Postcode';
|
|
25
|
+
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
26
|
+
import { Link } from 'react-router-dom';
|
|
25
27
|
|
|
26
28
|
const BecomeSeller = props => {
|
|
27
29
|
const talonProps = useBecomeSeller({
|
|
@@ -285,10 +287,24 @@ const BecomeSeller = props => {
|
|
|
285
287
|
<Checkbox
|
|
286
288
|
field="become_seller_agreement"
|
|
287
289
|
id="becomeSellerAgreement"
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
290
|
+
validate={isRequired}
|
|
291
|
+
label={(
|
|
292
|
+
<>
|
|
293
|
+
{formatMessage({
|
|
294
|
+
id: 'becomeSeller.becomeSellerAgreementText',
|
|
295
|
+
defaultMessage: 'I agree the Terms and Condition'
|
|
296
|
+
})} <span>
|
|
297
|
+
(<a href={'/seller-term-conditions'}>
|
|
298
|
+
<u>
|
|
299
|
+
{formatMessage({
|
|
300
|
+
id: 'becomeSellerPage.termConditions',
|
|
301
|
+
defaultMessage: 'Terms and Conditions'
|
|
302
|
+
})}
|
|
303
|
+
</u>
|
|
304
|
+
</a>)
|
|
305
|
+
</span>
|
|
306
|
+
</>
|
|
307
|
+
)}
|
|
292
308
|
/>
|
|
293
309
|
</div>
|
|
294
310
|
<GoogleRecaptcha {...recaptchaWidgetProps} />
|
|
@@ -40,30 +40,6 @@ const SellerAccountPage = props => {
|
|
|
40
40
|
const customerName = `${customer.firstname} ${customer.lastname}`;
|
|
41
41
|
const passwordValue = 'Same as current';
|
|
42
42
|
|
|
43
|
-
sellerAccountDetails = (
|
|
44
|
-
<Fragment>
|
|
45
|
-
<div className={classes.accountDetails}>
|
|
46
|
-
<span className={classes.nameLabel}>
|
|
47
|
-
<FormattedMessage
|
|
48
|
-
id={'global.sellerAccountDetailsText'}
|
|
49
|
-
defaultMessage={'Seller Account Details'}
|
|
50
|
-
/>
|
|
51
|
-
</span>
|
|
52
|
-
<div className={classes.lineItemsContainer}>
|
|
53
|
-
<span className={classes.nameLabel}>
|
|
54
|
-
<FormattedMessage
|
|
55
|
-
id={'global.status'}
|
|
56
|
-
defaultMessage={'Status'}
|
|
57
|
-
/>
|
|
58
|
-
</span>
|
|
59
|
-
<span className={classes.nameValue}>
|
|
60
|
-
Not Verified
|
|
61
|
-
</span>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</Fragment>
|
|
65
|
-
);
|
|
66
|
-
|
|
67
43
|
sellerLoginAccount = (
|
|
68
44
|
<Fragment>
|
|
69
45
|
<div className={classes.accountDetails}>
|
|
@@ -116,8 +92,6 @@ const SellerAccountPage = props => {
|
|
|
116
92
|
defaultMessage: 'Seller Account'
|
|
117
93
|
})}
|
|
118
94
|
</StoreTitle>
|
|
119
|
-
{sellerAccountDetails}
|
|
120
|
-
<br />
|
|
121
95
|
{sellerLoginAccount}
|
|
122
96
|
</div>
|
|
123
97
|
)
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
1
|
+
import { useCallback, useEffect } from 'react';
|
|
2
|
+
import { BrowserPersistence } from '@magento/peregrine/lib/util';
|
|
3
|
+
|
|
4
|
+
const storage = new BrowserPersistence();
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
* @param {Object} props
|
|
@@ -14,12 +17,7 @@ export const useAccountMenuItems = props => {
|
|
|
14
17
|
onSignOut();
|
|
15
18
|
}, [onSignOut]);
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
name: 'Seller Account Information',
|
|
20
|
-
id: 'accountMenu.sellerAccountInfoLink',
|
|
21
|
-
url: '/seller-account'
|
|
22
|
-
},
|
|
20
|
+
let MENU_ITEMS = [
|
|
23
21
|
{
|
|
24
22
|
name: 'Order History',
|
|
25
23
|
id: 'accountMenu.orderHistoryLink',
|
|
@@ -57,6 +55,17 @@ export const useAccountMenuItems = props => {
|
|
|
57
55
|
url: '/account-information'
|
|
58
56
|
}
|
|
59
57
|
];
|
|
58
|
+
|
|
59
|
+
if (storage && storage.getItem('is_seller')) {
|
|
60
|
+
MENU_ITEMS = [
|
|
61
|
+
...MENU_ITEMS,
|
|
62
|
+
{
|
|
63
|
+
name: 'Seller Account Information',
|
|
64
|
+
id: 'accountMenu.sellerAccountInfoLink',
|
|
65
|
+
url: '/seller-account'
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
}
|
|
60
69
|
|
|
61
70
|
return {
|
|
62
71
|
handleSignOut,
|
|
@@ -90,6 +90,8 @@ export const useSignIn = props => {
|
|
|
90
90
|
const token = signInResponse.data.generateCustomerToken.token;
|
|
91
91
|
await setToken(token);
|
|
92
92
|
|
|
93
|
+
await getUserDetails({ fetchUserDetails });
|
|
94
|
+
|
|
93
95
|
// Clear all cart/customer data from cache and redux.
|
|
94
96
|
await apolloClient.clearCacheData(apolloClient, 'cart');
|
|
95
97
|
await apolloClient.clearCacheData(apolloClient, 'customer');
|
|
@@ -111,7 +113,7 @@ export const useSignIn = props => {
|
|
|
111
113
|
|
|
112
114
|
// Ensure old stores are updated with any new data.
|
|
113
115
|
|
|
114
|
-
|
|
116
|
+
|
|
115
117
|
|
|
116
118
|
const { data } = await fetchUserDetails({
|
|
117
119
|
fetchPolicy: 'cache-only'
|