update address

This commit is contained in:
hamid zarghami
2026-06-06 11:48:22 +03:30
parent 347017f1be
commit 931cc76a47
7 changed files with 70 additions and 20 deletions
@@ -72,6 +72,11 @@ function UserAddressesPage({ }: Props) {
return `${address.address}، ${address.city}، ${address.province}`;
};
const getEditHref = (addressId: string) => {
const base = `address/new?id=${addressId}`;
return redirect ? `${base}&redirect=${encodeURIComponent(redirect)}` : base;
};
return (
<div className='overflow-y-auto h-full noscrollbar flex flex-col'>
<div className='grid grid-cols-3 items-center'>
@@ -134,7 +139,7 @@ function UserAddressesPage({ }: Props) {
</Button>
)}
<div className="flex gap-2">
<Link href={`address/new?id=${address.id}`}>
<Link href={getEditHref(address.id)}>
<Button className='bg-background! text-foreground! flex justify-center items-center gap-2 text-xs p-0! size-8!'>
<Edit2 className='stroke-foreground size-5 mb-0.5' />
</Button>