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 { DashboardLayout } from "@/widgets/dashboard-layout/ui/DashboardLayout";
|
||||||
import L from "leaflet";
|
import L from "leaflet";
|
||||||
import { useSearchParams } from "next/navigation";
|
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
import { useSearchParams } from "react-router-dom";
|
||||||
|
|
||||||
interface RouteData {
|
interface RouteData {
|
||||||
distance: string;
|
distance: string;
|
||||||
@@ -25,7 +25,7 @@ interface LeafletRoutingControl extends L.Control {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ObjectMapPage = () => {
|
const ObjectMapPage = () => {
|
||||||
const searchParams = useSearchParams();
|
const [searchParams] = useSearchParams();
|
||||||
|
|
||||||
const lat = parseFloat(searchParams.get("lat") || "0");
|
const lat = parseFloat(searchParams.get("lat") || "0");
|
||||||
const lon = parseFloat(searchParams.get("lon") || "0");
|
const lon = parseFloat(searchParams.get("lon") || "0");
|
||||||
@@ -121,9 +121,7 @@ const ObjectMapPage = () => {
|
|||||||
const L = (await import("leaflet")).default;
|
const L = (await import("leaflet")).default;
|
||||||
await import("leaflet/dist/leaflet.css");
|
await import("leaflet/dist/leaflet.css");
|
||||||
await import("leaflet-routing-machine");
|
await import("leaflet-routing-machine");
|
||||||
await import(
|
await import("leaflet-routing-machine/dist/leaflet-routing-machine.css");
|
||||||
"leaflet-routing-machine/dist/leaflet-routing-machine.css"
|
|
||||||
);
|
|
||||||
|
|
||||||
// Xaritani yaratish
|
// Xaritani yaratish
|
||||||
if (!mapInstance.current) {
|
if (!mapInstance.current) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { DataTable } from "@/features/doctor/lib/data-table";
|
||||||
import type { TourItem } from "@/features/tour-plan/lib/types";
|
import type { TourItem } from "@/features/tour-plan/lib/types";
|
||||||
import {
|
import {
|
||||||
Select,
|
Select,
|
||||||
@@ -10,15 +11,9 @@ import {
|
|||||||
SelectValue,
|
SelectValue,
|
||||||
} from "@/shared/ui/select";
|
} from "@/shared/ui/select";
|
||||||
import { DashboardLayout } from "@/widgets/dashboard-layout/ui";
|
import { DashboardLayout } from "@/widgets/dashboard-layout/ui";
|
||||||
import dynamic from "next/dynamic";
|
|
||||||
import { useMemo, useState } from "react";
|
import { useMemo, useState } from "react";
|
||||||
import { getColumns } from "../lib/column";
|
import { getColumns } from "../lib/column";
|
||||||
|
|
||||||
const DataTable = dynamic(
|
|
||||||
() => import("../lib/data-table").then((mod) => mod.DataTable),
|
|
||||||
{ ssr: false },
|
|
||||||
);
|
|
||||||
|
|
||||||
const mockTourData: TourItem[] = [
|
const mockTourData: TourItem[] = [
|
||||||
{
|
{
|
||||||
id: 1,
|
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 from "dayjs";
|
||||||
import "dayjs/locale/uz-latn";
|
|
||||||
import "dayjs/locale/uz";
|
|
||||||
import "dayjs/locale/ru";
|
import "dayjs/locale/ru";
|
||||||
|
import "dayjs/locale/uz";
|
||||||
|
import "dayjs/locale/uz-latn";
|
||||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||||
import relativeTime from "dayjs/plugin/relativeTime";
|
import relativeTime from "dayjs/plugin/relativeTime";
|
||||||
import { getLocale } from "next-intl/server";
|
|
||||||
|
|
||||||
// Install Dayjs plugins
|
// Install Dayjs plugins
|
||||||
dayjs.extend(localizedFormat);
|
dayjs.extend(localizedFormat);
|
||||||
@@ -12,7 +12,7 @@ dayjs.extend(relativeTime);
|
|||||||
|
|
||||||
// Find locale
|
// Find locale
|
||||||
const getCurrentLocale = async () => {
|
const getCurrentLocale = async () => {
|
||||||
const locale = await getLocale();
|
const locale = await getLocaleCS();
|
||||||
switch (locale) {
|
switch (locale) {
|
||||||
case "ki":
|
case "ki":
|
||||||
return "uz";
|
return "uz";
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { useTheme } from "@/providers/theme/ThemeProvider";
|
||||||
import {
|
import {
|
||||||
CircleCheckIcon,
|
CircleCheckIcon,
|
||||||
InfoIcon,
|
InfoIcon,
|
||||||
@@ -7,7 +8,6 @@ import {
|
|||||||
OctagonXIcon,
|
OctagonXIcon,
|
||||||
TriangleAlertIcon,
|
TriangleAlertIcon,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { useTheme } from "next-themes";
|
|
||||||
import { Toaster as Sonner, type ToasterProps } from "sonner";
|
import { Toaster as Sonner, type ToasterProps } from "sonner";
|
||||||
|
|
||||||
const Toaster = ({ ...props }: ToasterProps) => {
|
const Toaster = ({ ...props }: ToasterProps) => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { useTheme } from "@/providers/theme/ThemeProvider";
|
||||||
import { Laptop, Moon, Sun } from "lucide-react";
|
import { Laptop, Moon, Sun } from "lucide-react";
|
||||||
import { useTheme } from "next-themes";
|
|
||||||
import { ToggleGroup, ToggleGroupItem } from "./toggle-group";
|
import { ToggleGroup, ToggleGroupItem } from "./toggle-group";
|
||||||
|
|
||||||
export function ModeToggle() {
|
export function ModeToggle() {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { LanguageRoutes } from "@/shared/config/i18n/types";
|
|
||||||
import { Button } from "@/shared/ui/button";
|
import { Button } from "@/shared/ui/button";
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
@@ -9,20 +8,13 @@ import {
|
|||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from "@/shared/ui/dropdown-menu";
|
} from "@/shared/ui/dropdown-menu";
|
||||||
import { GlobeIcon } from "lucide-react";
|
import { GlobeIcon } from "lucide-react";
|
||||||
import { useParams, usePathname, useRouter } from "next/navigation";
|
import { useParams } from "react-router-dom";
|
||||||
import { languages } from "../lib/data";
|
import { languages } from "../lib/data";
|
||||||
|
|
||||||
export function ChangeLang() {
|
export function ChangeLang() {
|
||||||
const { locale } = useParams();
|
const { locale } = useParams();
|
||||||
const pathname = usePathname();
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const changeLocale = (locale: LanguageRoutes) => {
|
const changeLocale = () => {};
|
||||||
const segments = pathname.split("/");
|
|
||||||
segments[1] = locale;
|
|
||||||
const newPath = segments.join("/");
|
|
||||||
router.push(newPath);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
@@ -34,7 +26,7 @@ export function ChangeLang() {
|
|||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent align="end">
|
<DropdownMenuContent align="end">
|
||||||
{languages.map((e, i) => (
|
{languages.map((e, i) => (
|
||||||
<DropdownMenuItem key={i} onClick={() => changeLocale(e.key)}>
|
<DropdownMenuItem key={i} onClick={() => changeLocale()}>
|
||||||
{e.name}
|
{e.name}
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
SheetTrigger,
|
SheetTrigger,
|
||||||
} from "@/shared/ui/sheet";
|
} from "@/shared/ui/sheet";
|
||||||
import { Menu } from "lucide-react";
|
import { Menu } from "lucide-react";
|
||||||
import Link from "next/link";
|
import { Link } from "react-router-dom";
|
||||||
import { menu } from "../lib/data";
|
import { menu } from "../lib/data";
|
||||||
import { ChangeLang } from "./ChangeLang";
|
import { ChangeLang } from "./ChangeLang";
|
||||||
import RenderMenuItem from "./RenderItem";
|
import RenderMenuItem from "./RenderItem";
|
||||||
@@ -32,7 +32,7 @@ const Navbar = () => {
|
|||||||
<nav className="hidden justify-between lg:flex">
|
<nav className="hidden justify-between lg:flex">
|
||||||
<div className="flex items-center gap-6">
|
<div className="flex items-center gap-6">
|
||||||
{/* Logo */}
|
{/* 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">
|
<span className="text-lg font-semibold tracking-tighter">
|
||||||
{PRODUCT_INFO.name}
|
{PRODUCT_INFO.name}
|
||||||
</span>
|
</span>
|
||||||
@@ -48,10 +48,10 @@ const Navbar = () => {
|
|||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<ChangeLang />
|
<ChangeLang />
|
||||||
<Button asChild variant="outline">
|
<Button asChild variant="outline">
|
||||||
<Link href={auth.login.url}>{auth.login.title}</Link>
|
<Link to={auth.login.url}>{auth.login.title}</Link>
|
||||||
</Button>
|
</Button>
|
||||||
<Button asChild>
|
<Button asChild>
|
||||||
<Link href={auth.signup.url}>{auth.signup.title}</Link>
|
<Link to={auth.signup.url}>{auth.signup.title}</Link>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -85,10 +85,10 @@ const Navbar = () => {
|
|||||||
|
|
||||||
<div className="flex flex-col gap-3">
|
<div className="flex flex-col gap-3">
|
||||||
<Button asChild variant="outline">
|
<Button asChild variant="outline">
|
||||||
<Link href={auth.login.url}>{auth.login.title}</Link>
|
<Link to={auth.login.url}>{auth.login.title}</Link>
|
||||||
</Button>
|
</Button>
|
||||||
<Button asChild>
|
<Button asChild>
|
||||||
<Link href={auth.signup.url}>{auth.signup.title}</Link>
|
<Link to={auth.signup.url}>{auth.signup.title}</Link>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import Link from "next/link";
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
const Welcome = () => {
|
const Welcome = () => {
|
||||||
return (
|
return (
|
||||||
<div className="custom-container h-full bg-accent min-h-[400px] rounded-2xl flex items-center justify-center">
|
<div className="custom-container h-full bg-accent min-h-[400px] rounded-2xl flex items-center justify-center">
|
||||||
<Link
|
<Link
|
||||||
className="github-button"
|
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-color-scheme="no-preference: light; light: light; dark: dark;"
|
||||||
data-icon="octicon-star"
|
data-icon="octicon-star"
|
||||||
data-size="large"
|
data-size="large"
|
||||||
|
|||||||
Reference in New Issue
Block a user