|
|
|
@ -32,6 +32,20 @@ const ProfileAddress = ({ |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div className={`flex-1 ${isMobile ? "" : "w-1/2"} mx-auto`}> |
|
|
|
|
<div className="w-full flex flex-row justify-between items-center mt-4"> |
|
|
|
|
<button |
|
|
|
|
className={`flex justify-center text-tiny lg:text-sm rounded-md py-3 bg-grayF9 dark:bg-blueC0 dark:bg-opacity-30 cursor:pointer ${ |
|
|
|
|
isDark ? "text-white" : "text-gray70" |
|
|
|
|
} items-center w-full`}
|
|
|
|
|
onClick={() => navigation("/createAddress")} |
|
|
|
|
style={{ |
|
|
|
|
border: `1px solid ${isDark ? "#DBDBDB22" : "#DBDBDB"}`, |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
یک آدرس جدید اضافه کنید |
|
|
|
|
<strong className="text-lg transform translate-y-0.5 mr-1">+</strong> |
|
|
|
|
</button> |
|
|
|
|
</div> |
|
|
|
|
<div className={`p-0 m-0 flex flex-col mb-4`}> |
|
|
|
|
{addresses.map((address, index) => ( |
|
|
|
|
<Location |
|
|
|
@ -44,36 +58,13 @@ const ProfileAddress = ({ |
|
|
|
|
/> |
|
|
|
|
))} |
|
|
|
|
</div> |
|
|
|
|
{/* <FloatingButton |
|
|
|
|
action={() => navigation("/createAddress", { state: { panel: true } })} |
|
|
|
|
// action={() => {}}
|
|
|
|
|
position={{ right: isMobile ? "" : 350, bottom: 50 }} |
|
|
|
|
/> */} |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
/* <div className="w-full flex flex-row justify-between items-center mt-4"> |
|
|
|
|
<button |
|
|
|
|
className={`flex justify-center text-tiny lg:text-sm rounded-md py-3 bg-grayF9 dark:bg-blueC0 dark:bg-opacity-30 cursor:pointer ${ |
|
|
|
|
isDark ? "text-white" : "text-gray70" |
|
|
|
|
} items-center w-full`}
|
|
|
|
|
action={() => navigation("/createAddress")} |
|
|
|
|
style={{ |
|
|
|
|
border: `1px solid ${isDark ? "#DBDBDB22" : "#DBDBDB"}`, |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
یک آدرس جدید اضافه کنید |
|
|
|
|
<strong className="text-lg transform translate-y-0.5 mr-1">+</strong> |
|
|
|
|
</button> |
|
|
|
|
</div> */ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const Location = ({ address, active, userId, isDark, update }) => { |
|
|
|
|
return ( |
|
|
|
|
<> |
|
|
|
|
{/* */} |
|
|
|
|
<div |
|
|
|
|
className={`flex items-center w-full px-3 py-4 rounded-md my-4 border-2 border-solid ${ |
|
|
|
|
active |
|
|
|
@ -84,7 +75,7 @@ const Location = ({ address, active, userId, isDark, update }) => { |
|
|
|
|
active ? {} : update({ userAddressId: address.id, userId }) |
|
|
|
|
} |
|
|
|
|
> |
|
|
|
|
<div className="flex flex-1 flex-col mr-2"> |
|
|
|
|
<div className="flex flex-1 flex-col mr-2"> |
|
|
|
|
{active && ( |
|
|
|
|
<div className="w-full flex justify-between mb-3"> |
|
|
|
|
<div className="flex items-center"> |
|
|
|
|