added validation order
This commit is contained in:
@@ -386,7 +386,9 @@ const OrderPage = () => {
|
||||
length > 300 &&
|
||||
'border-red-500 focus-visible:border-red-500 focus-visible:ring-none focus-visible:outline-0',
|
||||
)}
|
||||
placeholder={t('Izoh')}
|
||||
placeholder={t(
|
||||
'Izoh 300 ta belgidan oshmasligi kerak',
|
||||
)}
|
||||
/>
|
||||
</FormControl>
|
||||
|
||||
@@ -402,7 +404,7 @@ const OrderPage = () => {
|
||||
</div>
|
||||
{comment.length > 300 && (
|
||||
<p className="text-red-500 text-md">
|
||||
{t('Izoh 300 belgidan oshmasligi kerak')}
|
||||
{t('Izoh 300 ta belgidan oshmasligi kerak')}
|
||||
</p>
|
||||
)}
|
||||
</FormItem>
|
||||
|
||||
@@ -374,7 +374,7 @@ const RefreshOrder = () => {
|
||||
<p className="text-gray-500 mb-6">
|
||||
{t("Ushbu buyurtma mavjud emas yoki o'chirilgan")}
|
||||
</p>
|
||||
<Button onClick={() => (window.location.href = '/profile/history')}>
|
||||
<Button onClick={() => (window.location.href = '/profile')}>
|
||||
{t('Buyurtmalar tarixiga qaytish')}
|
||||
</Button>
|
||||
</div>
|
||||
@@ -448,7 +448,9 @@ const RefreshOrder = () => {
|
||||
comment.length > 300 &&
|
||||
'border-red-500 focus-visible:border-red-500 focus-visible:ring-none focus-visible:outline-0',
|
||||
)}
|
||||
placeholder={t('Izoh')}
|
||||
placeholder={t(
|
||||
'Izoh 300 ta belgidan oshmasligi kerak',
|
||||
)}
|
||||
/>
|
||||
</FormControl>
|
||||
<div
|
||||
@@ -463,7 +465,7 @@ const RefreshOrder = () => {
|
||||
</div>
|
||||
{comment.length > 300 && (
|
||||
<p className="text-red-500 text-md">
|
||||
{t('Izoh 300 belgidan oshmasligi kerak')}
|
||||
{t('Izoh 300 ta belgidan oshmasligi kerak')}
|
||||
</p>
|
||||
)}
|
||||
</FormItem>
|
||||
|
||||
@@ -10,7 +10,12 @@ import {
|
||||
} from '@/shared/ui/dropdown-menu';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import Image from 'next/image';
|
||||
import { useParams, usePathname, useRouter } from 'next/navigation';
|
||||
import {
|
||||
useParams,
|
||||
usePathname,
|
||||
useRouter,
|
||||
useSearchParams,
|
||||
} from 'next/navigation';
|
||||
import { languages } from '../lib/data';
|
||||
|
||||
export function ChangeLang() {
|
||||
@@ -18,12 +23,16 @@ export function ChangeLang() {
|
||||
const pathname = usePathname();
|
||||
const router = useRouter();
|
||||
const t = useTranslations();
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
const changeLocale = (locale: LanguageRoutes) => {
|
||||
const segments = pathname.split('/');
|
||||
segments[1] = locale;
|
||||
|
||||
const newPath = segments.join('/');
|
||||
router.push(newPath);
|
||||
const query = searchParams.toString();
|
||||
|
||||
router.push(query ? `${newPath}?${query}` : newPath);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user