From e10436d82baf6194946ad6ba37de9146bd849322 Mon Sep 17 00:00:00 2001 From: aulisius Date: Tue, 6 Sep 2022 08:10:23 +0530 Subject: [PATCH 1/4] PRESS4-39 Fix responsiveness for ecommerce steps --- .../Steps/Ecommerce/StepAddress/index.js | 141 ++++++++------- .../pages/Steps/Ecommerce/stylesheet.scss | 161 ++++++++++++++---- 2 files changed, 201 insertions(+), 101 deletions(-) diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js index 33c51908e..3a2da9caf 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js @@ -42,7 +42,6 @@ const StepAddress = () => { useEffect(() => { let addressKeys = [ 'woocommerce_store_address', - 'woocommerce_store_address_2', 'woocommerce_store_city', 'woocommerce_store_postcode', 'woocommerce_default_country' @@ -72,8 +71,8 @@ const StepAddress = () => { let defaultPlace = address?.woocommerce_default_country ?? settings?.woocommerce_default_country ?? - "US:AZ"; - let [defaultCountry, defaultState] = defaultPlace.split(":"); + 'US:AZ'; + let [defaultCountry, defaultState] = defaultPlace.split(':'); let selectedCountry = address?.country ?? defaultCountry; let states = countries?.find((country) => country.code === selectedCountry)?.states ?? @@ -82,10 +81,10 @@ const StepAddress = () => { let fieldName = event.target.name; let newValue = event.target.value; let { country = selectedCountry, state = defaultState } = address; - let place = ""; - if (["country", "state"].includes(fieldName)) { + let place = ''; + if (['country', 'state'].includes(fieldName)) { place = - fieldName === "country" + fieldName === 'country' ? `${newValue}:${state}` : `${country}:${newValue}`; } @@ -95,7 +94,7 @@ const StepAddress = () => { address: { ...currentData.storeDetails.address, [fieldName]: newValue, - ...(place !== "" && { + ...(place !== '' && { woocommerce_default_country: place, }), }, @@ -105,7 +104,7 @@ const StepAddress = () => { return ( -
+
{ @@ -130,90 +129,102 @@ const StepAddress = () => {
{settings === null &&

Loading your details...

}
- - -
-
- - -
-
- - -
-
- - {states.length === 0 || settings === null ? ( - + + {settings === null ? ( + ) : ( )}
- +
-
- - {settings === null ? ( - - ) : ( - - {countries.map((country) => ( - - ))} - - )} + /> +
+
+ + {states.length === 0 || settings === null ? ( + + ) : ( + + )} +
+
+ + +
+ * required