@riosst100/pwa-marketplace 1.1.9 → 1.2.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/i18n/id_ID.json +1 -1
- package/package.json +1 -1
- package/src/components/BecomeSeller/becomeSeller.js +1 -2
- package/src/components/BecomeSellerLink/becomeSellerLink.js +8 -1
- package/src/components/PhoneTextInput/index.js +1 -0
- package/src/components/{PhoneInput/phoneInput.js → PhoneTextInput/phoneTextInput.js} +20 -10
- package/src/components/SellerCountry/sellerCountry.js +6 -0
- package/src/overwrites/peregrine/lib/talons/SignIn/useSignIn.js +0 -2
- package/src/talons/Header/useWebsiteSwitcher.js +0 -1
- package/src/talons/WebsiteByIp/useWebsiteByIp.js +0 -1
- package/src/components/PhoneInput/index.js +0 -1
- /package/src/components/{PhoneInput/phoneInput.module.css → PhoneTextInput/phoneTextInput.module.css} +0 -0
package/i18n/id_ID.json
CHANGED
|
@@ -451,7 +451,7 @@
|
|
|
451
451
|
"validation.invalidRegions": "Country \"{value}\" does not contain any available regions.",
|
|
452
452
|
"validation.isEqualToField": "{value} must match.",
|
|
453
453
|
"validation.isNotEqualToField": "{value} must be different",
|
|
454
|
-
"validation.isRequired": "
|
|
454
|
+
"validation.isRequired": "This is required field.",
|
|
455
455
|
"validation.mustBeChecked": "Must be checked.",
|
|
456
456
|
"validation.validatePassword": "A password must contain at least 3 of the following: lowercase, uppercase, digits, special characters.",
|
|
457
457
|
"wishlist.name": "Wish List",
|
package/package.json
CHANGED
|
@@ -24,7 +24,6 @@ import Region from '@magento/venia-ui/lib/components/Region';
|
|
|
24
24
|
import Postcode from '@magento/venia-ui/lib/components/Postcode';
|
|
25
25
|
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
26
26
|
import { Link } from 'react-router-dom';
|
|
27
|
-
import PhoneInput from '@riosst100/pwa-marketplace/src/components/PhoneInput';
|
|
28
27
|
|
|
29
28
|
const BecomeSeller = props => {
|
|
30
29
|
const talonProps = useBecomeSeller({
|
|
@@ -274,7 +273,7 @@ const BecomeSeller = props => {
|
|
|
274
273
|
defaultMessage: 'Contact Number'
|
|
275
274
|
})}
|
|
276
275
|
>
|
|
277
|
-
<
|
|
276
|
+
<TextInput
|
|
278
277
|
id="contactNumber"
|
|
279
278
|
field="seller.contact_number"
|
|
280
279
|
validate={isRequired}
|
|
@@ -7,6 +7,10 @@ import { shape, string } from 'prop-types';
|
|
|
7
7
|
import { useIntl } from 'react-intl';
|
|
8
8
|
import { useBecomeSellerLink } from '@riosst100/pwa-marketplace/src/talons/BecomeSellerLink/useBecomeSellerLink';
|
|
9
9
|
|
|
10
|
+
import { BrowserPersistence } from '@magento/peregrine/lib/util';
|
|
11
|
+
|
|
12
|
+
const storage = new BrowserPersistence();
|
|
13
|
+
|
|
10
14
|
const BecomeSellerLink = props => {
|
|
11
15
|
const classes = useStyle(defaultClasses, props.classes);
|
|
12
16
|
const { formatMessage } = useIntl();
|
|
@@ -15,9 +19,12 @@ const BecomeSellerLink = props => {
|
|
|
15
19
|
isSeller
|
|
16
20
|
} = useBecomeSellerLink(props);
|
|
17
21
|
|
|
22
|
+
const websiteCountry = storage.getItem('website_code') && storage.getItem('website_code') != "base" ? '/' + storage.getItem('website_code') : '';
|
|
23
|
+
const sellerDashboardUrl = process.env.MAGENTO_BACKEND_URL ? process.env.MAGENTO_BACKEND_URL + websiteCountry : '';
|
|
24
|
+
|
|
18
25
|
return isSeller ? (
|
|
19
26
|
<div className={classes.root} data-cy="BecomeSellerLink-root">
|
|
20
|
-
<a href={
|
|
27
|
+
<a href={sellerDashboardUrl + "/lofmarketplace/seller/login"}>
|
|
21
28
|
{formatMessage({
|
|
22
29
|
id: 'sellerDashboard.title',
|
|
23
30
|
defaultMessage: 'Seller Dashboard'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './phoneTextInput';
|
|
@@ -4,10 +4,11 @@ import useFieldState from '@magento/peregrine/lib/hooks/hook-wrappers/useInforme
|
|
|
4
4
|
|
|
5
5
|
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
6
6
|
import { FieldIcons, Message } from '@magento/venia-ui/lib/components/Field';
|
|
7
|
-
import defaultClasses from './
|
|
8
|
-
import
|
|
7
|
+
import defaultClasses from './phoneTextInput.module.css';
|
|
8
|
+
import PhoneInput from 'react-phone-number-input'
|
|
9
|
+
import 'react-phone-number-input/style.css'
|
|
9
10
|
|
|
10
|
-
const
|
|
11
|
+
const PhoneTextInput = props => {
|
|
11
12
|
const {
|
|
12
13
|
after,
|
|
13
14
|
before,
|
|
@@ -15,33 +16,42 @@ const PhoneInput = props => {
|
|
|
15
16
|
regionError,
|
|
16
17
|
field,
|
|
17
18
|
message,
|
|
19
|
+
countryCodeField = "country",
|
|
18
20
|
...rest
|
|
19
21
|
} = props;
|
|
20
22
|
const fieldState = useFieldState(field);
|
|
23
|
+
const { value: phoneValue } = fieldState;
|
|
21
24
|
const classes = useStyle(defaultClasses, propClasses);
|
|
22
25
|
var inputClass =
|
|
23
26
|
fieldState.error || regionError ? classes.input_error : classes.input;
|
|
27
|
+
|
|
28
|
+
const handleChange = (value) => {
|
|
29
|
+
fieldState.value = value;
|
|
30
|
+
}
|
|
24
31
|
|
|
25
|
-
const
|
|
32
|
+
const countryFieldState = useFieldState(countryCodeField);
|
|
33
|
+
const { value: country } = countryFieldState;
|
|
26
34
|
|
|
27
35
|
return (
|
|
28
36
|
<Fragment>
|
|
29
37
|
<FieldIcons after={after} before={before}>
|
|
30
|
-
<
|
|
38
|
+
<PhoneInput
|
|
31
39
|
international
|
|
32
40
|
countryCallingCodeEditable={false}
|
|
33
|
-
defaultCountry=
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
defaultCountry={country}
|
|
42
|
+
name={field}
|
|
43
|
+
value={phoneValue}
|
|
44
|
+
onChange={handleChange}
|
|
45
|
+
/>
|
|
36
46
|
</FieldIcons>
|
|
37
47
|
<Message fieldState={fieldState}>{message}</Message>
|
|
38
48
|
</Fragment>
|
|
39
49
|
);
|
|
40
50
|
};
|
|
41
51
|
|
|
42
|
-
export default
|
|
52
|
+
export default PhoneTextInput;
|
|
43
53
|
|
|
44
|
-
|
|
54
|
+
PhoneTextInput.propTypes = {
|
|
45
55
|
after: node,
|
|
46
56
|
before: node,
|
|
47
57
|
classes: shape({
|
|
@@ -8,6 +8,9 @@ import Field from '@magento/venia-ui/lib/components/Field';
|
|
|
8
8
|
import Select from '@magento/venia-ui/lib/components/Select';
|
|
9
9
|
import defaultClasses from './sellerCountry.module.css';
|
|
10
10
|
import { GET_SELLER_COUNTRIES_QUERY } from './sellerCountry.gql';
|
|
11
|
+
import { BrowserPersistence } from '@magento/peregrine/lib/util';
|
|
12
|
+
|
|
13
|
+
const storage = new BrowserPersistence();
|
|
11
14
|
|
|
12
15
|
const SellerCountry = props => {
|
|
13
16
|
const talonProps = useSellerCountry({
|
|
@@ -26,11 +29,14 @@ const SellerCountry = props => {
|
|
|
26
29
|
const { formatMessage } = useIntl();
|
|
27
30
|
|
|
28
31
|
const classes = useStyle(defaultClasses, propClasses);
|
|
32
|
+
const websiteCode = storage.getItem('website_code') || null;
|
|
33
|
+
const currentWebsiteCountry = websiteCode && websiteCode != "base" ? websiteCode.toUpperCase() : DEFAULT_COUNTRY_CODE;
|
|
29
34
|
const selectProps = {
|
|
30
35
|
classes,
|
|
31
36
|
disabled: loading,
|
|
32
37
|
field,
|
|
33
38
|
items: countries,
|
|
39
|
+
initialValue: currentWebsiteCountry,
|
|
34
40
|
...inputProps
|
|
35
41
|
};
|
|
36
42
|
|
|
@@ -108,7 +108,6 @@ export const useWebsiteSwitcher = (props = {}) => {
|
|
|
108
108
|
|
|
109
109
|
// availableStores => mapped options or empty map if undefined.
|
|
110
110
|
const availableStores = useMemo(() => {
|
|
111
|
-
console.log(availableStoresData)
|
|
112
111
|
return (
|
|
113
112
|
(storeConfigData &&
|
|
114
113
|
availableStoresData &&
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './phoneInput';
|
|
File without changes
|