|
|
@ -22,7 +22,7 @@ function Address({ |
|
|
|
const Location = ({ address, active }) => { |
|
|
|
const Location = ({ address, active }) => { |
|
|
|
return isMobile ? ( |
|
|
|
return isMobile ? ( |
|
|
|
<button |
|
|
|
<button |
|
|
|
className={`flex flex-row border-2 border-solid items-center w-full px-3 py-2 rounded-md mt-2 transition-all duration-500 dark:bg-opacity-5 ${ |
|
|
|
className={`flex flex-col border-2 border-solid items-center w-full px-3 py-2 rounded-md mt-2 transition-all duration-500 dark:bg-opacity-5 ${ |
|
|
|
userAddressId === address?.id |
|
|
|
userAddressId === address?.id |
|
|
|
? "bg-blueC0 bg-opacity-5 border-blueC0" |
|
|
|
? "bg-blueC0 bg-opacity-5 border-blueC0" |
|
|
|
: "bg-grayF9 border-gray-200 dark:border-gray-500" |
|
|
|
: "bg-grayF9 border-gray-200 dark:border-gray-500" |
|
|
@ -33,6 +33,7 @@ function Address({ |
|
|
|
: update({ userAddressId: address.id, userId }) |
|
|
|
: update({ userAddressId: address.id, userId }) |
|
|
|
} |
|
|
|
} |
|
|
|
> |
|
|
|
> |
|
|
|
|
|
|
|
<div className="flex items-center"> |
|
|
|
{loading && userAddressId !== address?.id ? ( |
|
|
|
{loading && userAddressId !== address?.id ? ( |
|
|
|
<Loading size={2} color="bg-gray-400" /> |
|
|
|
<Loading size={2} color="bg-gray-400" /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
@ -49,6 +50,24 @@ function Address({ |
|
|
|
{address.address} |
|
|
|
{address.address} |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
{/* edit / delete button */} |
|
|
|
|
|
|
|
<div className="flex items-center gap-x-4 mt-4"> |
|
|
|
|
|
|
|
<div |
|
|
|
|
|
|
|
style={{ border: "solid 1px #fca5a5" }} |
|
|
|
|
|
|
|
class="w-full flex flex-row items-center justify-between px-2 py-1 rounded-sm cursor-pointer" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<button class="text-sm">حذف</button> |
|
|
|
|
|
|
|
<img src={trash} alt="delete-address" className="w-5 mr-3" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div |
|
|
|
|
|
|
|
style={{ border: "solid 1px #12CF7F" }} |
|
|
|
|
|
|
|
class="w-full flex flex-row items-center justify-between px-2 py-1 rounded-sm cursor-pointer" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<button class="text-sm">ویرایش</button> |
|
|
|
|
|
|
|
<img src={editButton} alt="edit-address" className="w-5 mr-3 " /> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<button |
|
|
|
<button |
|
|
|