From 88b9f5c387dfd322816d057f9641b97256702af5 Mon Sep 17 00:00:00 2001 From: AminGhasempoor Date: Wed, 22 Apr 2026 08:59:26 +0330 Subject: [PATCH] build and format --- messages/ar.json | 10 +- messages/en.json | 10 +- messages/fa.json | 10 +- messages/ku.json | 10 +- next-env.d.ts | 2 +- package.json | 100 ++++++++-------- src/app/[locale]/page.tsx | 27 +++-- src/components/ComponentsConteiner.tsx | 54 ++++----- src/components/buttons/PrimaryButton.tsx | 138 +++++++++++------------ src/i18n/direction.ts | 24 ++-- src/i18n/navigation.ts | 8 +- src/i18n/request.ts | 26 ++--- src/i18n/routing.ts | 14 +-- src/i18n/useDirection.ts | 18 +-- src/lib/utils.ts | 12 +- src/proxy.ts | 16 +-- 16 files changed, 239 insertions(+), 240 deletions(-) diff --git a/messages/ar.json b/messages/ar.json index 2e55808..0503f04 100644 --- a/messages/ar.json +++ b/messages/ar.json @@ -1,5 +1,5 @@ -{ - "Home": { - "title": "مرحبا" - } -} +{ + "Home": { + "title": "مرحبا" + } +} diff --git a/messages/en.json b/messages/en.json index 6e88cea..849045a 100644 --- a/messages/en.json +++ b/messages/en.json @@ -1,5 +1,5 @@ -{ - "Home": { - "title": "hello" - } -} +{ + "Home": { + "title": "hello" + } +} diff --git a/messages/fa.json b/messages/fa.json index 9cf9fe4..ef0eebd 100644 --- a/messages/fa.json +++ b/messages/fa.json @@ -1,5 +1,5 @@ -{ - "Home": { - "title": "سلام" - } -} +{ + "Home": { + "title": "سلام" + } +} diff --git a/messages/ku.json b/messages/ku.json index 2e55808..0503f04 100644 --- a/messages/ku.json +++ b/messages/ku.json @@ -1,5 +1,5 @@ -{ - "Home": { - "title": "مرحبا" - } -} +{ + "Home": { + "title": "مرحبا" + } +} diff --git a/next-env.d.ts b/next-env.d.ts index c4b7818..9edff1c 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./.next/dev/types/routes.d.ts"; +import "./.next/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/package.json b/package.json index 8e1a470..1a298fc 100644 --- a/package.json +++ b/package.json @@ -1,50 +1,50 @@ -{ - "name": "cinematales", - "private": true, - "scripts": { - "dev": "next dev", - "build": "next build", - "start": "next start", - "format": "npx prettier . --write" - }, - "dependencies": { - "@types/js-cookie": "^3.0.6", - "@types/web-push": "^3.6.4", - "axios": "^1.15.0", - "clsx": "^2.1.1", - "date-fns": "^4.1.0", - "date-fns-jalali": "4.1.0-0", - "embla-carousel": "^8.6.0", - "embla-carousel-autoplay": "^8.6.0", - "embla-carousel-react": "^8.6.0", - "framer-motion": "^12.38.0", - "js-cookie": "^3.0.5", - "lucide-react": "^1.8.0", - "next": "16.1.6", - "next-intl": "^4.9.1", - "next-pwa": "^5.6.0", - "next-sitemap": "^4.2.3", - "next-themes": "^0.4.6", - "nextjs-toploader": "^3.9.17", - "prettier": "^3.8.2", - "prettier-plugin-tailwindcss": "^0.7.2", - "radix-ui": "^1.4.3", - "react": "19.2.4", - "react-dom": "19.2.4", - "react-hook-form": "^7.72.1", - "react-hot-toast": "^2.6.0", - "tailwind-merge": "^3.5.0", - "tailwind-scrollbar": "^4.0.2", - "web-push": "^3.6.7", - "zustand": "^5.0.12" - }, - "devDependencies": { - "@tailwindcss/postcss": "^4.1.18", - "@types/node": "25.0.10", - "@types/react": "19.2.10", - "@types/react-dom": "19.2.3", - "postcss": "8.5.6", - "tailwindcss": "4.1.18", - "typescript": "5.9.3" - } -} +{ + "name": "ruya", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "format": "npx prettier . --write" + }, + "dependencies": { + "@types/js-cookie": "^3.0.6", + "@types/web-push": "^3.6.4", + "axios": "^1.15.0", + "clsx": "^2.1.1", + "date-fns": "^4.1.0", + "date-fns-jalali": "4.1.0-0", + "embla-carousel": "^8.6.0", + "embla-carousel-autoplay": "^8.6.0", + "embla-carousel-react": "^8.6.0", + "framer-motion": "^12.38.0", + "js-cookie": "^3.0.5", + "lucide-react": "^1.8.0", + "next": "16.1.6", + "next-intl": "^4.9.1", + "next-pwa": "^5.6.0", + "next-sitemap": "^4.2.3", + "next-themes": "^0.4.6", + "nextjs-toploader": "^3.9.17", + "prettier": "^3.8.2", + "prettier-plugin-tailwindcss": "^0.7.2", + "radix-ui": "^1.4.3", + "react": "19.2.4", + "react-dom": "19.2.4", + "react-hook-form": "^7.72.1", + "react-hot-toast": "^2.6.0", + "tailwind-merge": "^3.5.0", + "tailwind-scrollbar": "^4.0.2", + "web-push": "^3.6.7", + "zustand": "^5.0.12" + }, + "devDependencies": { + "@tailwindcss/postcss": "^4.1.18", + "@types/node": "25.0.10", + "@types/react": "19.2.10", + "@types/react-dom": "19.2.3", + "postcss": "8.5.6", + "tailwindcss": "4.1.18", + "typescript": "5.9.3" + } +} diff --git a/src/app/[locale]/page.tsx b/src/app/[locale]/page.tsx index b634e00..3986db6 100644 --- a/src/app/[locale]/page.tsx +++ b/src/app/[locale]/page.tsx @@ -1,14 +1,13 @@ -import ComponentsConteiner from "@/components/ComponentsConteiner"; -import { useTranslations } from "next-intl"; - -export default function Home() { - const t = useTranslations("Home"); - return ( -
-

{t("title")}

-

This project was generated completely offline.

- -
- ); -} - +import ComponentsConteiner from "@/components/ComponentsConteiner"; +import { useTranslations } from "next-intl"; + +export default function Home() { + const t = useTranslations("Home"); + return ( +
+

{t("title")}

+

This project was generated completely offline.

+ +
+ ); +} diff --git a/src/components/ComponentsConteiner.tsx b/src/components/ComponentsConteiner.tsx index d7f5443..bdda848 100644 --- a/src/components/ComponentsConteiner.tsx +++ b/src/components/ComponentsConteiner.tsx @@ -1,27 +1,27 @@ -"use client"; - -import { useState } from "react"; -import PrimaryButton from "./buttons/PrimaryButton"; -import ThemeToggle from "./UI/ThemeToggle"; -import { Home } from "lucide-react"; - -export default function ComponentsConteiner() { - const [isLoading, setIsloading] = useState(false); - function dummyLoading() { - setIsloading(true); - setTimeout(() => { - setIsloading(false); - }, 1500); - } - return ( -
- -
- dummyLoading()} loading={isLoading}> - -

test icon

-
-
-
- ); -} +"use client"; + +import { useState } from "react"; +import PrimaryButton from "./buttons/PrimaryButton"; +import ThemeToggle from "./UI/ThemeToggle"; +import { Home } from "lucide-react"; + +export default function ComponentsConteiner() { + const [isLoading, setIsloading] = useState(false); + function dummyLoading() { + setIsloading(true); + setTimeout(() => { + setIsloading(false); + }, 1500); + } + return ( +
+ +
+ dummyLoading()} loading={isLoading}> + +

test icon

+
+
+
+ ); +} diff --git a/src/components/buttons/PrimaryButton.tsx b/src/components/buttons/PrimaryButton.tsx index 9dacf3c..aabc30b 100644 --- a/src/components/buttons/PrimaryButton.tsx +++ b/src/components/buttons/PrimaryButton.tsx @@ -1,69 +1,69 @@ -"use client"; - -import { cn } from "@/lib/utils"; -import { AnimatePresence, motion } from "framer-motion"; -import { LoaderPinwheel } from "lucide-react"; - -type PrimaryButtonProps = React.ButtonHTMLAttributes & { - loading?: boolean; - children: React.ReactNode; -}; - -export default function PrimaryButton({ children, loading, className, onClick }: PrimaryButtonProps) { - return ( - - ); -} +"use client"; + +import { cn } from "@/lib/utils"; +import { AnimatePresence, motion } from "framer-motion"; +import { LoaderPinwheel } from "lucide-react"; + +type PrimaryButtonProps = React.ButtonHTMLAttributes & { + loading?: boolean; + children: React.ReactNode; +}; + +export default function PrimaryButton({ children, loading, className, onClick }: PrimaryButtonProps) { + return ( + + ); +} diff --git a/src/i18n/direction.ts b/src/i18n/direction.ts index 13102be..5ca8d07 100644 --- a/src/i18n/direction.ts +++ b/src/i18n/direction.ts @@ -1,12 +1,12 @@ -export type Direction = "ltr" | "rtl"; - -export const localeDirectionMap: Record = { - en: "ltr", - ar: "rtl", - ku: "rtl", - fa: "rtl", -}; - -export function getDirection(locale: string): Direction { - return localeDirectionMap[locale] ?? "ltr"; -} +export type Direction = "ltr" | "rtl"; + +export const localeDirectionMap: Record = { + en: "ltr", + ar: "rtl", + ku: "rtl", + fa: "rtl", +}; + +export function getDirection(locale: string): Direction { + return localeDirectionMap[locale] ?? "ltr"; +} diff --git a/src/i18n/navigation.ts b/src/i18n/navigation.ts index 5024e59..4fff38d 100644 --- a/src/i18n/navigation.ts +++ b/src/i18n/navigation.ts @@ -1,4 +1,4 @@ -import { createNavigation } from 'next-intl/navigation' -import { routing } from './routing' - -export const { Link, redirect, usePathname, useRouter, getPathname } = createNavigation(routing) +import { createNavigation } from "next-intl/navigation"; +import { routing } from "./routing"; + +export const { Link, redirect, usePathname, useRouter, getPathname } = createNavigation(routing); diff --git a/src/i18n/request.ts b/src/i18n/request.ts index 76cadd2..047c043 100644 --- a/src/i18n/request.ts +++ b/src/i18n/request.ts @@ -1,13 +1,13 @@ -import { getRequestConfig } from "next-intl/server"; -import { hasLocale } from "next-intl"; -import { routing } from "./routing"; - -export default getRequestConfig(async ({ requestLocale }) => { - const requested = await requestLocale; - const locale = hasLocale(routing.locales, requested) ? requested : routing.defaultLocale; - - return { - locale, - messages: (await import(`../../messages/${locale}.json`)).default, - }; -}); +import { getRequestConfig } from "next-intl/server"; +import { hasLocale } from "next-intl"; +import { routing } from "./routing"; + +export default getRequestConfig(async ({ requestLocale }) => { + const requested = await requestLocale; + const locale = hasLocale(routing.locales, requested) ? requested : routing.defaultLocale; + + return { + locale, + messages: (await import(`../../messages/${locale}.json`)).default, + }; +}); diff --git a/src/i18n/routing.ts b/src/i18n/routing.ts index 066f761..c50b9ea 100644 --- a/src/i18n/routing.ts +++ b/src/i18n/routing.ts @@ -1,7 +1,7 @@ -import { defineRouting } from "next-intl/routing"; - -export const routing = defineRouting({ - locales: ["en", "ar", "ku", "fa"], - defaultLocale: "en", - localePrefix: "never", -}); +import { defineRouting } from "next-intl/routing"; + +export const routing = defineRouting({ + locales: ["en", "ar", "ku", "fa"], + defaultLocale: "en", + localePrefix: "never", +}); diff --git a/src/i18n/useDirection.ts b/src/i18n/useDirection.ts index 875fe61..a9417e8 100644 --- a/src/i18n/useDirection.ts +++ b/src/i18n/useDirection.ts @@ -1,9 +1,9 @@ -'use client' - -import { useLocale } from 'next-intl' -import { Direction, getDirection } from './direction' - -export function useDirection(): Direction { - const locale = useLocale() - return getDirection(locale) -} +"use client"; + +import { useLocale } from "next-intl"; +import { Direction, getDirection } from "./direction"; + +export function useDirection(): Direction { + const locale = useLocale(); + return getDirection(locale); +} diff --git a/src/lib/utils.ts b/src/lib/utils.ts index fed2fe9..9911128 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,6 +1,6 @@ -import { clsx, type ClassValue } from 'clsx' -import { twMerge } from 'tailwind-merge' - -export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)) -} +import { clsx, type ClassValue } from "clsx"; +import { twMerge } from "tailwind-merge"; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +} diff --git a/src/proxy.ts b/src/proxy.ts index 124b978..d7382d8 100644 --- a/src/proxy.ts +++ b/src/proxy.ts @@ -1,8 +1,8 @@ -import createMiddleware from 'next-intl/middleware' -import { routing } from './i18n/routing' - -export default createMiddleware(routing) - -export const config = { - matcher: '/((?!api|trpc|_next|_vercel|.*\\..*).*)', -} +import createMiddleware from "next-intl/middleware"; +import { routing } from "./i18n/routing"; + +export default createMiddleware(routing); + +export const config = { + matcher: "/((?!api|trpc|_next|_vercel|.*\\..*).*)", +};