forked from JumboCode/TheLegacyProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62454e4
commit 52d043e
Showing
2 changed files
with
16 additions
and
62 deletions.
There are no files selected for viewing
31 changes: 0 additions & 31 deletions
31
src/app/private/[uid]/chapter-leader/home/@joinChapter/page.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,27 @@ | ||
import { prisma } from "@server/db/client"; | ||
import TabButtons from "@components/TabButtons"; | ||
import { HeaderContainer } from "@components/container/index"; | ||
import { faHouse } from "@fortawesome/free-solid-svg-icons"; | ||
|
||
interface LayoutProps { | ||
children: React.ReactNode; | ||
joinChapter: React.ReactNode; | ||
params: { | ||
uid: string; | ||
}; | ||
} | ||
|
||
const Layout = async ({ children, params, joinChapter }: LayoutProps) => { | ||
const user = await prisma.user.findFirstOrThrow({ | ||
where: { | ||
id: params.uid, | ||
}, | ||
}); | ||
|
||
if (user.ChapterID != null) { | ||
return ( | ||
<HeaderContainer | ||
header="Home" | ||
headerIcon={faHouse} | ||
showHorizontalLine={false} | ||
> | ||
<TabButtons | ||
queries={[ | ||
{ segment: "home", name: "My Chapter" }, | ||
{ segment: "home/resources", name: "resources" }, | ||
]} | ||
/> | ||
{children} | ||
</HeaderContainer> | ||
); | ||
} else { | ||
return joinChapter; | ||
} | ||
const Layout = async ({ children }: LayoutProps) => { | ||
return ( | ||
<HeaderContainer | ||
header="Home" | ||
headerIcon={faHouse} | ||
showHorizontalLine={false} | ||
> | ||
<TabButtons | ||
queries={[ | ||
{ segment: "home", name: "My Chapter" }, | ||
{ segment: "home/resources", name: "resources" }, | ||
]} | ||
/> | ||
{children} | ||
</HeaderContainer> | ||
); | ||
}; | ||
|
||
export default Layout; |