Skip to content

Commit

Permalink
Rename route
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbar01234 committed Mar 7, 2024
1 parent 62454e4 commit 52d043e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 62 deletions.
31 changes: 0 additions & 31 deletions src/app/private/[uid]/chapter-leader/home/@joinChapter/page.tsx

This file was deleted.

47 changes: 16 additions & 31 deletions src/app/private/[uid]/chapter-leader/home/layout.tsx
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;

0 comments on commit 52d043e

Please sign in to comment.