diff --git a/apps/web/components/navigation/bottom-nav/nav-button.tsx b/apps/web/components/navigation/bottom-nav/nav-button.tsx index 73ed3d8..e8dbd99 100644 --- a/apps/web/components/navigation/bottom-nav/nav-button.tsx +++ b/apps/web/components/navigation/bottom-nav/nav-button.tsx @@ -27,7 +27,7 @@ export function NavButton({ disabled, href, icon, label }: NavButtonProps) { {label} ) : ( - + {icon} {label} diff --git a/apps/web/components/orders/order-form/result.tsx b/apps/web/components/orders/order-form/result.tsx index 9f09837..feb5051 100644 --- a/apps/web/components/orders/order-form/result.tsx +++ b/apps/web/components/orders/order-form/result.tsx @@ -3,8 +3,8 @@ import { useOrderStore } from '@/stores/order'; import { Button } from '@repo/ui/components/ui/button'; import { Card, CardContent } from '@repo/ui/components/ui/card'; -import { AlertCircle, CheckCircle2, Home, RefreshCw } from 'lucide-react'; -import Link from 'next/link'; +import { AlertCircle, CheckCircle2, RefreshCw } from 'lucide-react'; +import { useRouter, useSearchParams } from 'next/navigation'; export function ErrorPage() { const setStep = useOrderStore((store) => store.setStep); @@ -35,6 +35,19 @@ export function ErrorPage() { } export function SuccessPage() { + const router = useRouter(); + const from = useSearchParams().get('from'); + + const handleBack = () => { + if (from === 'bottom-nav') { + router.push('/'); + } else if (window.history.length > 1) { + router.back(); + } else { + router.push('/'); + } + }; + return (
Запись успешно создана