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