Commit 27eeae72 by Arjun Jhukal

updated the gold coins visibility at game detail

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