mirror of
https://github.com/Steffo99/todocolors.git
synced 2024-11-22 08:14:18 +00:00
Refactor parts of RootMain
into CreateBoardChapter
and ExistingBoardChapter
This commit is contained in:
parent
a8ac2e203f
commit
298aa8ccef
3 changed files with 42 additions and 21 deletions
19
todoblue/src/app/[lang]/(page)/CreateBoardChapter.tsx
Normal file
19
todoblue/src/app/[lang]/(page)/CreateBoardChapter.tsx
Normal 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>
|
||||
)
|
||||
}
|
19
todoblue/src/app/[lang]/(page)/ExistingBoardChapter.tsx
Normal file
19
todoblue/src/app/[lang]/(page)/ExistingBoardChapter.tsx
Normal 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>
|
||||
)
|
||||
}
|
|
@ -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 (
|
||||
<main className={style.pageMain}>
|
||||
<div className={"chapter-2"}>
|
||||
<h2>
|
||||
{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>
|
||||
<CreateBoardChapter lng={lng}/>
|
||||
<ExistingBoardChapter lng={lng}/>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue