Commit 3c4fd8f7 by Arjun Jhukal

updated the minor changes like updated the dashboard

parent 7f087b39
"use client"
import { useAppSelector } from '@/hooks/hook'
import React from 'react'
export default function DashboardProvider({ children }: { children: React.ReactNode }) {
const user = useAppSelector(state => state.auth.user);
if (user?.role && user.role.toUpperCase() === "ADMIN") {
return <>
<h1>Admin Dashboard</h1>
</>
}
return (
<div>{children}</div>
)
}
......@@ -4,6 +4,7 @@ import ProtectedLink from "@/routes/ProtectedLink";
import { getAllGames, getSubGames, getUsp } from "@/serverApi/game";
import { Tooltip } from "@mui/material";
import Image from "next/image";
import DashboardProvider from "./DashboardProvider";
export default async function Home() {
let games = null;
......@@ -40,6 +41,7 @@ export default async function Home() {
return (
<DashboardProvider>
<>
<Dashboard />
......@@ -170,5 +172,6 @@ export default async function Home() {
</div>
<UspSlider uspData={usps.data || []} />
</>
</DashboardProvider>
);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment