From 77bbe260390cecd6132317bd9348afc88fc521a8 Mon Sep 17 00:00:00 2001 From: I Nyoman Jyotisa Date: Tue, 20 Aug 2024 21:00:26 +0800 Subject: [PATCH] separate address line 1 and address line 2 --- src/pages/AddressPage.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/AddressPage.tsx b/src/pages/AddressPage.tsx index 54fb9d053df2..efd924270bea 100644 --- a/src/pages/AddressPage.tsx +++ b/src/pages/AddressPage.tsx @@ -29,7 +29,8 @@ function AddressPage({title, address, updateAddress, isLoadingApp = true}: Addre const {translate} = useLocalize(); // Check if country is valid - const {street, street2} = address ?? {}; + const {street} = address ?? {}; + const [street1, street2] = street ? street.split('\n') : [undefined, undefined]; const [currentCountry, setCurrentCountry] = useState(address?.country); const [state, setState] = useState(address?.state); const [city, setCity] = useState(address?.city); @@ -95,7 +96,7 @@ function AddressPage({title, address, updateAddress, isLoadingApp = true}: Addre country={currentCountry} onAddressChanged={handleAddressChange} state={state} - street1={street} + street1={street1} street2={street2} zip={zipcode} />