diff --git a/src/app/profile-setting/page.js b/src/app/profile-setting/page.js index f8e206b..f75342b 100644 --- a/src/app/profile-setting/page.js +++ b/src/app/profile-setting/page.js @@ -34,6 +34,7 @@ function ProfileSettingsPage() { const [selectedFile, setSelectedFile] = useState(null); const [isUploading, setIsUploading] = useState(false); const [showForm, setShowForm] = useState(false); + const [isAddressesOpen, setIsAddressesOpen] = useState(false); const [currentSection, setCurrentSection] = useState('profile'); @@ -619,121 +620,267 @@ function ProfileSettingsPage() { /> -

My Delivery Addresses

- {addresses.length > 0 ? ( - addresses.map((address, index) => ( -
-

Address {index + 1}

- - { - handleAddressChange(index, 'full_name', e.target.value); - setIsEditing(true); - }} - style={{ display: 'block', marginBottom: '10px', padding: '10px', borderRadius: '8px', border: '1px solid #D1D5DB' }} - /> - - { - handleAddressChange(index, 'street_address', e.target.value); - setIsEditing(true); - }} - style={{ display: 'block', marginBottom: '10px', padding: '10px', borderRadius: '8px', border: '1px solid #D1D5DB' }} - /> - - { - handleAddressChange(index, 'street_address_2', e.target.value); - setIsEditing(true); - }} - style={{ display: 'block', marginBottom: '10px', padding: '10px', borderRadius: '8px', border: '1px solid #D1D5DB' }} - /> - - { - handleAddressChange(index, 'city', e.target.value); - setIsEditing(true); - }} - style={{ display: 'block', marginBottom: '10px', padding: '10px', borderRadius: '8px', border: '1px solid #D1D5DB' }} - /> - - { - handleAddressChange(index, 'pincode', e.target.value); - setIsEditing(true); - }} - style={{ display: 'block', marginBottom: '10px', padding: '10px', borderRadius: '8px', border: '1px solid #D1D5DB' }} - /> - - { - handleAddressChange(index, 'country', e.target.value); - setIsEditing(true); - }} - style={{ display: 'block', marginBottom: '10px', padding: '10px', borderRadius: '8px', border: '1px solid #D1D5DB' }} - /> - -
- )) - ) : ( -

No addresses available. Please add a delivery address.

- )} - {addresses.length > 0 ? ( - - ) : ( - - )} +
+ + +
+ {addresses.length > 0 ? ( + addresses.map((address, index) => ( +
+

+ Address {index + 1} +

+ + { + handleAddressChange( + index, + "full_name", + e.target.value + ); + setIsEditing(true); + }} + style={{ + display: "block", + marginBottom: "10px", + padding: "10px", + borderRadius: "8px", + border: "1px solid #D1D5DB", + }} + /> + + { + handleAddressChange( + index, + "street_address", + e.target.value + ); + setIsEditing(true); + }} + style={{ + display: "block", + marginBottom: "10px", + padding: "10px", + borderRadius: "8px", + border: "1px solid #D1D5DB", + }} + /> + + { + handleAddressChange( + index, + "street_address_2", + e.target.value + ); + setIsEditing(true); + }} + style={{ + display: "block", + marginBottom: "10px", + padding: "10px", + borderRadius: "8px", + border: "1px solid #D1D5DB", + }} + /> + + { + handleAddressChange( + index, + "city", + e.target.value + ); + setIsEditing(true); + }} + style={{ + display: "block", + marginBottom: "10px", + padding: "10px", + borderRadius: "8px", + border: "1px solid #D1D5DB", + }} + /> + + { + handleAddressChange( + index, + "pincode", + e.target.value + ); + setIsEditing(true); + }} + style={{ + display: "block", + marginBottom: "10px", + padding: "10px", + borderRadius: "8px", + border: "1px solid #D1D5DB", + }} + /> + + { + handleAddressChange( + index, + "country", + e.target.value + ); + setIsEditing(true); + }} + style={{ + display: "block", + marginBottom: "10px", + padding: "10px", + borderRadius: "8px", + border: "1px solid #D1D5DB", + }} + /> + +
+ )) + ) : ( +

+ No addresses available. Please add a delivery address. +

+ )} + {addresses.length > 0 ? ( + + ) : ( + + )} +
+
@@ -743,7 +890,7 @@ function ProfileSettingsPage() { onClick={handleSave} style={{ backgroundColor: '#7D4AB5', - color: '#ffffff', + color: "#30D8FF", padding: '10px 20px', borderRadius: '8px', cursor: 'pointer',