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