update address
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user