bug fix
This commit is contained in:
7350
package-lock.json
generated
Normal file
7350
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,8 +2,8 @@
|
||||
|
||||
import { DashboardLayout } from "@/widgets/dashboard-layout/ui/DashboardLayout";
|
||||
import L from "leaflet";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useSearchParams } from "react-router-dom";
|
||||
|
||||
interface RouteData {
|
||||
distance: string;
|
||||
@@ -25,7 +25,7 @@ interface LeafletRoutingControl extends L.Control {
|
||||
}
|
||||
|
||||
const ObjectMapPage = () => {
|
||||
const searchParams = useSearchParams();
|
||||
const [searchParams] = useSearchParams();
|
||||
|
||||
const lat = parseFloat(searchParams.get("lat") || "0");
|
||||
const lon = parseFloat(searchParams.get("lon") || "0");
|
||||
@@ -121,9 +121,7 @@ const ObjectMapPage = () => {
|
||||
const L = (await import("leaflet")).default;
|
||||
await import("leaflet/dist/leaflet.css");
|
||||
await import("leaflet-routing-machine");
|
||||
await import(
|
||||
"leaflet-routing-machine/dist/leaflet-routing-machine.css"
|
||||
);
|
||||
await import("leaflet-routing-machine/dist/leaflet-routing-machine.css");
|
||||
|
||||
// Xaritani yaratish
|
||||
if (!mapInstance.current) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { DataTable } from "@/features/doctor/lib/data-table";
|
||||
import type { TourItem } from "@/features/tour-plan/lib/types";
|
||||
import {
|
||||
Select,
|
||||
@@ -10,15 +11,9 @@ import {
|
||||
SelectValue,
|
||||
} from "@/shared/ui/select";
|
||||
import { DashboardLayout } from "@/widgets/dashboard-layout/ui";
|
||||
import dynamic from "next/dynamic";
|
||||
import { useMemo, useState } from "react";
|
||||
import { getColumns } from "../lib/column";
|
||||
|
||||
const DataTable = dynamic(
|
||||
() => import("../lib/data-table").then((mod) => mod.DataTable),
|
||||
{ ssr: false },
|
||||
);
|
||||
|
||||
const mockTourData: TourItem[] = [
|
||||
{
|
||||
id: 1,
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { Inter } from "next/font/google";
|
||||
|
||||
const inter = Inter({
|
||||
weight: ["400", "500", "600", "700"],
|
||||
variable: "--font-inter",
|
||||
subsets: ["latin"],
|
||||
});
|
||||
|
||||
export { inter };
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { createNavigation } from "next-intl/navigation";
|
||||
import { routing } from "./routing";
|
||||
|
||||
// Lightweight wrappers around Next.js' navigation
|
||||
// APIs that consider the routing configuration
|
||||
export const { Link, redirect, usePathname, useRouter, getPathname } =
|
||||
createNavigation(routing);
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import { getRequestConfig } from "next-intl/server";
|
||||
import { hasLocale } from "next-intl";
|
||||
import { routing } from "./routing";
|
||||
|
||||
export default getRequestConfig(async ({ requestLocale }) => {
|
||||
// Typically corresponds to the `[locale]` segment
|
||||
const requested = await requestLocale;
|
||||
const locale = hasLocale(routing.locales, requested)
|
||||
? requested
|
||||
: routing.defaultLocale;
|
||||
|
||||
return {
|
||||
locale,
|
||||
messages: (await import(`./messages/${locale}.json`)).default,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import { defineRouting } from "next-intl/routing";
|
||||
import { LanguageRoutes } from "./types";
|
||||
|
||||
export const routing = defineRouting({
|
||||
// A list of all locales that are supported
|
||||
locales: [LanguageRoutes.UZ, LanguageRoutes.RU, LanguageRoutes.KI],
|
||||
|
||||
// Used when no locale matches
|
||||
defaultLocale: LanguageRoutes.UZ,
|
||||
localeDetection: false,
|
||||
});
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import * as React from "react";
|
||||
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
||||
|
||||
export function ThemeProvider({
|
||||
children,
|
||||
...props
|
||||
}: React.ComponentProps<typeof NextThemesProvider>) {
|
||||
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import getLocaleCS from "@/shared/lib/getLocaleCS";
|
||||
import dayjs from "dayjs";
|
||||
import "dayjs/locale/uz-latn";
|
||||
import "dayjs/locale/uz";
|
||||
import "dayjs/locale/ru";
|
||||
import "dayjs/locale/uz";
|
||||
import "dayjs/locale/uz-latn";
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||
import relativeTime from "dayjs/plugin/relativeTime";
|
||||
import { getLocale } from "next-intl/server";
|
||||
|
||||
// Install Dayjs plugins
|
||||
dayjs.extend(localizedFormat);
|
||||
@@ -12,7 +12,7 @@ dayjs.extend(relativeTime);
|
||||
|
||||
// Find locale
|
||||
const getCurrentLocale = async () => {
|
||||
const locale = await getLocale();
|
||||
const locale = await getLocaleCS();
|
||||
switch (locale) {
|
||||
case "ki":
|
||||
return "uz";
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useTheme } from "@/providers/theme/ThemeProvider";
|
||||
import {
|
||||
CircleCheckIcon,
|
||||
InfoIcon,
|
||||
@@ -7,7 +8,6 @@ import {
|
||||
OctagonXIcon,
|
||||
TriangleAlertIcon,
|
||||
} from "lucide-react";
|
||||
import { useTheme } from "next-themes";
|
||||
import { Toaster as Sonner, type ToasterProps } from "sonner";
|
||||
|
||||
const Toaster = ({ ...props }: ToasterProps) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useTheme } from "@/providers/theme/ThemeProvider";
|
||||
import { Laptop, Moon, Sun } from "lucide-react";
|
||||
import { useTheme } from "next-themes";
|
||||
import { ToggleGroup, ToggleGroupItem } from "./toggle-group";
|
||||
|
||||
export function ModeToggle() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import { LanguageRoutes } from "@/shared/config/i18n/types";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
import {
|
||||
DropdownMenu,
|
||||
@@ -9,20 +8,13 @@ import {
|
||||
DropdownMenuTrigger,
|
||||
} from "@/shared/ui/dropdown-menu";
|
||||
import { GlobeIcon } from "lucide-react";
|
||||
import { useParams, usePathname, useRouter } from "next/navigation";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { languages } from "../lib/data";
|
||||
|
||||
export function ChangeLang() {
|
||||
const { locale } = useParams();
|
||||
const pathname = usePathname();
|
||||
const router = useRouter();
|
||||
|
||||
const changeLocale = (locale: LanguageRoutes) => {
|
||||
const segments = pathname.split("/");
|
||||
segments[1] = locale;
|
||||
const newPath = segments.join("/");
|
||||
router.push(newPath);
|
||||
};
|
||||
const changeLocale = () => {};
|
||||
|
||||
return (
|
||||
<DropdownMenu>
|
||||
@@ -34,7 +26,7 @@ export function ChangeLang() {
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
{languages.map((e, i) => (
|
||||
<DropdownMenuItem key={i} onClick={() => changeLocale(e.key)}>
|
||||
<DropdownMenuItem key={i} onClick={() => changeLocale()}>
|
||||
{e.name}
|
||||
</DropdownMenuItem>
|
||||
))}
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
SheetTrigger,
|
||||
} from "@/shared/ui/sheet";
|
||||
import { Menu } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { Link } from "react-router-dom";
|
||||
import { menu } from "../lib/data";
|
||||
import { ChangeLang } from "./ChangeLang";
|
||||
import RenderMenuItem from "./RenderItem";
|
||||
@@ -32,7 +32,7 @@ const Navbar = () => {
|
||||
<nav className="hidden justify-between lg:flex">
|
||||
<div className="flex items-center gap-6">
|
||||
{/* Logo */}
|
||||
<Link href={"/"} className="flex items-center gap-2">
|
||||
<Link to={"/"} className="flex items-center gap-2">
|
||||
<span className="text-lg font-semibold tracking-tighter">
|
||||
{PRODUCT_INFO.name}
|
||||
</span>
|
||||
@@ -48,10 +48,10 @@ const Navbar = () => {
|
||||
<div className="flex gap-2">
|
||||
<ChangeLang />
|
||||
<Button asChild variant="outline">
|
||||
<Link href={auth.login.url}>{auth.login.title}</Link>
|
||||
<Link to={auth.login.url}>{auth.login.title}</Link>
|
||||
</Button>
|
||||
<Button asChild>
|
||||
<Link href={auth.signup.url}>{auth.signup.title}</Link>
|
||||
<Link to={auth.signup.url}>{auth.signup.title}</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -85,10 +85,10 @@ const Navbar = () => {
|
||||
|
||||
<div className="flex flex-col gap-3">
|
||||
<Button asChild variant="outline">
|
||||
<Link href={auth.login.url}>{auth.login.title}</Link>
|
||||
<Link to={auth.login.url}>{auth.login.title}</Link>
|
||||
</Button>
|
||||
<Button asChild>
|
||||
<Link href={auth.signup.url}>{auth.signup.title}</Link>
|
||||
<Link to={auth.signup.url}>{auth.signup.title}</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
const Welcome = () => {
|
||||
return (
|
||||
<div className="custom-container h-full bg-accent min-h-[400px] rounded-2xl flex items-center justify-center">
|
||||
<Link
|
||||
className="github-button"
|
||||
href="https://github.com/fiasuz/create-fias"
|
||||
to="https://github.com/fiasuz/create-fias"
|
||||
data-color-scheme="no-preference: light; light: light; dark: dark;"
|
||||
data-icon="octicon-star"
|
||||
data-size="large"
|
||||
|
||||
Reference in New Issue
Block a user