From 298aa8ccef9ab791957fd1bacfdb552c49918748 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 8 Aug 2023 16:24:01 +0200 Subject: [PATCH] Refactor parts of `RootMain` into `CreateBoardChapter` and `ExistingBoardChapter` --- .../app/[lang]/(page)/CreateBoardChapter.tsx | 19 ++++++++++++++ .../[lang]/(page)/ExistingBoardChapter.tsx | 19 ++++++++++++++ todoblue/src/app/[lang]/(page)/RootMain.tsx | 25 +++---------------- 3 files changed, 42 insertions(+), 21 deletions(-) create mode 100644 todoblue/src/app/[lang]/(page)/CreateBoardChapter.tsx create mode 100644 todoblue/src/app/[lang]/(page)/ExistingBoardChapter.tsx diff --git a/todoblue/src/app/[lang]/(page)/CreateBoardChapter.tsx b/todoblue/src/app/[lang]/(page)/CreateBoardChapter.tsx new file mode 100644 index 0000000..8514c89 --- /dev/null +++ b/todoblue/src/app/[lang]/(page)/CreateBoardChapter.tsx @@ -0,0 +1,19 @@ +import {useTranslation} from "@/app/(i18n)/server" +import {CreatePrivateBoardPanel} from "@/app/[lang]/(page)/CreatePrivateBoardPanel" +import {CreatePublicBoardPanel} from "@/app/[lang]/(page)/CreatePublicBoardPanel" +import {default as React} from "react" + + +export async function CreateBoardChapter({lng}: {lng: string}) { + const {t} = await useTranslation(lng, "root") + + return ( +
+

+ {t("createBoardTitle")} +

+ + +
+ ) +} diff --git a/todoblue/src/app/[lang]/(page)/ExistingBoardChapter.tsx b/todoblue/src/app/[lang]/(page)/ExistingBoardChapter.tsx new file mode 100644 index 0000000..fdf2e8a --- /dev/null +++ b/todoblue/src/app/[lang]/(page)/ExistingBoardChapter.tsx @@ -0,0 +1,19 @@ +import {useTranslation} from "@/app/(i18n)/server" +import {KnownBoardsPanel} from "@/app/[lang]/(page)/KnownBoardsPanel" +import {StarredBoardsPanel} from "@/app/[lang]/(page)/StarredBoardsPanel" +import {default as React} from "react" + + +export async function ExistingBoardChapter({lng}: {lng: string}) { + const {t} = await useTranslation(lng, "root") + + return ( +
+

+ {t("existingBoardTitle")} +

+ + +
+ ) +} diff --git a/todoblue/src/app/[lang]/(page)/RootMain.tsx b/todoblue/src/app/[lang]/(page)/RootMain.tsx index 965a197..be7845e 100644 --- a/todoblue/src/app/[lang]/(page)/RootMain.tsx +++ b/todoblue/src/app/[lang]/(page)/RootMain.tsx @@ -1,31 +1,14 @@ -import {useTranslation} from "@/app/(i18n)/server" -import {CreatePrivateBoardPanel} from "@/app/[lang]/(page)/CreatePrivateBoardPanel" -import {CreatePublicBoardPanel} from "@/app/[lang]/(page)/CreatePublicBoardPanel" -import {KnownBoardsPanel} from "@/app/[lang]/(page)/KnownBoardsPanel" +import {CreateBoardChapter} from "@/app/[lang]/(page)/CreateBoardChapter" +import {ExistingBoardChapter} from "@/app/[lang]/(page)/ExistingBoardChapter" import style from "@/app/[lang]/page.module.css" -import {StarredBoardsPanel} from "@/app/[lang]/(page)/StarredBoardsPanel" import {default as React} from "react" export async function RootMain({lng}: {lng: string}) { - const {t} = await useTranslation(lng, "root") - return (
-
-

- {t("createBoardTitle")} -

- - -
-
-

- {t("existingBoardTitle")} -

- - -
+ +
) }