1
Fork 0
mirror of https://github.com/Steffo99/todocolors.git synced 2024-11-22 16:24:19 +00:00

Refactor parts of RootMain into CreateBoardChapter and ExistingBoardChapter

This commit is contained in:
Steffo 2023-08-08 16:24:01 +02:00
parent a8ac2e203f
commit 298aa8ccef
Signed by: steffo
GPG key ID: 2A24051445686895
3 changed files with 42 additions and 21 deletions

View file

@ -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 (
<div className={"chapter-2"}>
<h2>
{t("createBoardTitle")}
</h2>
<CreatePublicBoardPanel lng={lng}/>
<CreatePrivateBoardPanel lng={lng}/>
</div>
)
}

View file

@ -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 (
<div className={"chapter-2"}>
<h2>
{t("existingBoardTitle")}
</h2>
<KnownBoardsPanel lng={lng}/>
<StarredBoardsPanel lng={lng}/>
</div>
)
}

View file

@ -1,31 +1,14 @@
import {useTranslation} from "@/app/(i18n)/server" import {CreateBoardChapter} from "@/app/[lang]/(page)/CreateBoardChapter"
import {CreatePrivateBoardPanel} from "@/app/[lang]/(page)/CreatePrivateBoardPanel" import {ExistingBoardChapter} from "@/app/[lang]/(page)/ExistingBoardChapter"
import {CreatePublicBoardPanel} from "@/app/[lang]/(page)/CreatePublicBoardPanel"
import {KnownBoardsPanel} from "@/app/[lang]/(page)/KnownBoardsPanel"
import style from "@/app/[lang]/page.module.css" import style from "@/app/[lang]/page.module.css"
import {StarredBoardsPanel} from "@/app/[lang]/(page)/StarredBoardsPanel"
import {default as React} from "react" import {default as React} from "react"
export async function RootMain({lng}: {lng: string}) { export async function RootMain({lng}: {lng: string}) {
const {t} = await useTranslation(lng, "root")
return ( return (
<main className={style.pageMain}> <main className={style.pageMain}>
<div className={"chapter-2"}> <CreateBoardChapter lng={lng}/>
<h2> <ExistingBoardChapter lng={lng}/>
{t("createBoardTitle")}
</h2>
<CreatePublicBoardPanel lng={lng}/>
<CreatePrivateBoardPanel lng={lng}/>
</div>
<div className={"chapter-2"}>
<h2>
{t("existingBoardTitle")}
</h2>
<KnownBoardsPanel lng={lng}/>
<StarredBoardsPanel lng={lng}/>
</div>
</main> </main>
) )
} }