From d7f152c46ae9d17b6e23d5afbf26d460d38b2476 Mon Sep 17 00:00:00 2001 From: StepanovPlaton Date: Wed, 15 May 2024 16:28:27 +0400 Subject: [PATCH] Learning about modal in next --- src/app/@auth/(.)login/page.tsx | 3 + src/app/@auth/[...catchAll]/page.tsx | 3 + src/app/@auth/default.ts | 3 + src/app/layout.tsx | 33 ++++---- src/app/login/page.tsx | 3 + src/widgets/header/header.tsx | 109 ++++++++++++++------------- 6 files changed, 86 insertions(+), 68 deletions(-) create mode 100644 src/app/@auth/(.)login/page.tsx create mode 100644 src/app/@auth/[...catchAll]/page.tsx create mode 100644 src/app/@auth/default.ts create mode 100644 src/app/login/page.tsx diff --git a/src/app/@auth/(.)login/page.tsx b/src/app/@auth/(.)login/page.tsx new file mode 100644 index 0000000..88c0817 --- /dev/null +++ b/src/app/@auth/(.)login/page.tsx @@ -0,0 +1,3 @@ +export default function Login() { + return <>123; +} diff --git a/src/app/@auth/[...catchAll]/page.tsx b/src/app/@auth/[...catchAll]/page.tsx new file mode 100644 index 0000000..1fd97c2 --- /dev/null +++ b/src/app/@auth/[...catchAll]/page.tsx @@ -0,0 +1,3 @@ +export default function CatchAll() { + return null; +} diff --git a/src/app/@auth/default.ts b/src/app/@auth/default.ts new file mode 100644 index 0000000..6ddf1b7 --- /dev/null +++ b/src/app/@auth/default.ts @@ -0,0 +1,3 @@ +export default function Default() { + return null; +} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index e224137..f104e48 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -6,21 +6,24 @@ import { Header } from "@/widgets/header"; const inter = Inter({ subsets: ["latin"] }); export default function RootLayout({ - children, + auth, + children, }: Readonly<{ - children: React.ReactNode; + auth: React.ReactNode; + children: React.ReactNode; }>) { - return ( - // suppressHydrationWarning for theme support - - - -
-
- {children} -
- - - - ); + return ( + // suppressHydrationWarning for theme support + + + + {auth} +
+
+ {children} +
+ + + + ); } diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx new file mode 100644 index 0000000..0a66c4f --- /dev/null +++ b/src/app/login/page.tsx @@ -0,0 +1,3 @@ +export default function Login() { + return <>login page; +} diff --git a/src/widgets/header/header.tsx b/src/widgets/header/header.tsx index 69581e6..d25772c 100644 --- a/src/widgets/header/header.tsx +++ b/src/widgets/header/header.tsx @@ -8,64 +8,67 @@ import { useSelectedLayoutSegment } from "next/navigation"; import clsx from "clsx"; const sections = [ - { title: "Игры", href: "games" }, - { title: "Фильмы", href: "films" }, - { title: "Аудиокниги", href: "audiobooks" }, + { title: "Игры", href: "games" }, + { title: "Фильмы", href: "films" }, + { title: "Аудиокниги", href: "audiobooks" }, ]; export const Header = () => { - const currentPageName = useSelectedLayoutSegment(); + const currentPageName = useSelectedLayoutSegment(); - return ( -
-
+
-

-
- -
- .Torrent -

-
- {sections.map((section) => ( - - {section.title} - - ))} -
-
- - - - - Войти - - -
-
- ); + > + + Поиск + + + + +
+ ); };