|
|
@ -6,6 +6,9 @@ import { userFactor } from "../../../redux/actions"; |
|
|
|
import Radio from "../../../components/Radio"; |
|
|
|
import Radio from "../../../components/Radio"; |
|
|
|
import Loading from "../../../components/Loading"; |
|
|
|
import Loading from "../../../components/Loading"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import editButton from "../../../assets/icons/edit.svg"; |
|
|
|
|
|
|
|
import trash from "../../../assets/icons/trash.svg"; |
|
|
|
|
|
|
|
|
|
|
|
function Address({ |
|
|
|
function Address({ |
|
|
|
addresses, |
|
|
|
addresses, |
|
|
|
isDark, |
|
|
|
isDark, |
|
|
@ -52,7 +55,7 @@ function Address({ |
|
|
|
className={`flex flex-row justify-between border border-solid items-center w-full px-3 py-6 rounded-md mt-4 transition-all duration-500 gap-10 border-opacity-30 dark:bg-opacity-5 ${ |
|
|
|
className={`flex flex-row justify-between border border-solid items-center w-full px-3 py-6 rounded-md mt-4 transition-all duration-500 gap-10 border-opacity-30 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-gray45" |
|
|
|
: "bg-[#F9F9F9] border-gray-400" |
|
|
|
}`}
|
|
|
|
}`}
|
|
|
|
onClick={() => |
|
|
|
onClick={() => |
|
|
|
userAddressId === address?.id |
|
|
|
userAddressId === address?.id |
|
|
@ -60,7 +63,7 @@ function Address({ |
|
|
|
: update({ userAddressId: address.id, userId }) |
|
|
|
: update({ userAddressId: address.id, userId }) |
|
|
|
} |
|
|
|
} |
|
|
|
> |
|
|
|
> |
|
|
|
<div className="flex flex-row flex-8 gap-4"> |
|
|
|
<div className="flex flex-row flex-1 gap-4"> |
|
|
|
{loading && userAddressId !== address?.id ? ( |
|
|
|
{loading && userAddressId !== address?.id ? ( |
|
|
|
<Loading size={2} color="bg-gray-400" /> |
|
|
|
<Loading size={2} color="bg-gray-400" /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
@ -76,7 +79,7 @@ function Address({ |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="flex flex-col flex-5"> |
|
|
|
<div className="flex flex-col "> |
|
|
|
<li className="text-right text-tiny leading-6 text-blue52 dark:text-white"> |
|
|
|
<li className="text-right text-tiny leading-6 text-blue52 dark:text-white"> |
|
|
|
نام تحویل گیرنده: {address.firstName + " " + address.lastName} |
|
|
|
نام تحویل گیرنده: {address.firstName + " " + address.lastName} |
|
|
|
</li> |
|
|
|
</li> |
|
|
@ -85,12 +88,20 @@ function Address({ |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="flex flex-col items-center gap-y-5"> |
|
|
|
<div className="flex flex-col items-center gap-y-5"> |
|
|
|
<button class="w-full text-sm cursor-pointer border border-red-200 bg-red-100 px-2 py-1 rounded-sm "> |
|
|
|
<div |
|
|
|
حذف |
|
|
|
style={{ border: "solid 1px #fca5a5" }} |
|
|
|
</button> |
|
|
|
class="w-full flex flex-row items-center justify-between px-2 py-1 rounded-sm cursor-pointer" |
|
|
|
<button class="w-full text-sm cursor-pointer border border-green-200 bg-green-100 px-2 py-1 rounded-sm "> |
|
|
|
> |
|
|
|
ویرایش |
|
|
|
<button class="text-sm">حذف</button> |
|
|
|
</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> |
|
|
|
</div> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
); |
|
|
|
); |
|
|
@ -167,3 +178,7 @@ const mapDispatchToProps = { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Address); |
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Address); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Address.defaultProps = { |
|
|
|
|
|
|
|
edit: "src/assets/icons/eidt.svg", |
|
|
|
|
|
|
|
}; |
|
|
|