Commit 7f758c97 by Arjun Jhukal

udpated the credentials value based on type sc or gc

parent f75f34c4
...@@ -12,7 +12,7 @@ export default function PrimaryMenu() { ...@@ -12,7 +12,7 @@ export default function PrimaryMenu() {
return ( return (
<List> <List>
{data ? data?.data?.map((menu: any) => ( {data ? data?.data?.map((menu: any) => (
<ListItem key={menu.name}> <ListItem key={menu?.name}>
{/* <ListItemButton component="a" href={menu.slug ? `/general/${menu.slug}` : "#"}> {/* <ListItemButton component="a" href={menu.slug ? `/general/${menu.slug}` : "#"}>
<ListItemIcon> <ListItemIcon>
<ReceiptEdit size={18} /> <ReceiptEdit size={18} />
...@@ -23,7 +23,7 @@ export default function PrimaryMenu() { ...@@ -23,7 +23,7 @@ export default function PrimaryMenu() {
<ListItemIcon> <ListItemIcon>
<ReceiptEdit size={18} /> <ReceiptEdit size={18} />
</ListItemIcon> </ListItemIcon>
<ListItemText primary={menu.name} /> <ListItemText primary={menu?.name} />
</Link> </Link>
</ListItem> </ListItem>
)) ))
......
...@@ -15,6 +15,8 @@ export default function CredentialsCard({ cred, balance }: { cred: CredentialsPr ...@@ -15,6 +15,8 @@ export default function CredentialsCard({ cred, balance }: { cred: CredentialsPr
const scValue = const scValue =
currentBalance?.type === "sc" ? currentBalance.balance ?? 0 : null; currentBalance?.type === "sc" ? currentBalance.balance ?? 0 : null;
const gcValue =
currentBalance?.type === "gc" ? currentBalance.balance ?? 0 : null;
return ( return (
<Box sx={{ <Box sx={{
borderRadius: "24px", borderRadius: "24px",
...@@ -25,7 +27,8 @@ export default function CredentialsCard({ cred, balance }: { cred: CredentialsPr ...@@ -25,7 +27,8 @@ export default function CredentialsCard({ cred, balance }: { cred: CredentialsPr
<div className="game__detail"> <div className="game__detail">
<strong className='block text-[16px] text-white'>{cred.full_name}</strong> <strong className='block text-[16px] text-white'>{cred.full_name}</strong>
<p className="text-[14px] my-[6px] uppercase"> <p className="text-[14px] my-[6px] uppercase">
{currentBalance.type}: {scValue !== null ? scValue : "N/A"} {currentBalance?.type === "sc" && `sc: ${scValue ?? "N/A"}`}
{currentBalance?.type === "gc" && `gc: ${gcValue ?? "N/A"}`}
</p> </p>
<BalanceRefresh label='Refresh Balance' icon={true} /> <BalanceRefresh label='Refresh Balance' icon={true} />
......
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