diff --git a/prettier.config.cjs b/prettier.config.cjs
index 2126a71..f827aa1 100644
--- a/prettier.config.cjs
+++ b/prettier.config.cjs
@@ -1,7 +1,7 @@
/** @type {import("prettier").Config} */
module.exports = {
semi: true, // Har satrda nuqta-vergul bo‘lishi
- singleQuote: true, // ' ' ishlatilsin, " " emas
+ singleQuote: false, // ' ' ishlatilsin, " " emas
trailingComma: 'all', // so‘nggi vergullar qo‘yilsin
tabWidth: 2, // Indent 2 bo‘lsin
bracketSpacing: true, // { a: 1 } ichida bo‘sh joy qoldirsin
diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx
index ede921c..8c17334 100644
--- a/src/app/[locale]/layout.tsx
+++ b/src/app/[locale]/layout.tsx
@@ -1,17 +1,17 @@
-import type { Metadata } from 'next';
-import '../globals.css';
-import { golosText } from '@/shared/config/fonts';
-import { ThemeProvider } from '@/shared/config/theme-provider';
-import { PRODUCT_INFO } from '@/shared/constants/data';
-import { hasLocale, Locale, NextIntlClientProvider } from 'next-intl';
-import { routing } from '@/shared/config/i18n/routing';
-import { notFound } from 'next/navigation';
-import Footer from '@/widgets/footer/ui';
-import Navbar from '@/widgets/navbar/ui';
-import { ReactNode } from 'react';
-import { setRequestLocale } from 'next-intl/server';
-import QueryProvider from '@/shared/config/react-query/QueryProvider';
-import Script from 'next/script';
+import type { Metadata } from "next";
+import "../globals.css";
+import { golosText } from "@/shared/config/fonts";
+import { ThemeProvider } from "@/shared/config/theme-provider";
+import { PRODUCT_INFO } from "@/shared/constants/data";
+import { hasLocale, type Locale, NextIntlClientProvider } from "next-intl";
+import { routing } from "@/shared/config/i18n/routing";
+import { notFound } from "next/navigation";
+import Footer from "@/widgets/footer/ui";
+import Navbar from "@/widgets/navbar/ui";
+import { setRequestLocale } from "next-intl/server";
+import QueryProvider from "@/shared/config/react-query/QueryProvider";
+import Script from "next/script";
+import type { ReactNode } from "react";
export const metadata: Metadata = {
title: PRODUCT_INFO.name,
@@ -42,7 +42,7 @@ export default async function RootLayout({ children, params }: Props) {
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 80ff9ef..dfaa970 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -1,4 +1,4 @@
-import { ReactNode } from 'react';
+import type { ReactNode } from "react";
type Props = {
children: ReactNode;
diff --git a/src/app/page.tsx b/src/app/page.tsx
index e41154a..521d26d 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -1,6 +1,7 @@
-import { redirect } from 'next/navigation';
+import { routing } from "@/shared/config/i18n/routing";
+import { redirect } from "next/navigation";
// This page only renders when the app is built statically (output: 'export')
export default function RootPage() {
- redirect('/uz');
+ redirect(routing.defaultLocale);
}
diff --git a/src/middleware.ts b/src/middleware.ts
index d4f5686..e270249 100644
--- a/src/middleware.ts
+++ b/src/middleware.ts
@@ -1,5 +1,5 @@
-import createMiddleware from 'next-intl/middleware';
-import { routing } from './shared/config/i18n/routing';
+import createMiddleware from "next-intl/middleware";
+import { routing } from "./shared/config/i18n/routing";
export default createMiddleware(routing);
@@ -7,5 +7,5 @@ export const config = {
// Match all pathnames except for
// - … if they start with `/api`, `/trpc`, `/_next` or `/_vercel`
// - … the ones containing a dot (e.g. `favicon.ico`)
- matcher: '/((?!api|trpc|_next|_vercel|.*\\..*).*)',
+ matcher: "/((?!api|trpc|_next|_vercel|.*\\..*).*)",
};
diff --git a/src/shared/config/api/URLs.ts b/src/shared/config/api/URLs.ts
index da7306a..5541cc5 100644
--- a/src/shared/config/api/URLs.ts
+++ b/src/shared/config/api/URLs.ts
@@ -1,6 +1,6 @@
const BASE_URL =
- process.env.NEXT_PUBLIC_API_URL || 'https://jsonplaceholder.typicode.com';
+ process.env.NEXT_PUBLIC_API_URL || "https://jsonplaceholder.typicode.com";
-const ENDP_POSTS = '/posts/';
+const ENDP_POSTS = "/posts/";
export { BASE_URL, ENDP_POSTS };
diff --git a/src/shared/config/api/httpClient.ts b/src/shared/config/api/httpClient.ts
index 92b475b..928fae6 100644
--- a/src/shared/config/api/httpClient.ts
+++ b/src/shared/config/api/httpClient.ts
@@ -1,8 +1,8 @@
-import getLocaleCS from '@/shared/lib/getLocaleCS';
-import axios from 'axios';
-import { getLocale } from 'next-intl/server';
-import { LanguageRoutes } from '../i18n/types';
-import { BASE_URL } from './URLs';
+import getLocaleCS from "@/shared/lib/getLocaleCS";
+import axios from "axios";
+import { getLocale } from "next-intl/server";
+import { LanguageRoutes } from "../i18n/types";
+import { BASE_URL } from "./URLs";
const httpClient = axios.create({
baseURL: BASE_URL,
@@ -18,11 +18,11 @@ httpClient.interceptors.request.use(
try {
language = (await getLocale()) as LanguageRoutes;
} catch (e) {
- console.log('error', e);
+ console.log("error", e);
language = getLocaleCS() || LanguageRoutes.UZ;
}
- config.headers['Accept-Language'] = language;
+ config.headers["Accept-Language"] = language;
// const accessToken = localStorage.getItem('accessToken');
// if (accessToken) {
// config.headers['Authorization'] = `Bearer ${accessToken}`;
@@ -36,7 +36,7 @@ httpClient.interceptors.request.use(
httpClient.interceptors.response.use(
(response) => response,
(error) => {
- console.error('API error:', error);
+ console.error("API error:", error);
return Promise.reject(error);
},
);
diff --git a/src/shared/config/api/testApi.ts b/src/shared/config/api/testApi.ts
index 8cf23ad..037c5d0 100644
--- a/src/shared/config/api/testApi.ts
+++ b/src/shared/config/api/testApi.ts
@@ -1,8 +1,8 @@
-import { ENDP_POSTS } from '@/shared/config/api/URLs';
-import { ReqWithPagination } from './types';
-import { AxiosResponse } from 'axios';
-import { TestApiType } from '@/shared/types/testApi';
-import httpClient from './httpClient';
+import { ENDP_POSTS } from "@/shared/config/api/URLs";
+import { type ReqWithPagination } from "./types";
+import { type AxiosResponse } from "axios";
+import { type TestApiType } from "@/shared/types/testApi";
+import httpClient from "./httpClient";
const getPosts = async (
pagination?: ReqWithPagination,
diff --git a/src/shared/config/fonts.ts b/src/shared/config/fonts.ts
index 517ca42..dc355d4 100644
--- a/src/shared/config/fonts.ts
+++ b/src/shared/config/fonts.ts
@@ -1,9 +1,9 @@
-import { Golos_Text } from 'next/font/google';
+import { Golos_Text } from "next/font/google";
const golosText = Golos_Text({
- weight: ['400', '500', '600', '700', '800'],
- variable: '--font-golos-text',
- subsets: ['latin', 'cyrillic'],
+ weight: ["400", "500", "600", "700", "800"],
+ variable: "--font-golos-text",
+ subsets: ["latin", "cyrillic"],
});
export { golosText };
diff --git a/src/shared/config/i18n/messages/uz.d.json.ts b/src/shared/config/i18n/messages/uz.d.json.ts
index 5d538a0..197b70f 100644
--- a/src/shared/config/i18n/messages/uz.d.json.ts
+++ b/src/shared/config/i18n/messages/uz.d.json.ts
@@ -3,8 +3,8 @@
declare const messages: {
HomePage: {
- title: 'Salom dunyo!';
- about: 'Go to the about page';
+ title: "Salom dunyo!";
+ about: "Go to the about page";
};
};
export default messages;
diff --git a/src/shared/config/i18n/navigation.ts b/src/shared/config/i18n/navigation.ts
index 6d5535b..e7a18ea 100644
--- a/src/shared/config/i18n/navigation.ts
+++ b/src/shared/config/i18n/navigation.ts
@@ -1,5 +1,5 @@
-import { createNavigation } from 'next-intl/navigation';
-import { routing } from './routing';
+import { createNavigation } from "next-intl/navigation";
+import { routing } from "./routing";
// Lightweight wrappers around Next.js' navigation
// APIs that consider the routing configuration
diff --git a/src/shared/config/i18n/request.ts b/src/shared/config/i18n/request.ts
index 38fb92a..99f704a 100644
--- a/src/shared/config/i18n/request.ts
+++ b/src/shared/config/i18n/request.ts
@@ -1,6 +1,6 @@
-import { getRequestConfig } from 'next-intl/server';
-import { hasLocale } from 'next-intl';
-import { routing } from './routing';
+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
diff --git a/src/shared/config/i18n/routing.ts b/src/shared/config/i18n/routing.ts
index fd73da4..860d03a 100644
--- a/src/shared/config/i18n/routing.ts
+++ b/src/shared/config/i18n/routing.ts
@@ -1,5 +1,5 @@
-import { defineRouting } from 'next-intl/routing';
-import { LanguageRoutes } from './types';
+import { defineRouting } from "next-intl/routing";
+import { LanguageRoutes } from "./types";
export const routing = defineRouting({
// A list of all locales that are supported
diff --git a/src/shared/config/i18n/types.ts b/src/shared/config/i18n/types.ts
index e64b8bc..c8aaf3c 100644
--- a/src/shared/config/i18n/types.ts
+++ b/src/shared/config/i18n/types.ts
@@ -1,5 +1,5 @@
export enum LanguageRoutes {
- UZ = 'uz', // o'zbekcha
- RU = 'ru', // ruscha
- KI = 'ki', // kirilcha
+ UZ = "uz", // o'zbekcha
+ RU = "ru", // ruscha
+ KI = "ki", // kirilcha
}
diff --git a/src/shared/config/react-query/QueryProvider.tsx b/src/shared/config/react-query/QueryProvider.tsx
index a3275f9..469c9da 100644
--- a/src/shared/config/react-query/QueryProvider.tsx
+++ b/src/shared/config/react-query/QueryProvider.tsx
@@ -1,7 +1,7 @@
-'use client';
+"use client";
-import { ReactNode, useState } from 'react';
-import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
+import { type ReactNode, useState } from "react";
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
const QueryProvider = ({ children }: { children: ReactNode }) => {
const [queryClient] = useState(
diff --git a/src/shared/config/theme-provider.tsx b/src/shared/config/theme-provider.tsx
index 9bf53d8..189a2b1 100644
--- a/src/shared/config/theme-provider.tsx
+++ b/src/shared/config/theme-provider.tsx
@@ -1,7 +1,7 @@
-'use client';
+"use client";
-import * as React from 'react';
-import { ThemeProvider as NextThemesProvider } from 'next-themes';
+import * as React from "react";
+import { ThemeProvider as NextThemesProvider } from "next-themes";
export function ThemeProvider({
children,
diff --git a/src/shared/constants/data.ts b/src/shared/constants/data.ts
index 92ac152..8569247 100644
--- a/src/shared/constants/data.ts
+++ b/src/shared/constants/data.ts
@@ -1,21 +1,21 @@
const PRODUCT_INFO = {
- name: 'FIAS App',
- description: 'Generated by create next app',
- logo: '/favicon.png',
- favicon: '/favicon.svg',
- url: 'https://www.shadcnblocks.com',
+ name: "FIAS App",
+ description: "Generated by create next app",
+ logo: "/favicon.png",
+ favicon: "/favicon.svg",
+ url: "https://www.shadcnblocks.com",
socials: {
- telegram: 'https://t.me/usmanov_dev',
- instagram: 'https://t.me/usmanov_dev',
- youtube: 'https://t.me/usmanov_dev',
- linkedin: 'https://www.linkedin.com/in/usmonov-azizbek/',
+ telegram: "https://t.me/usmanov_dev",
+ instagram: "https://t.me/usmanov_dev",
+ youtube: "https://t.me/usmanov_dev",
+ linkedin: "https://www.linkedin.com/in/usmonov-azizbek/",
},
contact: {
- phone: '+998901234567',
- email: 'contact@fias.uz',
+ phone: "+998901234567",
+ email: "contact@fias.uz",
},
- terms_of_use: '',
- creator: 'FIAS App',
+ terms_of_use: "",
+ creator: "FIAS App",
};
export { PRODUCT_INFO };
diff --git a/src/shared/hooks/use-closer.ts b/src/shared/hooks/use-closer.ts
index 4e005d4..4e3682a 100644
--- a/src/shared/hooks/use-closer.ts
+++ b/src/shared/hooks/use-closer.ts
@@ -1,4 +1,4 @@
-import React, { useEffect } from 'react';
+import React, { useEffect } from "react";
/**
* Hook for closing some items when they are unnecessary to the user
@@ -27,11 +27,11 @@ const useCloser = (
}
}
- document.addEventListener('mousedown', handleClickOutside);
- document.addEventListener('scroll', handleScroll);
+ document.addEventListener("mousedown", handleClickOutside);
+ document.addEventListener("scroll", handleScroll);
return () => {
- document.removeEventListener('mousedown', handleClickOutside);
- document.removeEventListener('scroll', handleScroll);
+ document.removeEventListener("mousedown", handleClickOutside);
+ document.removeEventListener("scroll", handleScroll);
};
}, [ref, closeFunction]);
};
diff --git a/src/shared/hooks/use-mobile.ts b/src/shared/hooks/use-mobile.ts
index 2d10e30..5285106 100644
--- a/src/shared/hooks/use-mobile.ts
+++ b/src/shared/hooks/use-mobile.ts
@@ -1,4 +1,4 @@
-import * as React from 'react';
+import * as React from "react";
const MOBILE_BREAKPOINT = 768;
@@ -16,9 +16,9 @@ const useIsMobile = () => {
const onChange = () => {
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
};
- mql.addEventListener('change', onChange);
+ mql.addEventListener("change", onChange);
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
- return () => mql.removeEventListener('change', onChange);
+ return () => mql.removeEventListener("change", onChange);
}, []);
return !!isMobile;
diff --git a/src/shared/hooks/use-window-size.ts b/src/shared/hooks/use-window-size.ts
index e76b009..010db70 100644
--- a/src/shared/hooks/use-window-size.ts
+++ b/src/shared/hooks/use-window-size.ts
@@ -1,4 +1,4 @@
-import { useEffect, useState } from 'react';
+import { useEffect, useState } from "react";
interface ISize {
width: number | undefined;
@@ -25,10 +25,10 @@ const useWindowSize = () => {
getScreenSize();
- window.addEventListener('resize', getScreenSize);
+ window.addEventListener("resize", getScreenSize);
return () => {
- window.removeEventListener('resize', getScreenSize);
+ window.removeEventListener("resize", getScreenSize);
};
}, []);
diff --git a/src/shared/lib/formatDate.ts b/src/shared/lib/formatDate.ts
index 6724fcd..8a117dc 100644
--- a/src/shared/lib/formatDate.ts
+++ b/src/shared/lib/formatDate.ts
@@ -1,10 +1,10 @@
-import dayjs from 'dayjs';
-import 'dayjs/locale/uz-latn';
-import 'dayjs/locale/uz';
-import 'dayjs/locale/ru';
-import localizedFormat from 'dayjs/plugin/localizedFormat';
-import relativeTime from 'dayjs/plugin/relativeTime';
-import { getLocale } from 'next-intl/server';
+import dayjs from "dayjs";
+import "dayjs/locale/uz-latn";
+import "dayjs/locale/uz";
+import "dayjs/locale/ru";
+import localizedFormat from "dayjs/plugin/localizedFormat";
+import relativeTime from "dayjs/plugin/relativeTime";
+import { getLocale } from "next-intl/server";
// Install Dayjs plugins
dayjs.extend(localizedFormat);
@@ -14,15 +14,15 @@ dayjs.extend(relativeTime);
const getCurrentLocale = async () => {
const locale = await getLocale();
switch (locale) {
- case 'ki':
- return 'uz';
- case 'uz':
- return 'uz-latn';
- case 'ru':
- return 'ru';
+ case "ki":
+ return "uz";
+ case "uz":
+ return "uz-latn";
+ case "ru":
+ return "ru";
default:
- return 'uz-latn';
+ return "uz-latn";
}
};
@@ -53,7 +53,7 @@ const formatDate = {
format: (
time: Date | string | number,
format: string,
- locale: string = 'uz',
+ locale: string = "uz",
): string => {
return dayjs(time).locale(locale).format(format);
},
@@ -80,7 +80,7 @@ const formatDate = {
*/
relativeFormat: (
time: Date | string | number,
- locale: string = 'uz',
+ locale: string = "uz",
): string => {
return dayjs(time).locale(locale).fromNow();
},
diff --git a/src/shared/lib/formatPhone.ts b/src/shared/lib/formatPhone.ts
index bab88bd..4060103 100644
--- a/src/shared/lib/formatPhone.ts
+++ b/src/shared/lib/formatPhone.ts
@@ -5,14 +5,14 @@
*/
const formatPhone = (value: string) => {
// Keep only numbers
- const digits = value.replace(/\D/g, '');
+ const digits = value.replace(/\D/g, "");
// Return empty string if data is not available
if (digits.length === 0) {
- return '';
+ return "";
}
- const prefix = digits.startsWith('998') ? '+998 ' : '+998 ';
+ const prefix = digits.startsWith("998") ? "+998 " : "+998 ";
let formattedNumber = prefix;
@@ -21,15 +21,15 @@ const formatPhone = (value: string) => {
}
if (digits.length > 5) {
- formattedNumber += ' ' + digits.slice(5, 8);
+ formattedNumber += " " + digits.slice(5, 8);
}
if (digits.length > 8) {
- formattedNumber += '-' + digits.slice(8, 10);
+ formattedNumber += "-" + digits.slice(8, 10);
}
if (digits.length > 10) {
- formattedNumber += '-' + digits.slice(10, 12);
+ formattedNumber += "-" + digits.slice(10, 12);
}
return formattedNumber.trim();
diff --git a/src/shared/lib/formatPrice.ts b/src/shared/lib/formatPrice.ts
index 2fbfd5d..395f696 100644
--- a/src/shared/lib/formatPrice.ts
+++ b/src/shared/lib/formatPrice.ts
@@ -1,5 +1,5 @@
-import { LanguageRoutes } from '../config/i18n/types';
-import { getLocale } from 'next-intl/server';
+import { LanguageRoutes } from "../config/i18n/types";
+import { getLocale } from "next-intl/server";
/**
* Format price. With label.
@@ -11,19 +11,19 @@ const formatPrice = async (amount: number | string, withLabel?: boolean) => {
const locale = (await getLocale()) as LanguageRoutes;
const label = withLabel
? locale == LanguageRoutes.RU
- ? ' сум'
+ ? " сум"
: locale == LanguageRoutes.KI
- ? ' сўм'
- : ' so‘m'
- : '';
- const parts = String(amount).split('.');
+ ? " сўм"
+ : " so‘m"
+ : "";
+ const parts = String(amount).split(".");
const dollars = parts[0];
- const cents = parts.length > 1 ? parts[1] : '00';
+ const cents = parts.length > 1 ? parts[1] : "00";
- const formattedDollars = dollars.replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
+ const formattedDollars = dollars.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
if (String(amount).length == 0) {
- return formattedDollars + '.' + cents + label;
+ return formattedDollars + "." + cents + label;
} else {
return formattedDollars + label;
}
diff --git a/src/shared/lib/getLocaleCS.ts b/src/shared/lib/getLocaleCS.ts
index 9b4ddd6..b1f8d7c 100644
--- a/src/shared/lib/getLocaleCS.ts
+++ b/src/shared/lib/getLocaleCS.ts
@@ -1,11 +1,11 @@
-import { LanguageRoutes } from '../config/i18n/types';
+import { LanguageRoutes } from "../config/i18n/types";
const getLocaleCS = (): LanguageRoutes | undefined => {
- if (typeof window !== 'undefined' && typeof document !== 'undefined') {
+ if (typeof window !== "undefined" && typeof document !== "undefined") {
const match = document.cookie
- .split('; ')
- .find((row) => row.startsWith('NEXT_LOCALE='));
- return match?.split('=')[1] as LanguageRoutes;
+ .split("; ")
+ .find((row) => row.startsWith("NEXT_LOCALE="));
+ return match?.split("=")[1] as LanguageRoutes;
}
return undefined;
};
diff --git a/src/shared/lib/utils.ts b/src/shared/lib/utils.ts
index 2819a83..a5ef193 100644
--- a/src/shared/lib/utils.ts
+++ b/src/shared/lib/utils.ts
@@ -1,5 +1,5 @@
-import { clsx, type ClassValue } from 'clsx';
-import { twMerge } from 'tailwind-merge';
+import { clsx, type ClassValue } from "clsx";
+import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
diff --git a/src/shared/ui/accordion.tsx b/src/shared/ui/accordion.tsx
index 6fb19f4..1c76136 100644
--- a/src/shared/ui/accordion.tsx
+++ b/src/shared/ui/accordion.tsx
@@ -1,10 +1,10 @@
-'use client';
+"use client";
-import * as React from 'react';
-import * as AccordionPrimitive from '@radix-ui/react-accordion';
-import { ChevronDownIcon } from 'lucide-react';
+import * as React from "react";
+import * as AccordionPrimitive from "@radix-ui/react-accordion";
+import { ChevronDownIcon } from "lucide-react";
-import { cn } from '@/shared/lib/utils';
+import { cn } from "@/shared/lib/utils";
function Accordion({
...props
@@ -19,7 +19,7 @@ function AccordionItem({
return (
);
@@ -35,7 +35,7 @@ function AccordionTrigger({
svg]:rotate-180',
+ "focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
className,
)}
{...props}
@@ -58,7 +58,7 @@ function AccordionContent({
className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
{...props}
>
- {children}
+ {children}
);
}
diff --git a/src/shared/ui/button.tsx b/src/shared/ui/button.tsx
index 8d1aace..4c6dc64 100644
--- a/src/shared/ui/button.tsx
+++ b/src/shared/ui/button.tsx
@@ -1,8 +1,8 @@
-import * as React from 'react';
-import { Slot } from '@radix-ui/react-slot';
-import { cva, type VariantProps } from 'class-variance-authority';
+import * as React from "react";
+import { Slot } from "@radix-ui/react-slot";
+import { cva, type VariantProps } from "class-variance-authority";
-import { cn } from '@/shared/lib/utils';
+import { cn } from "@/shared/lib/utils";
const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
@@ -10,27 +10,27 @@ const buttonVariants = cva(
variants: {
variant: {
default:
- 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
+ "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
destructive:
- 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
+ "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
outline:
- 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
+ "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
secondary:
- 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
+ "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
ghost:
- 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
- link: 'text-primary underline-offset-4 hover:underline',
+ "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
+ link: "text-primary underline-offset-4 hover:underline",
},
size: {
- default: 'h-9 px-4 py-2 has-[>svg]:px-3',
- sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
- lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
- icon: 'size-9',
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
+ icon: "size-9",
},
},
defaultVariants: {
- variant: 'default',
- size: 'default',
+ variant: "default",
+ size: "default",
},
},
);
@@ -41,11 +41,11 @@ function Button({
size,
asChild = false,
...props
-}: React.ComponentProps<'button'> &
+}: React.ComponentProps<"button"> &
VariantProps & {
asChild?: boolean;
}) {
- const Comp = asChild ? Slot : 'button';
+ const Comp = asChild ? Slot : "button";
return (
& {
inset?: boolean;
- variant?: 'default' | 'destructive';
+ variant?: "default" | "destructive";
}) {
return (
);
@@ -179,12 +179,12 @@ function DropdownMenuSeparator({
function DropdownMenuShortcut({
className,
...props
-}: React.ComponentProps<'span'>) {
+}: React.ComponentProps<"span">) {
return (
) {
+function Input({ className, type, ...props }: React.ComponentProps<"input">) {
return (
);
}
const navigationMenuTriggerStyle = cva(
- 'group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1',
+ "group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1",
);
function NavigationMenuTrigger({
@@ -70,10 +70,10 @@ function NavigationMenuTrigger({
return (
- {children}{' '}
+ {children}{" "}
) {
return ;
@@ -36,7 +36,7 @@ function SheetOverlay({
& {
- side?: 'top' | 'right' | 'bottom' | 'left';
+ side?: "top" | "right" | "bottom" | "left";
}) {
return (
@@ -58,15 +58,15 @@ function SheetContent({
) {
+function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
return (
);
}
-function SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {
+function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
return (
);
@@ -108,7 +108,7 @@ function SheetTitle({
return (
);
@@ -121,7 +121,7 @@ function SheetDescription({
return (
);
diff --git a/src/shared/ui/theme-toggle.tsx b/src/shared/ui/theme-toggle.tsx
index 81f68be..318e19a 100644
--- a/src/shared/ui/theme-toggle.tsx
+++ b/src/shared/ui/theme-toggle.tsx
@@ -1,9 +1,9 @@
-'use client';
+"use client";
-import * as React from 'react';
-import { Laptop, Moon, Sun } from 'lucide-react';
-import { useTheme } from 'next-themes';
-import { ToggleGroup, ToggleGroupItem } from './toggle-group';
+import * as React from "react";
+import { Laptop, Moon, Sun } from "lucide-react";
+import { useTheme } from "next-themes";
+import { ToggleGroup, ToggleGroupItem } from "./toggle-group";
export function ModeToggle() {
const { setTheme } = useTheme();
@@ -14,14 +14,14 @@ export function ModeToggle() {
value="system"
className="border-r"
aria-label="Toggle system"
- onClick={() => setTheme('system')}
+ onClick={() => setTheme("system")}
>
setTheme('light')}
+ onClick={() => setTheme("light")}
>
@@ -29,7 +29,7 @@ export function ModeToggle() {
value="dark"
className="border-l"
aria-label="Toggle dark"
- onClick={() => setTheme('dark')}
+ onClick={() => setTheme("dark")}
>
diff --git a/src/shared/ui/toggle-group.tsx b/src/shared/ui/toggle-group.tsx
index e96b138..8129150 100644
--- a/src/shared/ui/toggle-group.tsx
+++ b/src/shared/ui/toggle-group.tsx
@@ -1,17 +1,17 @@
-'use client';
+"use client";
-import * as React from 'react';
-import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
-import { type VariantProps } from 'class-variance-authority';
+import * as React from "react";
+import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
+import { type VariantProps } from "class-variance-authority";
-import { cn } from '@/shared/lib/utils';
-import { toggleVariants } from '@/shared/ui/toggle';
+import { cn } from "@/shared/lib/utils";
+import { toggleVariants } from "@/shared/ui/toggle";
const ToggleGroupContext = React.createContext<
VariantProps
>({
- size: 'default',
- variant: 'default',
+ size: "default",
+ variant: "default",
});
function ToggleGroup({
@@ -28,7 +28,7 @@ function ToggleGroup({
data-variant={variant}
data-size={size}
className={cn(
- 'group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs',
+ "group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",
className,
)}
{...props}
@@ -60,7 +60,7 @@ function ToggleGroupItem({
variant: context.variant || variant,
size: context.size || size,
}),
- 'min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l',
+ "min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",
className,
)}
{...props}
diff --git a/src/shared/ui/toggle.tsx b/src/shared/ui/toggle.tsx
index eec2408..e5d119d 100644
--- a/src/shared/ui/toggle.tsx
+++ b/src/shared/ui/toggle.tsx
@@ -1,29 +1,29 @@
-'use client';
+"use client";
-import * as React from 'react';
-import * as TogglePrimitive from '@radix-ui/react-toggle';
-import { cva, type VariantProps } from 'class-variance-authority';
+import * as React from "react";
+import * as TogglePrimitive from "@radix-ui/react-toggle";
+import { cva, type VariantProps } from "class-variance-authority";
-import { cn } from '@/shared/lib/utils';
+import { cn } from "@/shared/lib/utils";
const toggleVariants = cva(
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
{
variants: {
variant: {
- default: 'bg-transparent',
+ default: "bg-transparent",
outline:
- 'border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground',
+ "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
},
size: {
- default: 'h-9 px-2 min-w-9',
- sm: 'h-8 px-1.5 min-w-8',
- lg: 'h-10 px-2.5 min-w-10',
+ default: "h-9 px-2 min-w-9",
+ sm: "h-8 px-1.5 min-w-8",
+ lg: "h-10 px-2.5 min-w-10",
},
},
defaultVariants: {
- variant: 'default',
- size: 'default',
+ variant: "default",
+ size: "default",
},
},
);
diff --git a/src/widgets/footer/lib/data.ts b/src/widgets/footer/lib/data.ts
index b3ffbe9..a146c16 100644
--- a/src/widgets/footer/lib/data.ts
+++ b/src/widgets/footer/lib/data.ts
@@ -1,29 +1,29 @@
const sections = [
{
- title: 'Product',
+ title: "Product",
links: [
- { name: 'Overview', href: '#' },
- { name: 'Pricing', href: '#' },
- { name: 'Marketplace', href: '#' },
- { name: 'Features', href: '#' },
+ { name: "Overview", href: "#" },
+ { name: "Pricing", href: "#" },
+ { name: "Marketplace", href: "#" },
+ { name: "Features", href: "#" },
],
},
{
- title: 'Company',
+ title: "Company",
links: [
- { name: 'About', href: '#' },
- { name: 'Team', href: '#' },
- { name: 'Blog', href: '#' },
- { name: 'Careers', href: '#' },
+ { name: "About", href: "#" },
+ { name: "Team", href: "#" },
+ { name: "Blog", href: "#" },
+ { name: "Careers", href: "#" },
],
},
{
- title: 'Resources',
+ title: "Resources",
links: [
- { name: 'Help', href: '#' },
- { name: 'Sales', href: '#' },
- { name: 'Advertise', href: '#' },
- { name: 'Privacy', href: '#' },
+ { name: "Help", href: "#" },
+ { name: "Sales", href: "#" },
+ { name: "Advertise", href: "#" },
+ { name: "Privacy", href: "#" },
],
},
];
diff --git a/src/widgets/footer/ui/index.tsx b/src/widgets/footer/ui/index.tsx
index 9b6a900..adbf7cf 100644
--- a/src/widgets/footer/ui/index.tsx
+++ b/src/widgets/footer/ui/index.tsx
@@ -1,7 +1,7 @@
-import { PRODUCT_INFO } from '@/shared/constants/data';
-import { InstagramIcon, YoutubeIcon } from 'lucide-react';
-import { sections } from '../lib/data';
-import { ModeToggle } from '@/shared/ui/theme-toggle';
+import { PRODUCT_INFO } from "@/shared/constants/data";
+import { InstagramIcon, YoutubeIcon } from "lucide-react";
+import { sections } from "../lib/data";
+import { ModeToggle } from "@/shared/ui/theme-toggle";
const Footer = () => {
return (
diff --git a/src/widgets/navbar/lib/data.ts b/src/widgets/navbar/lib/data.ts
index 866e27e..698ca50 100644
--- a/src/widgets/navbar/lib/data.ts
+++ b/src/widgets/navbar/lib/data.ts
@@ -1,77 +1,77 @@
-import { Book, Sunset, Trees, Zap } from 'lucide-react';
-import { MenuItem } from './model';
-import { LanguageRoutes } from '@/shared/config/i18n/types';
+import { Book, Sunset, Trees, Zap } from "lucide-react";
+import { type MenuItem } from "./model";
+import { LanguageRoutes } from "@/shared/config/i18n/types";
const menu: MenuItem[] = [
- { title: 'Home', url: '#' },
+ { title: "Home", url: "#" },
{
- title: 'Products',
- url: '#',
+ title: "Products",
+ url: "#",
items: [
{
- title: 'Blog',
- description: 'The latest industry news, updates, and info',
+ title: "Blog",
+ description: "The latest industry news, updates, and info",
icon: Book,
- url: '#',
+ url: "#",
},
{
- title: 'Company',
- description: 'Our mission is to innovate and empower the world',
+ title: "Company",
+ description: "Our mission is to innovate and empower the world",
icon: Trees,
- url: '#',
+ url: "#",
},
{
- title: 'Careers',
- description: 'Browse job listing and discover our workspace',
+ title: "Careers",
+ description: "Browse job listing and discover our workspace",
icon: Sunset,
- url: '#',
+ url: "#",
},
{
- title: 'Support',
+ title: "Support",
description:
- 'Get in touch with our support team or visit our community forums',
+ "Get in touch with our support team or visit our community forums",
icon: Zap,
- url: '#',
+ url: "#",
},
],
},
{
- title: 'Resources',
- url: '#',
+ title: "Resources",
+ url: "#",
items: [
{
- title: 'Help Center',
- description: 'Get all the answers you need right here',
+ title: "Help Center",
+ description: "Get all the answers you need right here",
icon: Zap,
- url: '#',
+ url: "#",
},
{
- title: 'Contact Us',
- description: 'We are here to help you with any questions you have',
+ title: "Contact Us",
+ description: "We are here to help you with any questions you have",
icon: Sunset,
- url: '#',
+ url: "#",
},
{
- title: 'Status',
- description: 'Check the current status of our services and APIs',
+ title: "Status",
+ description: "Check the current status of our services and APIs",
icon: Trees,
- url: '#',
+ url: "#",
},
{
- title: 'Terms of Service',
- description: 'Our terms and conditions for using our services',
+ title: "Terms of Service",
+ description: "Our terms and conditions for using our services",
icon: Book,
- url: '#',
+ url: "#",
},
],
},
{
- title: 'Pricing',
- url: '#',
+ title: "Pricing",
+ url: "#",
},
{
- title: 'Blog',
- url: '#',
+ title: "Blog",
+ url: "#",
},
];
@@ -81,11 +81,11 @@ const languages: { name: string; key: LanguageRoutes }[] = [
key: LanguageRoutes.UZ,
},
{
- name: 'Ўзбекча',
+ name: "Ўзбекча",
key: LanguageRoutes.KI,
},
{
- name: 'Русский',
+ name: "Русский",
key: LanguageRoutes.RU,
},
];
diff --git a/src/widgets/navbar/ui/ChangeLang.tsx b/src/widgets/navbar/ui/ChangeLang.tsx
index d338cb5..c6d0d44 100644
--- a/src/widgets/navbar/ui/ChangeLang.tsx
+++ b/src/widgets/navbar/ui/ChangeLang.tsx
@@ -1,17 +1,17 @@
-'use client';
+"use client";
-import * as React from 'react';
-import { GlobeIcon } from 'lucide-react';
+import * as React from "react";
+import { GlobeIcon } from "lucide-react";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
-} from '@/shared/ui/dropdown-menu';
-import { Button } from '@/shared/ui/button';
-import { languages } from '../lib/data';
-import { useParams, usePathname, useRouter } from 'next/navigation';
-import { LanguageRoutes } from '@/shared/config/i18n/types';
+} from "@/shared/ui/dropdown-menu";
+import { Button } from "@/shared/ui/button";
+import { languages } from "../lib/data";
+import { useParams, usePathname, useRouter } from "next/navigation";
+import { LanguageRoutes } from "@/shared/config/i18n/types";
export function ChangeLang() {
const { locale } = useParams();
@@ -19,9 +19,9 @@ export function ChangeLang() {
const router = useRouter();
const changeLocale = (locale: LanguageRoutes) => {
- const segments = pathname.split('/');
+ const segments = pathname.split("/");
segments[1] = locale;
- const newPath = segments.join('/');
+ const newPath = segments.join("/");
router.push(newPath);
};
diff --git a/src/widgets/navbar/ui/RenderItem.tsx b/src/widgets/navbar/ui/RenderItem.tsx
index 013dd47..df792ac 100644
--- a/src/widgets/navbar/ui/RenderItem.tsx
+++ b/src/widgets/navbar/ui/RenderItem.tsx
@@ -3,9 +3,9 @@ import {
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuTrigger,
-} from '@/shared/ui/navigation-menu';
-import { MenuItem } from '../lib/model';
-import SubMenuLink from './SubMenuLink';
+} from "@/shared/ui/navigation-menu";
+import { type MenuItem } from "../lib/model";
+import SubMenuLink from "./SubMenuLink";
const RenderMenuItem = (item: MenuItem) => {
// const t = useTranslations("")
diff --git a/src/widgets/navbar/ui/RenderMobileMenuItem.tsx b/src/widgets/navbar/ui/RenderMobileMenuItem.tsx
index 0787626..b600952 100644
--- a/src/widgets/navbar/ui/RenderMobileMenuItem.tsx
+++ b/src/widgets/navbar/ui/RenderMobileMenuItem.tsx
@@ -2,9 +2,9 @@ import {
AccordionContent,
AccordionItem,
AccordionTrigger,
-} from '@/shared/ui/accordion';
-import { MenuItem } from '../lib/model';
-import SubMenuLink from './SubMenuLink';
+} from "@/shared/ui/accordion";
+import { type MenuItem } from "../lib/model";
+import SubMenuLink from "./SubMenuLink";
const RenderMobileMenuItem = (item: MenuItem) => {
if (item.items) {
diff --git a/src/widgets/navbar/ui/SubMenuLink.tsx b/src/widgets/navbar/ui/SubMenuLink.tsx
index 97360e5..08487ea 100644
--- a/src/widgets/navbar/ui/SubMenuLink.tsx
+++ b/src/widgets/navbar/ui/SubMenuLink.tsx
@@ -1,4 +1,4 @@
-import { MenuItem } from '../lib/model';
+import { type MenuItem } from "../lib/model";
const SubMenuLink = ({ item }: { item: MenuItem }) => {
return (
diff --git a/src/widgets/navbar/ui/index.tsx b/src/widgets/navbar/ui/index.tsx
index 5189141..5f5052e 100644
--- a/src/widgets/navbar/ui/index.tsx
+++ b/src/widgets/navbar/ui/index.tsx
@@ -1,28 +1,28 @@
-import { Accordion } from '@/shared/ui/accordion';
-import { Button } from '@/shared/ui/button';
+import { Accordion } from "@/shared/ui/accordion";
+import { Button } from "@/shared/ui/button";
import {
NavigationMenu,
NavigationMenuList,
-} from '@/shared/ui/navigation-menu';
+} from "@/shared/ui/navigation-menu";
import {
Sheet,
SheetContent,
SheetHeader,
SheetTitle,
SheetTrigger,
-} from '@/shared/ui/sheet';
-import { Menu } from 'lucide-react';
-import { menu } from '../lib/data';
-import { PRODUCT_INFO } from '@/shared/constants/data';
-import RenderMenuItem from './RenderItem';
-import RenderMobileMenuItem from './RenderMobileMenuItem';
-import { ChangeLang } from './ChangeLang';
-import Link from 'next/link';
+} from "@/shared/ui/sheet";
+import { Menu } from "lucide-react";
+import { menu } from "../lib/data";
+import { PRODUCT_INFO } from "@/shared/constants/data";
+import RenderMenuItem from "./RenderItem";
+import RenderMobileMenuItem from "./RenderMobileMenuItem";
+import { ChangeLang } from "./ChangeLang";
+import Link from "next/link";
const Navbar = () => {
const auth = {
- login: { title: 'Login', url: '#' },
- signup: { title: 'Sign up', url: '#' },
+ login: { title: "Login", url: "#" },
+ signup: { title: "Sign up", url: "#" },
};
return (
@@ -32,7 +32,7 @@ const Navbar = () => {