diff --git a/src/app/[name]/(Dialogs)/cart/page.tsx b/src/app/[name]/(Dialogs)/cart/page.tsx index ccf6c51..03da35f 100644 --- a/src/app/[name]/(Dialogs)/cart/page.tsx +++ b/src/app/[name]/(Dialogs)/cart/page.tsx @@ -5,6 +5,7 @@ import { useReceiptStore } from '@/zustand/receiptStore'; import { motion } from 'framer-motion'; import { ArrowLeft, Trash } from 'iconsax-react'; import { PlusIcon, MinusIcon } from 'lucide-react'; +import Link from 'next/link'; import { useRouter } from 'next/navigation'; import React from 'react' import { useTranslation } from 'react-i18next'; @@ -114,9 +115,12 @@ const CartIndex = ({ }: Props) => {
{address} diff --git a/src/app/[name]/(Profile)/profile/address/page.tsx b/src/app/[name]/(Profile)/profile/address/page.tsx index 9b5e393..6513a31 100644 --- a/src/app/[name]/(Profile)/profile/address/page.tsx +++ b/src/app/[name]/(Profile)/profile/address/page.tsx @@ -6,13 +6,21 @@ import { ef } from '@/lib/helpers/utfNumbers'; // import { useAuthStore } from '@/zustand/authStore'; import { ArrowLeft, Edit2, TickCircle } from 'iconsax-react'; import Link from 'next/link'; -import { useRouter } from 'next/navigation'; +import { useRouter, useSearchParams } from 'next/navigation'; import React from 'react' type Props = object function UserAddressesPage({ }: Props) { const router = useRouter(); + const searchParams = useSearchParams(); + const redirect = searchParams.get('redirect'); + + const onSelected = () => { + if(redirect) { + router.replace(redirect); + } + } return (