-
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.
Merge pull request #94 from game-node-app/dev
Dev
- Loading branch information
Showing
53 changed files
with
1,478 additions
and
87 deletions.
There are no files selected for viewing
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
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
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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React, { PropsWithChildren } from "react"; | ||
import ModerationSidebar from "@/components/admin/moderation/ModerationSidebar"; | ||
import { Box, Group, Stack } from "@mantine/core"; | ||
import SessionAuthWithRoles from "@/components/auth/SessionAuthWithRoles"; | ||
import { EUserRoles } from "@/components/auth/roles"; | ||
import AdminLayoutTabs from "@/components/admin/AdminLayoutTabs"; | ||
|
||
const AdminLayout = ({ children }: PropsWithChildren) => { | ||
return ( | ||
<SessionAuthWithRoles roles={[EUserRoles.MOD, EUserRoles.ADMIN]}> | ||
<Stack className={"w-full h-full flex-wrap justify-start gap-1"}> | ||
<AdminLayoutTabs /> | ||
<Group className={"w-full h-full items-start flex-nowrap"}> | ||
<Box className={"w-full lg:w-3/12"}> | ||
<ModerationSidebar /> | ||
</Box> | ||
<Box className={"w-full lg:w-9/12 mt-4"}>{children}</Box> | ||
</Group> | ||
</Stack> | ||
</SessionAuthWithRoles> | ||
); | ||
}; | ||
|
||
export default AdminLayout; |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { Paper, PaperProps, Tabs } from "@mantine/core"; | ||
import { useRouter } from "next/router"; | ||
import React from "react"; | ||
|
||
interface Props extends PaperProps {} | ||
|
||
const AdminLayoutTabs = ({ ...others }: Props) => { | ||
const router = useRouter(); | ||
const pathName = router.pathname; | ||
|
||
return ( | ||
<Paper | ||
styles={{ | ||
root: { | ||
backgroundColor: "#161616", | ||
}, | ||
}} | ||
className="w-full h-full lg:px-12 py-6" | ||
{...others} | ||
> | ||
<Tabs | ||
onChange={(v) => { | ||
if (v) { | ||
router.push(`/admin/${v}`); | ||
} | ||
}} | ||
classNames={{ | ||
tab: "border-0 data-[active=true]:text-[#DCDCDC] text-[#828282] text-lg", | ||
list: "border-0 before:!content-none", | ||
}} | ||
> | ||
<Tabs.List> | ||
<Tabs.Tab | ||
data-active={pathName.includes("moderation")} | ||
size={"xl"} | ||
value={"moderation"} | ||
> | ||
Moderation | ||
</Tabs.Tab> | ||
<Tabs.Tab | ||
data-active={pathName.includes("achievements")} | ||
size={"xl"} | ||
value={"achievements"} | ||
> | ||
Achievements | ||
</Tabs.Tab> | ||
</Tabs.List> | ||
</Tabs> | ||
</Paper> | ||
); | ||
}; | ||
|
||
export default AdminLayoutTabs; |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from "react"; | ||
import { Paper, Stack, Text } from "@mantine/core"; | ||
import ModerationReportList from "@/components/admin/moderation/list/ModerationReportList"; | ||
|
||
interface Props { | ||
onReportSelected: (reportId: number) => void; | ||
} | ||
|
||
const ModerationSidebar = () => { | ||
return ( | ||
<Stack className={"w-full gap-0"}> | ||
<Paper | ||
className={ | ||
"w-full flex justify-center items-center border-0 rounded-[0] h-[64px]" | ||
} | ||
styles={{ | ||
root: { | ||
backgroundColor: "#202020", | ||
}, | ||
}} | ||
> | ||
<Text className={"text-center"}>Reports</Text> | ||
</Paper> | ||
<ModerationReportList /> | ||
</Stack> | ||
); | ||
}; | ||
|
||
export default ModerationSidebar; |
Oops, something went wrong.