@riosst100/pwa-marketplace 1.2.0 → 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 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": "Is required.",
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@riosst100/pwa-marketplace",
3
3
  "author": "riosst100@gmail.com",
4
- "version": "1.2.0",
4
+ "version": "1.2.1",
5
5
  "main": "src/index.js",
6
6
  "pwa-studio": {
7
7
  "targets": {
@@ -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 PhoneTextInput from '@riosst100/pwa-marketplace/src/components/PhoneTextInput';
28
27
 
29
28
  const BecomeSeller = props => {
30
29
  const talonProps = useBecomeSeller({
@@ -274,10 +273,9 @@ const BecomeSeller = props => {
274
273
  defaultMessage: 'Contact Number'
275
274
  })}
276
275
  >
277
- <PhoneTextInput
276
+ <TextInput
278
277
  id="contactNumber"
279
278
  field="seller.contact_number"
280
- countryCodeField="seller.country_id"
281
279
  validate={isRequired}
282
280
  />
283
281
  </Field>
@@ -313,17 +311,6 @@ const BecomeSeller = props => {
313
311
  ) : '';
314
312
  };
315
313
 
316
- BecomeSeller.defaultProps = {
317
- seller: {
318
- country: {
319
- code: DEFAULT_COUNTRY_CODE
320
- },
321
- region: {
322
- id: null
323
- }
324
- }
325
- };
326
-
327
314
  BecomeSeller.propTypes = {
328
315
  classes: shape({
329
316
  actions: string,
@@ -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={process.env.MAGENTO_BACKEND_URL + "/lofmarketplace/seller/login"}>
27
+ <a href={sellerDashboardUrl + "/lofmarketplace/seller/login"}>
21
28
  {formatMessage({
22
29
  id: 'sellerDashboard.title',
23
30
  defaultMessage: 'Seller Dashboard'
@@ -16,15 +16,18 @@ const PhoneTextInput = props => {
16
16
  regionError,
17
17
  field,
18
18
  message,
19
- countryCodeField,
19
+ countryCodeField = "country",
20
20
  ...rest
21
21
  } = props;
22
22
  const fieldState = useFieldState(field);
23
+ const { value: phoneValue } = fieldState;
23
24
  const classes = useStyle(defaultClasses, propClasses);
24
25
  var inputClass =
25
26
  fieldState.error || regionError ? classes.input_error : classes.input;
26
-
27
- const [value, setValue] = useState('');
27
+
28
+ const handleChange = (value) => {
29
+ fieldState.value = value;
30
+ }
28
31
 
29
32
  const countryFieldState = useFieldState(countryCodeField);
30
33
  const { value: country } = countryFieldState;
@@ -36,8 +39,10 @@ const PhoneTextInput = props => {
36
39
  international
37
40
  countryCallingCodeEditable={false}
38
41
  defaultCountry={country}
39
- value={value}
40
- onChange={setValue}/>
42
+ name={field}
43
+ value={phoneValue}
44
+ onChange={handleChange}
45
+ />
41
46
  </FieldIcons>
42
47
  <Message fieldState={fieldState}>{message}</Message>
43
48
  </Fragment>