Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sweepstake
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arjun Jhukal
sweepstake
Commits
848b8481
Commit
848b8481
authored
Mar 12, 2026
by
Arjun Jhukal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated the minor changes
parent
d9843b6e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
24 deletions
+28
-24
page.tsx
...board)/(user)/(outsideAuth)/exclusive-games/[id]/page.tsx
+2
-6
layout.tsx
src/app/(dashboard)/(user)/(privateUser)/layout.tsx
+3
-3
index.tsx
...hboard/games/exclusiveGames/exclusiveGameDetail/index.tsx
+11
-6
ServerPrivate.tsx
src/routes/ServerPrivate.tsx
+3
-9
gameApi.ts
src/services/gameApi.ts
+9
-0
No files found.
src/app/(dashboard)/(user)/(outsideAuth)/exclusive-games/[id]/page.tsx
View file @
848b8481
...
...
@@ -28,10 +28,6 @@ export async function generateMetadata(props: { params: Promise<{ id: string }>
};
}
export
default
async
function
UserGameDetail
(
props
:
{
params
:
Promise
<
{
id
:
string
}
>
})
{
const
{
id
}
=
await
props
.
params
;
const
game
=
await
getSingleGame
(
id
);
return
<
ExclusiveGameDetail
game=
{
game
}
/>;
export
default
async
function
UserGameDetail
()
{
return
<
ExclusiveGameDetail
/>;
}
src/app/(dashboard)/(user)/(privateUser)/layout.tsx
View file @
848b8481
import
DashboardLayout
from
'@/components/layouts/DashboardLayout'
import
ServerPrivate
from
'@/routes/Server
Private'
import
Private
from
'@/routes/
Private'
import
React
from
'react'
export
default
function
PrivateUserLayout
({
children
}:
{
children
:
React
.
ReactNode
})
{
return
(
<
Server
Private
>
<
Private
>
<
DashboardLayout
>
{
children
}
</
DashboardLayout
>
</
Server
Private
>
</
Private
>
)
}
src/components/pages/dashboard/userDashboard/games/exclusiveGames/exclusiveGameDetail/index.tsx
View file @
848b8481
"use client"
;
import
ScreenShotSlider
from
"@/components/molecules/Sliders/ScreenShotSlider"
;
import
CustomLightGallery
from
"@/components/organism/LightGallery"
;
import
ProtectedLink
from
"@/routes/ProtectedLink"
;
import
{
SingleGameResponse
}
from
"@/types/game
"
;
import
{
useGetSingleGameFormUserQuery
}
from
"@/services/gameApi
"
;
import
{
renderHTML
}
from
"@/utils/RenderHTML"
;
import
{
Box
}
from
"@mui/material"
;
import
Image
from
"next/image"
;
import
{
useParams
}
from
"next/navigation"
;
import
GameCredentialsBlock
from
"./GameCredentialsBlock"
;
import
GameIframeDialog
from
"./GameIframeDialog"
;
import
UserCoin
from
"./UserCoin"
;
export
default
function
ExclusiveGameDetail
({
game
}:
{
game
:
SingleGameResponse
})
{
export
default
function
ExclusiveGameDetail
()
{
const
{
id
}
=
useParams
();
const
{
data
:
game
}
=
useGetSingleGameFormUserQuery
({
id
:
Number
(
id
)
},
{
skip
:
!
id
});
if
(
!
game
)
{
return
;
}
return
(
<>
<
section
className=
"detail__banner mb-8"
>
<
div
className=
"md:grid md:grid-cols-12 flex flex-col gap-8 lg:gap-20"
>
<
div
className=
"col-span-12 md:col-span-4"
>
<
div
className=
"aspect-[420/433] relative rounded-xl overflow-hidden mb-4"
>
<
Image
src=
{
game
?.
data
?.
thumbnail
||
"/assets/images/fallback.png"
}
fill
className=
"object-cover "
alt=
{
game
?.
data
?.
name
}
/>
<
Image
src=
{
game
?.
data
?.
thumbnail
||
"/assets/images/fallback.png"
}
fill
className=
"object-cover "
alt=
{
game
?.
data
?.
name
||
""
}
/>
</
div
>
<
GameCredentialsBlock
game=
{
game
}
/>
</
div
>
...
...
@@ -31,7 +36,7 @@ export default function ExclusiveGameDetail({ game }: { game: SingleGameResponse
</
ul
>
<
div
className=
"general-content-box styled-list !text-white"
>
<
h1
className=
"text-[2rem]"
>
{
game
?.
data
?.
name
}
</
h1
>
{
renderHTML
(
game
?.
data
?.
description
)
}
{
renderHTML
(
game
?.
data
?.
description
||
""
)
}
</
div
>
<
div
className=
"action__group flex flex-col lg:grid lg:grid-cols-3 gap-2"
>
...
...
src/routes/ServerPrivate.tsx
View file @
848b8481
...
...
@@ -3,25 +3,19 @@ import { cookies } from "next/headers";
import
React
from
"react"
;
import
ReduxHydrator
from
"./ReduxHydrator"
;
// function decodeJwt(token: string) {
// try {
// return JSON.parse(atob(token.split(".")[1]));
// } catch {
// return null;
// }
// }
export
default
async
function
ServerPrivate
({
children
}:
{
children
:
React
.
ReactNode
})
{
const
cookieStore
=
await
cookies
();
const
access_token
=
cookieStore
.
get
(
"access_token"
)?.
value
;
const
user_cookie
=
cookieStore
.
get
(
"user"
)?.
value
;
const
user
=
user_cookie
?
JSON
.
parse
(
user_cookie
)
:
null
;
if
(
!
access_token
||
!
user
)
return
;
if
(
!
access_token
||
!
user
)
return
;
return
(
<>
{
/* ✅ Hydrate Redux store on client */
}
<
ReduxHydrator
token=
{
access_token
}
user=
{
user
}
/>
<
ReduxHydrator
token=
{
access_token
}
user=
{
user
}
/>
{
children
}
</>
);
...
...
src/services/gameApi.ts
View file @
848b8481
...
...
@@ -44,6 +44,13 @@ export const gameApi = createApi({
}),
providesTags
:
(
result
,
error
,
{
id
})
=>
[{
type
:
"Games"
,
id
}],
}),
getSingleGameFormUser
:
builder
.
query
<
SingleGameResponse
,
{
id
:
string
|
number
}
>
({
query
:
({
id
})
=>
({
url
:
`/api/game/
${
id
}
`
,
method
:
"GET"
,
}),
providesTags
:
(
_result
,
_error
,
{
id
})
=>
[{
type
:
"Games"
,
id
}],
}),
// ✏️ Update game by ID
updateGameById
:
builder
.
mutation
<
...
...
@@ -72,6 +79,7 @@ export const gameApi = createApi({
{
type
:
"Games"
,
id
:
"LIST"
},
],
}),
}),
});
...
...
@@ -81,4 +89,5 @@ export const {
useGetGameByIdQuery
,
useUpdateGameByIdMutation
,
useDeleteGameByIdMutation
,
useGetSingleGameFormUserQuery
}
=
gameApi
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment