build and format
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"Home": {
|
"Home": {
|
||||||
"title": "مرحبا"
|
"title": "مرحبا"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"Home": {
|
"Home": {
|
||||||
"title": "hello"
|
"title": "hello"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"Home": {
|
"Home": {
|
||||||
"title": "سلام"
|
"title": "سلام"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"Home": {
|
"Home": {
|
||||||
"title": "مرحبا"
|
"title": "مرحبا"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
next-env.d.ts
vendored
2
next-env.d.ts
vendored
@@ -1,6 +1,6 @@
|
|||||||
/// <reference types="next" />
|
/// <reference types="next" />
|
||||||
/// <reference types="next/image-types/global" />
|
/// <reference types="next/image-types/global" />
|
||||||
import "./.next/dev/types/routes.d.ts";
|
import "./.next/types/routes.d.ts";
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
// NOTE: This file should not be edited
|
||||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||||
|
|||||||
100
package.json
100
package.json
@@ -1,50 +1,50 @@
|
|||||||
{
|
{
|
||||||
"name": "cinematales",
|
"name": "ruya",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"format": "npx prettier . --write"
|
"format": "npx prettier . --write"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/js-cookie": "^3.0.6",
|
"@types/js-cookie": "^3.0.6",
|
||||||
"@types/web-push": "^3.6.4",
|
"@types/web-push": "^3.6.4",
|
||||||
"axios": "^1.15.0",
|
"axios": "^1.15.0",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"date-fns-jalali": "4.1.0-0",
|
"date-fns-jalali": "4.1.0-0",
|
||||||
"embla-carousel": "^8.6.0",
|
"embla-carousel": "^8.6.0",
|
||||||
"embla-carousel-autoplay": "^8.6.0",
|
"embla-carousel-autoplay": "^8.6.0",
|
||||||
"embla-carousel-react": "^8.6.0",
|
"embla-carousel-react": "^8.6.0",
|
||||||
"framer-motion": "^12.38.0",
|
"framer-motion": "^12.38.0",
|
||||||
"js-cookie": "^3.0.5",
|
"js-cookie": "^3.0.5",
|
||||||
"lucide-react": "^1.8.0",
|
"lucide-react": "^1.8.0",
|
||||||
"next": "16.1.6",
|
"next": "16.1.6",
|
||||||
"next-intl": "^4.9.1",
|
"next-intl": "^4.9.1",
|
||||||
"next-pwa": "^5.6.0",
|
"next-pwa": "^5.6.0",
|
||||||
"next-sitemap": "^4.2.3",
|
"next-sitemap": "^4.2.3",
|
||||||
"next-themes": "^0.4.6",
|
"next-themes": "^0.4.6",
|
||||||
"nextjs-toploader": "^3.9.17",
|
"nextjs-toploader": "^3.9.17",
|
||||||
"prettier": "^3.8.2",
|
"prettier": "^3.8.2",
|
||||||
"prettier-plugin-tailwindcss": "^0.7.2",
|
"prettier-plugin-tailwindcss": "^0.7.2",
|
||||||
"radix-ui": "^1.4.3",
|
"radix-ui": "^1.4.3",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4",
|
"react-dom": "19.2.4",
|
||||||
"react-hook-form": "^7.72.1",
|
"react-hook-form": "^7.72.1",
|
||||||
"react-hot-toast": "^2.6.0",
|
"react-hot-toast": "^2.6.0",
|
||||||
"tailwind-merge": "^3.5.0",
|
"tailwind-merge": "^3.5.0",
|
||||||
"tailwind-scrollbar": "^4.0.2",
|
"tailwind-scrollbar": "^4.0.2",
|
||||||
"web-push": "^3.6.7",
|
"web-push": "^3.6.7",
|
||||||
"zustand": "^5.0.12"
|
"zustand": "^5.0.12"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tailwindcss/postcss": "^4.1.18",
|
"@tailwindcss/postcss": "^4.1.18",
|
||||||
"@types/node": "25.0.10",
|
"@types/node": "25.0.10",
|
||||||
"@types/react": "19.2.10",
|
"@types/react": "19.2.10",
|
||||||
"@types/react-dom": "19.2.3",
|
"@types/react-dom": "19.2.3",
|
||||||
"postcss": "8.5.6",
|
"postcss": "8.5.6",
|
||||||
"tailwindcss": "4.1.18",
|
"tailwindcss": "4.1.18",
|
||||||
"typescript": "5.9.3"
|
"typescript": "5.9.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
import ComponentsConteiner from "@/components/ComponentsConteiner";
|
import ComponentsConteiner from "@/components/ComponentsConteiner";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
const t = useTranslations("Home");
|
const t = useTranslations("Home");
|
||||||
return (
|
return (
|
||||||
<main>
|
<main>
|
||||||
<h1>{t("title")}</h1>
|
<h1>{t("title")}</h1>
|
||||||
<p>This project was generated completely offline.</p>
|
<p>This project was generated completely offline.</p>
|
||||||
<ComponentsConteiner />
|
<ComponentsConteiner />
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import PrimaryButton from "./buttons/PrimaryButton";
|
import PrimaryButton from "./buttons/PrimaryButton";
|
||||||
import ThemeToggle from "./UI/ThemeToggle";
|
import ThemeToggle from "./UI/ThemeToggle";
|
||||||
import { Home } from "lucide-react";
|
import { Home } from "lucide-react";
|
||||||
|
|
||||||
export default function ComponentsConteiner() {
|
export default function ComponentsConteiner() {
|
||||||
const [isLoading, setIsloading] = useState(false);
|
const [isLoading, setIsloading] = useState(false);
|
||||||
function dummyLoading() {
|
function dummyLoading() {
|
||||||
setIsloading(true);
|
setIsloading(true);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setIsloading(false);
|
setIsloading(false);
|
||||||
}, 1500);
|
}, 1500);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-start gap-2 p-4">
|
<div className="flex flex-col items-start gap-2 p-4">
|
||||||
<ThemeToggle />
|
<ThemeToggle />
|
||||||
<div className="w-36">
|
<div className="w-36">
|
||||||
<PrimaryButton onClick={() => dummyLoading()} loading={isLoading}>
|
<PrimaryButton onClick={() => dummyLoading()} loading={isLoading}>
|
||||||
<Home size={20} />
|
<Home size={20} />
|
||||||
<p>test icon</p>
|
<p>test icon</p>
|
||||||
</PrimaryButton>
|
</PrimaryButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,69 +1,69 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { AnimatePresence, motion } from "framer-motion";
|
import { AnimatePresence, motion } from "framer-motion";
|
||||||
import { LoaderPinwheel } from "lucide-react";
|
import { LoaderPinwheel } from "lucide-react";
|
||||||
|
|
||||||
type PrimaryButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
type PrimaryButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function PrimaryButton({ children, loading, className, onClick }: PrimaryButtonProps) {
|
export default function PrimaryButton({ children, loading, className, onClick }: PrimaryButtonProps) {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
className={cn(
|
className={cn(
|
||||||
"bg-primary grid w-full place-items-center overflow-hidden rounded-xl px-4 py-2 text-white hover:scale-102 active:scale-98",
|
"bg-primary grid w-full place-items-center overflow-hidden rounded-xl px-4 py-2 text-white hover:scale-102 active:scale-98",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<AnimatePresence mode="wait">
|
<AnimatePresence mode="wait">
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<motion.div
|
<motion.div
|
||||||
key={"loading"}
|
key={"loading"}
|
||||||
initial={{
|
initial={{
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
x: -80,
|
x: -80,
|
||||||
}}
|
}}
|
||||||
animate={{
|
animate={{
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
x: 0,
|
x: 0,
|
||||||
}}
|
}}
|
||||||
exit={{
|
exit={{
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
x: -80,
|
x: -80,
|
||||||
}}
|
}}
|
||||||
transition={{
|
transition={{
|
||||||
duration: 0.2,
|
duration: 0.2,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<LoaderPinwheel className="animate-spin" />
|
<LoaderPinwheel className="animate-spin" />
|
||||||
</motion.div>
|
</motion.div>
|
||||||
) : (
|
) : (
|
||||||
<motion.div
|
<motion.div
|
||||||
key="content"
|
key="content"
|
||||||
initial={{
|
initial={{
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
x: 80,
|
x: 80,
|
||||||
}}
|
}}
|
||||||
animate={{
|
animate={{
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
x: 0,
|
x: 0,
|
||||||
}}
|
}}
|
||||||
exit={{
|
exit={{
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
x: 80,
|
x: 80,
|
||||||
}}
|
}}
|
||||||
transition={{
|
transition={{
|
||||||
duration: 0.2,
|
duration: 0.2,
|
||||||
}}
|
}}
|
||||||
className="flex items-center justify-center gap-2"
|
className="flex items-center justify-center gap-2"
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
export type Direction = "ltr" | "rtl";
|
export type Direction = "ltr" | "rtl";
|
||||||
|
|
||||||
export const localeDirectionMap: Record<string, Direction> = {
|
export const localeDirectionMap: Record<string, Direction> = {
|
||||||
en: "ltr",
|
en: "ltr",
|
||||||
ar: "rtl",
|
ar: "rtl",
|
||||||
ku: "rtl",
|
ku: "rtl",
|
||||||
fa: "rtl",
|
fa: "rtl",
|
||||||
};
|
};
|
||||||
|
|
||||||
export function getDirection(locale: string): Direction {
|
export function getDirection(locale: string): Direction {
|
||||||
return localeDirectionMap[locale] ?? "ltr";
|
return localeDirectionMap[locale] ?? "ltr";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { createNavigation } from 'next-intl/navigation'
|
import { createNavigation } from "next-intl/navigation";
|
||||||
import { routing } from './routing'
|
import { routing } from "./routing";
|
||||||
|
|
||||||
export const { Link, redirect, usePathname, useRouter, getPathname } = createNavigation(routing)
|
export const { Link, redirect, usePathname, useRouter, getPathname } = createNavigation(routing);
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { getRequestConfig } from "next-intl/server";
|
import { getRequestConfig } from "next-intl/server";
|
||||||
import { hasLocale } from "next-intl";
|
import { hasLocale } from "next-intl";
|
||||||
import { routing } from "./routing";
|
import { routing } from "./routing";
|
||||||
|
|
||||||
export default getRequestConfig(async ({ requestLocale }) => {
|
export default getRequestConfig(async ({ requestLocale }) => {
|
||||||
const requested = await requestLocale;
|
const requested = await requestLocale;
|
||||||
const locale = hasLocale(routing.locales, requested) ? requested : routing.defaultLocale;
|
const locale = hasLocale(routing.locales, requested) ? requested : routing.defaultLocale;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
locale,
|
locale,
|
||||||
messages: (await import(`../../messages/${locale}.json`)).default,
|
messages: (await import(`../../messages/${locale}.json`)).default,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { defineRouting } from "next-intl/routing";
|
import { defineRouting } from "next-intl/routing";
|
||||||
|
|
||||||
export const routing = defineRouting({
|
export const routing = defineRouting({
|
||||||
locales: ["en", "ar", "ku", "fa"],
|
locales: ["en", "ar", "ku", "fa"],
|
||||||
defaultLocale: "en",
|
defaultLocale: "en",
|
||||||
localePrefix: "never",
|
localePrefix: "never",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use client'
|
"use client";
|
||||||
|
|
||||||
import { useLocale } from 'next-intl'
|
import { useLocale } from "next-intl";
|
||||||
import { Direction, getDirection } from './direction'
|
import { Direction, getDirection } from "./direction";
|
||||||
|
|
||||||
export function useDirection(): Direction {
|
export function useDirection(): Direction {
|
||||||
const locale = useLocale()
|
const locale = useLocale();
|
||||||
return getDirection(locale)
|
return getDirection(locale);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { clsx, type ClassValue } from 'clsx'
|
import { clsx, type ClassValue } from "clsx";
|
||||||
import { twMerge } from 'tailwind-merge'
|
import { twMerge } from "tailwind-merge";
|
||||||
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs))
|
return twMerge(clsx(inputs));
|
||||||
}
|
}
|
||||||
|
|||||||
16
src/proxy.ts
16
src/proxy.ts
@@ -1,8 +1,8 @@
|
|||||||
import createMiddleware from 'next-intl/middleware'
|
import createMiddleware from "next-intl/middleware";
|
||||||
import { routing } from './i18n/routing'
|
import { routing } from "./i18n/routing";
|
||||||
|
|
||||||
export default createMiddleware(routing)
|
export default createMiddleware(routing);
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
matcher: '/((?!api|trpc|_next|_vercel|.*\\..*).*)',
|
matcher: "/((?!api|trpc|_next|_vercel|.*\\..*).*)",
|
||||||
}
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user