Commit a33bf789 by Arjun Jhukal

updated the new changes from client

parent cdfeb8d1
......@@ -4,13 +4,13 @@ import SilverCoinIcon from '@/icons/SilverCoinIcon'
import { useGetUserBalanceQuery } from '@/services/userApi'
import { UserBalance } from '@/types/user'
import { Box, Popper, Paper, Fade, ClickAwayListener, IconButton } from '@mui/material'
import { CloseCircle } from '@wandersonalwes/iconsax-react'
import { CloseCircle, Refresh } from '@wandersonalwes/iconsax-react'
import Image from 'next/image'
import Link from 'next/link'
import React from 'react'
export default function UserCoinCard() {
const { data, isLoading } = useGetUserBalanceQuery();
const { data, isLoading, refetch, isFetching } = useGetUserBalanceQuery();
const [goldCoinPopperOpen, setGoldCoinPopperOpen] = React.useState(false);
const [sweepsCoinPopperOpen, setSweepsCoinPopperOpen] = React.useState(false);
......@@ -65,6 +65,9 @@ export default function UserCoinCard() {
<h2 className="text-[24px] leading-[120%] text-white">{data?.data[1]?.value || 0}</h2>
<p className="text-[11px] text-[rgba(255,255,255,0.8)]">Gold Coins</p>
</div>
<IconButton onClick={() => refetch()} disabled={isLoading || isFetching}>
<Refresh size={20} className={isLoading || isFetching ? 'animate-spin' : ''} />
</IconButton>
</div>
<div className="content">
<p className="text-[11px] text-[rgba(255,255,255,0.8)] mb-6">Gold coins can be used to play all the games under the bonus categories. Enjoy all the bonus games and earn more coins.</p>
......@@ -121,6 +124,9 @@ export default function UserCoinCard() {
<h2 className="text-[24px] leading-[120%] text-white">{data?.data[0]?.value || 0}</h2>
<p className="text-[11px] text-[rgba(255,255,255,0.8)]">Sweeps Coins</p>
</div>
<IconButton onClick={() => refetch()} disabled={isLoading || isFetching}>
<Refresh size={20} className={isLoading || isFetching ? 'animate-spin' : ''} />
</IconButton>
</div>
<div className="flex flex-col gap-3">
......
......@@ -8,7 +8,7 @@ export default function GameCredentialsBlock({ game }: { game: any }) {
const user = useAppSelector((s) => s ? s.auth.user : "");
if (!user) {
return "";
}
}
return (
<div className="game_cred ">
......
......@@ -17,8 +17,6 @@ import GameCredentialsBlock from "./GameCredentialsBlock";
export default function ExclusiveGameDetail({ game }: { game: SingleGameResponse }) {
return (
<>
<section className="detail__banner mb-8">
......@@ -81,7 +79,7 @@ export default function ExclusiveGameDetail({ game }: { game: SingleGameResponse
)
: game?.data?.game_url
? (
<ProtectedLink className="ss-btn bg-primary-grad" href={game.data.game_url} target={game?.data?.has_redirection ? "_blank" : "_self"} rel={game?.data?.has_redirection ? "noopener noreferrer" : ""}>
<ProtectedLink className="ss-btn bg-primary-grad" href={game.data.game_url} target={game?.data?.has_redirection ? true : false} rel={game?.data?.has_redirection ? "noopener noreferrer" : ""}>
Play Now
</ProtectedLink>
)
......@@ -100,7 +98,7 @@ export default function ExclusiveGameDetail({ game }: { game: SingleGameResponse
<div className="section__title">
<h2 className="text-[14px] lg:text-[16px] mb-4">{game?.data?.name}</h2>
</div>
<CustomLightGallery images={game?.data?.subgames} column={7} aspectRatio="aspect-[212/120]" />
<CustomLightGallery images={game?.data?.subgames} column={7} aspectRatio="aspect-[242/242]" />
</section> : ""}
</>
);
......
......@@ -8,7 +8,7 @@ interface Props {
href: string;
className?: string;
children: React.ReactNode;
target?: string;
target?: boolean;
rel?: string;
}
......@@ -18,17 +18,19 @@ export default function ProtectedLink({ href, className, children, target, rel }
const router = useRouter();
const handleClick = (e: React.MouseEvent) => {
if (!user) {
e.preventDefault();
if (user) {
router.push(href);
} else {
// dispatch(openAuthModal());
router.push("/login");
return;
}
if (target) {
return;
}
};
return (
<a href={href} onClick={handleClick} className={className} target={target} rel={rel}>
<a href={href} onClick={handleClick} className={className} target={target ? "_blank" : "_self"} rel={rel}>
{children}
</a>
);
......
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