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"; ...@@ -4,6 +4,7 @@ import ProtectedLink from "@/routes/ProtectedLink";
import { getAllGames, getSubGames, getUsp } from "@/serverApi/game"; import { getAllGames, getSubGames, getUsp } from "@/serverApi/game";
import { Tooltip } from "@mui/material"; import { Tooltip } from "@mui/material";
import Image from "next/image"; import Image from "next/image";
import DashboardProvider from "./DashboardProvider";
export default async function Home() { export default async function Home() {
let games = null; let games = null;
...@@ -40,135 +41,137 @@ export default async function Home() { ...@@ -40,135 +41,137 @@ export default async function Home() {
return ( return (
<> <DashboardProvider>
<Dashboard /> <>
<Dashboard />
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4 2xl:grid-cols-5 mb-8"> <div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4 2xl:grid-cols-5 mb-8">
{games?.data?.data.map((game) => ( {games?.data?.data.map((game) => (
<ProtectedLink <ProtectedLink
href={`exclusive-games/${game.id}`} href={`exclusive-games/${game.id}`}
key={game.id} key={game.id}
className="col-span-1 "> className="col-span-1 ">
<div <div
className="flex items-center gap-3 py-2 px-6" className="flex items-center gap-3 py-2 px-6"
style={{ style={{
borderRadius: "24px", borderRadius: "24px",
background: "rgba(255, 255, 255, 0.10)", background: "rgba(255, 255, 255, 0.10)",
}}> }}>
<Image <Image
src={game.thumbnail || "/assets/images/fallback.png"} src={game.thumbnail || "/assets/images/fallback.png"}
alt={game.name} alt={game.name}
width={74} width={74}
height={74} height={74}
className="aspect-[1/1] object-cover group-hover:scale-105 transition-transform duration-300 rounded-full" className="aspect-[1/1] object-cover group-hover:scale-105 transition-transform duration-300 rounded-full"
/> />
<strong className="text-[14px]">{game?.name} </strong> <strong className="text-[14px]">{game?.name} </strong>
</div> </div>
</ProtectedLink> </ProtectedLink>
))} ))}
</div> </div>
<section className="trending__games"> <section className="trending__games">
<h2 className="text-[14px] mb-4">Top 10 Trending Games</h2> <h2 className="text-[14px] mb-4">Top 10 Trending Games</h2>
<div className="grid gap-4 grid-cols-2 md:grid-cols-3 lg:grid-cols-5 2xl:grid-cols-6 mb-8"> <div className="grid gap-4 grid-cols-2 md:grid-cols-3 lg:grid-cols-5 2xl:grid-cols-6 mb-8">
{subGames?.data?.map((game: any) => ( {subGames?.data?.map((game: any) => (
<ProtectedLink <ProtectedLink
href={`exclusive-games/${game.id}`} href={`exclusive-games/${game.id}`}
key={game.name} key={game.name}
className="col-span-1 relative aspect-[1/1]"> className="col-span-1 relative aspect-[1/1]">
<Image <Image
src={game.image_url || "/assets/images/fallback.png"} src={game.image_url || "/assets/images/fallback.png"}
alt={game.name || ""} alt={game.name || ""}
fill fill
className=" rounded-[24px] lg:rounded-[32px] object-cover group-hover:scale-105 transition-transform duration-300 " className=" rounded-[24px] lg:rounded-[32px] object-cover group-hover:scale-105 transition-transform duration-300 "
/> />
</ProtectedLink> </ProtectedLink>
))} ))}
</div> </div>
</section> </section>
<div className="dashboard-card-wrapper grid grid-cols-2 gap-5 justify-center"> <div className="dashboard-card-wrapper grid grid-cols-2 gap-5 justify-center">
<div <div
className="dashboard-card1 flex px-10 gap-2 rounded-[24px]" className="dashboard-card1 flex px-10 gap-2 rounded-[24px]"
style={{ style={{
background: "rgba(255, 255, 255, 0.20)", background: "rgba(255, 255, 255, 0.20)",
}}> }}>
<div className="py-7 gap-6"> <div className="py-7 gap-6">
<h1 <h1
className="text-[40px] mb-[8px]" className="text-[40px] mb-[8px]"
style={{ style={{
color: "#FBD230", color: "#FBD230",
lineHeight: "96%", lineHeight: "96%",
letterSpacing: "-0.682px", letterSpacing: "-0.682px",
}}> }}>
Welcome BONUS!! Welcome BONUS!!
</h1> </h1>
<p <p
className="text-[13px] mb-[12px]" className="text-[13px] mb-[12px]"
style={{ lineHeight: "120%", color: "#FBD230" }}> style={{ lineHeight: "120%", color: "#FBD230" }}>
10$ on first play. 10$ on first play.
</p> </p>
<a <a
href="#" href="#"
className="px-[18px] py-[11px] rounded-[28px]" className="px-[18px] py-[11px] rounded-[28px]"
style={{ style={{
background: background:
"linear-gradient(270deg, #F9B901 0.09%, #D09F12 95.19%)", "linear-gradient(270deg, #F9B901 0.09%, #D09F12 95.19%)",
}}> }}>
Play Now Play Now
</a> </a>
</div> </div>
<div className="dashboard-card-img aspect-[245/245]"> <div className="dashboard-card-img aspect-[245/245]">
<img <img
src="/assets/images/card1.png" src="/assets/images/card1.png"
alt="" alt=""
// className="w-[245px] h-[245px]" // className="w-[245px] h-[245px]"
className="h-auto max-w-full " className="h-auto max-w-full "
style={{ width: "245px", height: "245px" }} style={{ width: "245px", height: "245px" }}
/> />
</div> </div>
</div> </div>
<div <div
className="dashboard-card2 flex px-[45px] gap-2 rounded-[24px]" className="dashboard-card2 flex px-[45px] gap-2 rounded-[24px]"
style={{ style={{
background: "rgba(255, 255, 255, 0.10)", background: "rgba(255, 255, 255, 0.10)",
}}> }}>
<div className="py-[45px] gap-6"> <div className="py-[45px] gap-6">
<h1 <h1
className="text-[40px] mb-[10px]" className="text-[40px] mb-[10px]"
style={{ style={{
color: "#1AF7FE", color: "#1AF7FE",
letterSpacing: "-0.682px", letterSpacing: "-0.682px",
lineHeight: "96%", lineHeight: "96%",
}}> }}>
Easy.Set.Play Easy.Set.Play
</h1> </h1>
<p <p
className="text-[13px] mb-[12px]" className="text-[13px] mb-[12px]"
style={{ color: "#E7BCFE", lineHeight: "120%" }}> style={{ color: "#E7BCFE", lineHeight: "120%" }}>
Join the Fun today. Join the Fun today.
</p> </p>
<a <a
href="#" href="#"
className="px-[18px] py-[11px] rounded-[28px]" className="px-[18px] py-[11px] rounded-[28px]"
style={{ style={{
background: background:
"linear-gradient(270deg, #D620D9 0.09%, #B40EF0 95.19%)", "linear-gradient(270deg, #D620D9 0.09%, #B40EF0 95.19%)",
}}> }}>
Play Now Play Now
</a> </a>
</div> </div>
<div className="dashboard-card-img "> <div className="dashboard-card-img ">
<img <img
src="/assets/images/card2.png" src="/assets/images/card2.png"
alt="" alt=""
// className="w-[245px] h-[245px]" // className="w-[245px] h-[245px]"
className="h-auto max-w-full " className="h-auto max-w-full "
style={{ width: "245px", height: "245px" }} style={{ width: "245px", height: "245px" }}
/> />
</div> </div>
</div> </div>
</div> </div>
<UspSlider uspData={usps.data || []} /> <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