diff --git a/apps/timo-web/app/(main)/focus/_components/.gitkeep b/apps/timo-web/app/[locale]/(main)/focus/_components/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/focus/_components/.gitkeep rename to apps/timo-web/app/[locale]/(main)/focus/_components/.gitkeep diff --git a/apps/timo-web/app/(main)/focus/_containers/.gitkeep b/apps/timo-web/app/[locale]/(main)/focus/_containers/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/focus/_containers/.gitkeep rename to apps/timo-web/app/[locale]/(main)/focus/_containers/.gitkeep diff --git a/apps/timo-web/app/(main)/focus/_queries/.gitkeep b/apps/timo-web/app/[locale]/(main)/focus/_queries/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/focus/_queries/.gitkeep rename to apps/timo-web/app/[locale]/(main)/focus/_queries/.gitkeep diff --git a/apps/timo-web/app/(main)/focus/page.tsx b/apps/timo-web/app/[locale]/(main)/focus/page.tsx similarity index 100% rename from apps/timo-web/app/(main)/focus/page.tsx rename to apps/timo-web/app/[locale]/(main)/focus/page.tsx diff --git a/apps/timo-web/app/(main)/home/_components/HomeDateInformation.tsx b/apps/timo-web/app/[locale]/(main)/home/_components/HomeDateInformation.tsx similarity index 100% rename from apps/timo-web/app/(main)/home/_components/HomeDateInformation.tsx rename to apps/timo-web/app/[locale]/(main)/home/_components/HomeDateInformation.tsx diff --git a/apps/timo-web/app/(main)/home/_components/HomeTodoCard.tsx b/apps/timo-web/app/[locale]/(main)/home/_components/HomeTodoCard.tsx similarity index 96% rename from apps/timo-web/app/(main)/home/_components/HomeTodoCard.tsx rename to apps/timo-web/app/[locale]/(main)/home/_components/HomeTodoCard.tsx index 6a3f0a0c..b820082a 100644 --- a/apps/timo-web/app/(main)/home/_components/HomeTodoCard.tsx +++ b/apps/timo-web/app/[locale]/(main)/home/_components/HomeTodoCard.tsx @@ -18,9 +18,9 @@ import { cn } from "@repo/timo-design-system/utils"; import type { TodoPriorityTypes, TodoTimerStatusTypes, -} from "@/app/(main)/home/_types/todo-type"; +} from "@/app/[locale]/(main)/home/_types/todo-type"; -import { convertDurationToTimeText } from "@/app/(main)/home/_utils/todo-time"; +import { convertDurationToTimeText } from "@/app/[locale]/(main)/home/_utils/todo-time"; const PRIORITY_MAP: Record< TodoPriorityTypes, diff --git a/apps/timo-web/app/(main)/home/_containers/HomeTodoContainer.tsx b/apps/timo-web/app/[locale]/(main)/home/_containers/HomeTodoContainer.tsx similarity index 89% rename from apps/timo-web/app/(main)/home/_containers/HomeTodoContainer.tsx rename to apps/timo-web/app/[locale]/(main)/home/_containers/HomeTodoContainer.tsx index d7c81cc3..05de031a 100644 --- a/apps/timo-web/app/(main)/home/_containers/HomeTodoContainer.tsx +++ b/apps/timo-web/app/[locale]/(main)/home/_containers/HomeTodoContainer.tsx @@ -3,15 +3,15 @@ import { AddTaskButton } from "@repo/timo-design-system/ui"; import { useState } from "react"; -import type { Todo } from "@/app/(main)/home/_types/todo-type"; +import type { Todo } from "@/app/[locale]/(main)/home/_types/todo-type"; -import { HomeDateInformation } from "@/app/(main)/home/_components/HomeDateInformation"; -import { HomeTodoCard } from "@/app/(main)/home/_components/HomeTodoCard"; -import { todoMocks } from "@/app/(main)/home/_mocks/todo-mock"; +import { HomeDateInformation } from "@/app/[locale]/(main)/home/_components/HomeDateInformation"; +import { HomeTodoCard } from "@/app/[locale]/(main)/home/_components/HomeTodoCard"; +import { todoMocks } from "@/app/[locale]/(main)/home/_mocks/todo-mock"; import { convertDateToDateText, convertDateToDayOfWeek, -} from "@/app/(main)/home/_utils/date"; +} from "@/app/[locale]/(main)/home/_utils/date"; export const HomeTodoContainer = () => { const [todos, setTodos] = useState(todoMocks); diff --git a/apps/timo-web/app/(main)/home/_mocks/todo-mock.ts b/apps/timo-web/app/[locale]/(main)/home/_mocks/todo-mock.ts similarity index 96% rename from apps/timo-web/app/(main)/home/_mocks/todo-mock.ts rename to apps/timo-web/app/[locale]/(main)/home/_mocks/todo-mock.ts index 951bdacb..247890a5 100644 --- a/apps/timo-web/app/(main)/home/_mocks/todo-mock.ts +++ b/apps/timo-web/app/[locale]/(main)/home/_mocks/todo-mock.ts @@ -1,4 +1,4 @@ -import { Todo } from "@/app/(main)/home/_types/todo-type"; +import { Todo } from "@/app/[locale]/(main)/home/_types/todo-type"; export const todoMocks: Todo[] = [ { diff --git a/apps/timo-web/app/(main)/home/_queries/.gitkeep b/apps/timo-web/app/[locale]/(main)/home/_queries/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/home/_queries/.gitkeep rename to apps/timo-web/app/[locale]/(main)/home/_queries/.gitkeep diff --git a/apps/timo-web/app/(main)/home/_types/todo-type.ts b/apps/timo-web/app/[locale]/(main)/home/_types/todo-type.ts similarity index 100% rename from apps/timo-web/app/(main)/home/_types/todo-type.ts rename to apps/timo-web/app/[locale]/(main)/home/_types/todo-type.ts diff --git a/apps/timo-web/app/(main)/home/_utils/date.ts b/apps/timo-web/app/[locale]/(main)/home/_utils/date.ts similarity index 100% rename from apps/timo-web/app/(main)/home/_utils/date.ts rename to apps/timo-web/app/[locale]/(main)/home/_utils/date.ts diff --git a/apps/timo-web/app/(main)/home/_utils/todo-time.ts b/apps/timo-web/app/[locale]/(main)/home/_utils/todo-time.ts similarity index 100% rename from apps/timo-web/app/(main)/home/_utils/todo-time.ts rename to apps/timo-web/app/[locale]/(main)/home/_utils/todo-time.ts diff --git a/apps/timo-web/app/(main)/home/page.tsx b/apps/timo-web/app/[locale]/(main)/home/page.tsx similarity index 51% rename from apps/timo-web/app/(main)/home/page.tsx rename to apps/timo-web/app/[locale]/(main)/home/page.tsx index 74f494d3..aea7245f 100644 --- a/apps/timo-web/app/(main)/home/page.tsx +++ b/apps/timo-web/app/[locale]/(main)/home/page.tsx @@ -1,4 +1,4 @@ -import { HomeTodoContainer } from "@/app/(main)/home/_containers/HomeTodoContainer"; +import { HomeTodoContainer } from "@/app/[locale]/(main)/home/_containers/HomeTodoContainer"; export default function HomePage() { return ( diff --git a/apps/timo-web/app/(main)/layout.tsx b/apps/timo-web/app/[locale]/(main)/layout.tsx similarity index 100% rename from apps/timo-web/app/(main)/layout.tsx rename to apps/timo-web/app/[locale]/(main)/layout.tsx diff --git a/apps/timo-web/app/(main)/settings/_components/.gitkeep b/apps/timo-web/app/[locale]/(main)/settings/_components/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/settings/_components/.gitkeep rename to apps/timo-web/app/[locale]/(main)/settings/_components/.gitkeep diff --git a/apps/timo-web/app/(main)/settings/_containers/.gitkeep b/apps/timo-web/app/[locale]/(main)/settings/_containers/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/settings/_containers/.gitkeep rename to apps/timo-web/app/[locale]/(main)/settings/_containers/.gitkeep diff --git a/apps/timo-web/app/(main)/settings/_queries/.gitkeep b/apps/timo-web/app/[locale]/(main)/settings/_queries/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/settings/_queries/.gitkeep rename to apps/timo-web/app/[locale]/(main)/settings/_queries/.gitkeep diff --git a/apps/timo-web/app/(main)/settings/account/_components/.gitkeep b/apps/timo-web/app/[locale]/(main)/settings/account/_components/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/settings/account/_components/.gitkeep rename to apps/timo-web/app/[locale]/(main)/settings/account/_components/.gitkeep diff --git a/apps/timo-web/app/(main)/settings/account/_containers/.gitkeep b/apps/timo-web/app/[locale]/(main)/settings/account/_containers/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/settings/account/_containers/.gitkeep rename to apps/timo-web/app/[locale]/(main)/settings/account/_containers/.gitkeep diff --git a/apps/timo-web/app/(main)/settings/account/_queries/.gitkeep b/apps/timo-web/app/[locale]/(main)/settings/account/_queries/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/settings/account/_queries/.gitkeep rename to apps/timo-web/app/[locale]/(main)/settings/account/_queries/.gitkeep diff --git a/apps/timo-web/app/(main)/settings/account/page.tsx b/apps/timo-web/app/[locale]/(main)/settings/account/page.tsx similarity index 100% rename from apps/timo-web/app/(main)/settings/account/page.tsx rename to apps/timo-web/app/[locale]/(main)/settings/account/page.tsx diff --git a/apps/timo-web/app/(main)/settings/layout.tsx b/apps/timo-web/app/[locale]/(main)/settings/layout.tsx similarity index 100% rename from apps/timo-web/app/(main)/settings/layout.tsx rename to apps/timo-web/app/[locale]/(main)/settings/layout.tsx diff --git a/apps/timo-web/app/(main)/settings/page.tsx b/apps/timo-web/app/[locale]/(main)/settings/page.tsx similarity index 100% rename from apps/timo-web/app/(main)/settings/page.tsx rename to apps/timo-web/app/[locale]/(main)/settings/page.tsx diff --git a/apps/timo-web/app/(main)/settings/policy/_components/.gitkeep b/apps/timo-web/app/[locale]/(main)/settings/policy/_components/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/settings/policy/_components/.gitkeep rename to apps/timo-web/app/[locale]/(main)/settings/policy/_components/.gitkeep diff --git a/apps/timo-web/app/(main)/settings/policy/_containers/.gitkeep b/apps/timo-web/app/[locale]/(main)/settings/policy/_containers/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/settings/policy/_containers/.gitkeep rename to apps/timo-web/app/[locale]/(main)/settings/policy/_containers/.gitkeep diff --git a/apps/timo-web/app/(main)/settings/policy/_queries/.gitkeep b/apps/timo-web/app/[locale]/(main)/settings/policy/_queries/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/settings/policy/_queries/.gitkeep rename to apps/timo-web/app/[locale]/(main)/settings/policy/_queries/.gitkeep diff --git a/apps/timo-web/app/(main)/settings/policy/page.tsx b/apps/timo-web/app/[locale]/(main)/settings/policy/page.tsx similarity index 100% rename from apps/timo-web/app/(main)/settings/policy/page.tsx rename to apps/timo-web/app/[locale]/(main)/settings/policy/page.tsx diff --git a/apps/timo-web/app/(main)/statistics/_components/.gitkeep b/apps/timo-web/app/[locale]/(main)/statistics/_components/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/statistics/_components/.gitkeep rename to apps/timo-web/app/[locale]/(main)/statistics/_components/.gitkeep diff --git a/apps/timo-web/app/(main)/statistics/_containers/.gitkeep b/apps/timo-web/app/[locale]/(main)/statistics/_containers/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/statistics/_containers/.gitkeep rename to apps/timo-web/app/[locale]/(main)/statistics/_containers/.gitkeep diff --git a/apps/timo-web/app/(main)/statistics/_queries/.gitkeep b/apps/timo-web/app/[locale]/(main)/statistics/_queries/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/statistics/_queries/.gitkeep rename to apps/timo-web/app/[locale]/(main)/statistics/_queries/.gitkeep diff --git a/apps/timo-web/app/(main)/statistics/page.tsx b/apps/timo-web/app/[locale]/(main)/statistics/page.tsx similarity index 100% rename from apps/timo-web/app/(main)/statistics/page.tsx rename to apps/timo-web/app/[locale]/(main)/statistics/page.tsx diff --git a/apps/timo-web/app/(main)/today/_components/.gitkeep b/apps/timo-web/app/[locale]/(main)/today/_components/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/today/_components/.gitkeep rename to apps/timo-web/app/[locale]/(main)/today/_components/.gitkeep diff --git a/apps/timo-web/app/(main)/today/_containers/.gitkeep b/apps/timo-web/app/[locale]/(main)/today/_containers/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/today/_containers/.gitkeep rename to apps/timo-web/app/[locale]/(main)/today/_containers/.gitkeep diff --git a/apps/timo-web/app/(main)/today/_queries/.gitkeep b/apps/timo-web/app/[locale]/(main)/today/_queries/.gitkeep similarity index 100% rename from apps/timo-web/app/(main)/today/_queries/.gitkeep rename to apps/timo-web/app/[locale]/(main)/today/_queries/.gitkeep diff --git a/apps/timo-web/app/(main)/today/page.tsx b/apps/timo-web/app/[locale]/(main)/today/page.tsx similarity index 100% rename from apps/timo-web/app/(main)/today/page.tsx rename to apps/timo-web/app/[locale]/(main)/today/page.tsx diff --git a/apps/timo-web/app/globals.css b/apps/timo-web/app/[locale]/globals.css similarity index 100% rename from apps/timo-web/app/globals.css rename to apps/timo-web/app/[locale]/globals.css diff --git a/apps/timo-web/app/[locale]/layout.tsx b/apps/timo-web/app/[locale]/layout.tsx new file mode 100644 index 00000000..a24d698b --- /dev/null +++ b/apps/timo-web/app/[locale]/layout.tsx @@ -0,0 +1,51 @@ +import "./globals.css"; +import localFont from "next/font/local"; +import { notFound } from "next/navigation"; +import { hasLocale, NextIntlClientProvider } from "next-intl"; + +import type { Metadata } from "next"; + +import { routing } from "@/i18n/routing"; +import { QueryProvider } from "@/providers/QueryProvider"; + +const pretendard = localFont({ + src: "../../fonts/PretendardVariable.woff2", + variable: "--font-family-pretendard", + weight: "45 920", + display: "swap", +}); + +export const metadata: Metadata = { + title: "Timo", + description: "Timo web", +}; + +interface RootLayoutProps { + children: React.ReactNode; + params: Promise<{ locale: string }>; +} + +export function generateStaticParams() { + return routing.locales.map((locale) => ({ locale })); +} + +export default async function RootLayout({ + children, + params, +}: Readonly) { + const { locale } = await params; + + if (!hasLocale(routing.locales, locale)) { + notFound(); + } + + return ( + + + + {children} + + + + ); +} diff --git a/apps/timo-web/app/onboarding/_components/.gitkeep b/apps/timo-web/app/[locale]/onboarding/_components/.gitkeep similarity index 100% rename from apps/timo-web/app/onboarding/_components/.gitkeep rename to apps/timo-web/app/[locale]/onboarding/_components/.gitkeep diff --git a/apps/timo-web/app/onboarding/_containers/.gitkeep b/apps/timo-web/app/[locale]/onboarding/_containers/.gitkeep similarity index 100% rename from apps/timo-web/app/onboarding/_containers/.gitkeep rename to apps/timo-web/app/[locale]/onboarding/_containers/.gitkeep diff --git a/apps/timo-web/app/onboarding/_queries/.gitkeep b/apps/timo-web/app/[locale]/onboarding/_queries/.gitkeep similarity index 100% rename from apps/timo-web/app/onboarding/_queries/.gitkeep rename to apps/timo-web/app/[locale]/onboarding/_queries/.gitkeep diff --git a/apps/timo-web/app/onboarding/page.tsx b/apps/timo-web/app/[locale]/onboarding/page.tsx similarity index 100% rename from apps/timo-web/app/onboarding/page.tsx rename to apps/timo-web/app/[locale]/onboarding/page.tsx diff --git a/apps/timo-web/app/page.tsx b/apps/timo-web/app/[locale]/page.tsx similarity index 60% rename from apps/timo-web/app/page.tsx rename to apps/timo-web/app/[locale]/page.tsx index 35f243c3..6ff53738 100644 --- a/apps/timo-web/app/page.tsx +++ b/apps/timo-web/app/[locale]/page.tsx @@ -1,3 +1,3 @@ export default function Home() { - return <>Hi Timo; + return <>; } diff --git a/apps/timo-web/app/layout.tsx b/apps/timo-web/app/layout.tsx deleted file mode 100644 index 7eaac045..00000000 --- a/apps/timo-web/app/layout.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import "./globals.css"; -import localFont from "next/font/local"; - -import type { Metadata } from "next"; - -import { QueryProvider } from "@/providers/QueryProvider"; - -const pretendard = localFont({ - src: "../fonts/PretendardVariable.woff2", - variable: "--font-family-pretendard", - weight: "45 920", - display: "swap", -}); - -export const metadata: Metadata = { - title: "Timo", - description: "Timo web", -}; - -interface RootLayoutProps { - children: React.ReactNode; -} - -export default function RootLayout({ children }: Readonly) { - return ( - - - {children} - - - ); -} diff --git a/apps/timo-web/app/login/page.tsx b/apps/timo-web/app/login/page.tsx deleted file mode 100644 index 428f4881..00000000 --- a/apps/timo-web/app/login/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function LoginPage() { - return <>; -} diff --git a/apps/timo-web/components/layout/sidebar/NavigationSidebar.tsx b/apps/timo-web/components/layout/sidebar/NavigationSidebar.tsx index 57d5ed37..678cbb64 100644 --- a/apps/timo-web/components/layout/sidebar/NavigationSidebar.tsx +++ b/apps/timo-web/components/layout/sidebar/NavigationSidebar.tsx @@ -20,51 +20,56 @@ import { } from "@repo/timo-design-system/icons"; import { TabButton } from "@repo/timo-design-system/ui"; import Image from "next/image"; -import Link from "next/link"; -import { usePathname } from "next/navigation"; +import { useTranslations } from "next-intl"; import { ROUTES } from "@/constants/routes"; +import { Link, usePathname } from "@/i18n/navigation"; const NAV_ITEMS = [ { href: ROUTES.HOME, - label: "홈", + labelKey: "home", OnIcon: HomeOnIcon, OffIcon: HomeOffIcon, HoverIcon: HomeHoverIcon, + className: undefined, }, { href: ROUTES.TODAY, - label: "오늘", + labelKey: "today", OnIcon: TodayOnIcon, OffIcon: TodayOffIcon, HoverIcon: TodayHoverIcon, + className: undefined, }, { href: ROUTES.FOCUS, - label: "집중 모드", + labelKey: "focus", OnIcon: TimerOnIcon, OffIcon: TimerOffIcon, HoverIcon: TimerHoverIcon, + className: undefined, }, { href: ROUTES.STATISTICS, - label: "통계", + labelKey: "statistics", OnIcon: ChartOnIcon, OffIcon: ChartOffIcon, HoverIcon: ChartHoverIcon, + className: undefined, }, { href: ROUTES.SETTINGS, - label: "설정", + labelKey: "settings", OnIcon: SettingOnIcon, OffIcon: SettingOffIcon, HoverIcon: SettingHoverIcon, className: "mt-auto", }, -]; +] as const; export const NavigationSidebar = () => { + const t = useTranslations("Navigation"); const pathname = usePathname(); const isActivePath = (pathname: string, href: string) => pathname === href || pathname.startsWith(`${href}/`); @@ -75,7 +80,7 @@ export const NavigationSidebar = () => { Timo