Commit 27eeae72 by Arjun Jhukal

updated the gold coins visibility at game detail

parent bd1b5dd7
"use client" "use client"
import GoldCoinIcon from '@/icons/GoldCoinIcon'
import SilverCoinIcon from '@/icons/SilverCoinIcon' import SilverCoinIcon from '@/icons/SilverCoinIcon'
import { useGetUserBalanceBySlugQuery } from '@/services/userApi' import { useGetUserBalanceBySlugQuery } from '@/services/userApi'
import { Box } from '@mui/material' import { Box } from '@mui/material'
...@@ -7,15 +8,16 @@ import React from 'react' ...@@ -7,15 +8,16 @@ import React from 'react'
export default function UserCoin({ slug }: { slug: string }) { export default function UserCoin({ slug }: { slug: string }) {
const { data } = useGetUserBalanceBySlugQuery({ slug }); const { data } = useGetUserBalanceBySlugQuery({ slug });
return ( return (
<Box sx={{ <Box sx={{
background: "linear-gradient(0deg, rgba(234, 47, 231, 0.10) 0%, rgba(234, 47, 231, 0.10) 100%)", background: "linear-gradient(0deg, rgba(234, 47, 231, 0.10) 0%, rgba(234, 47, 231, 0.10) 100%)",
borderRadius: "16px" borderRadius: "16px"
}} className="flex justify-center items-center gap-2 py-4 px-6 glass "> }} className="flex justify-center items-center gap-2 py-4 px-6 glass ">
<SilverCoinIcon /> {slug === "goldcoincity" ? <GoldCoinIcon /> : <SilverCoinIcon />}
<div className="coins"> <div className="coins">
<strong className="text-[16px] leading-4 font-[600] block mb-1">{data?.balance || 0}</strong> <strong className="text-[16px] leading-4 font-[600] block mb-1">{data?.data?.balance || 0}</strong>
<span className="text-[12px] block">Current Sweep Coins</span> <span className="text-[12px] block">{slug === "goldcoincity" ? "Gold Coins" : "Current Sweep Coins"}</span>
</div> </div>
</Box> </Box>
) )
......
...@@ -41,6 +41,7 @@ export default function ExclusiveGameDetail({ game }: { game: SingleGameResponse ...@@ -41,6 +41,7 @@ export default function ExclusiveGameDetail({ game }: { game: SingleGameResponse
<UserCoin slug={game?.data?.provider} /> <UserCoin slug={game?.data?.provider} />
{game?.data?.provider == "goldcoincity" ? "":
<Box sx={{ <Box sx={{
borderRadius: "16px" borderRadius: "16px"
}} className="flex justify-center items-center gap-2 py-4 px-6 bg-secondary-grad text-title ss-btn"> }} className="flex justify-center items-center gap-2 py-4 px-6 bg-secondary-grad text-title ss-btn">
...@@ -49,7 +50,7 @@ export default function ExclusiveGameDetail({ game }: { game: SingleGameResponse ...@@ -49,7 +50,7 @@ export default function ExclusiveGameDetail({ game }: { game: SingleGameResponse
<strong className="text-[16px] leading-4 font-[600] block mb-1">+ Deposit Coins</strong> <strong className="text-[16px] leading-4 font-[600] block mb-1">+ Deposit Coins</strong>
</Link> </Link>
</div> </div>
</Box> </Box>}
{game?.data?.provider == "goldcoincity" ? "" : <Box sx={{ {game?.data?.provider == "goldcoincity" ? "" : <Box sx={{
borderRadius: "16px" borderRadius: "16px"
}} className="flex justify-center items-center gap-2 py-4 px-6 border border-secondary ss-btn"> }} className="flex justify-center items-center gap-2 py-4 px-6 border border-secondary ss-btn">
......
...@@ -33,7 +33,7 @@ export const userApi = createApi({ ...@@ -33,7 +33,7 @@ export const userApi = createApi({
}), }),
providesTags: ['user'] providesTags: ['user']
}), }),
getUserBalanceBySlug: builder.query<{ provider: string; balance: number, flag: string }, { slug: string }>({ getUserBalanceBySlug: builder.query<{ data: { provider: string; balance: number, flag: string } }, { slug: string }>({
query: ({ slug }) => ({ query: ({ slug }) => ({
url: `/api/balance/${slug}`, url: `/api/balance/${slug}`,
method: "GET" method: "GET"
......
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