fix(gui): Display amounts correctly (as pool.percentage is between 0 and 1)

This commit is contained in:
Binarybaron 2025-06-26 11:20:25 +02:00
parent d491452fb3
commit b2c2c93d53

View file

@ -261,21 +261,21 @@ const PoolBreakdown = ({
display: "flex", display: "flex",
justifyContent: "flex-start", justifyContent: "flex-start",
alignItems: "stretch", alignItems: "stretch",
padding: pool.percentage >= 5 ? 1.5 : 1.2, padding: pool.percentage >= 0.05 ? 1.5 : 1.2,
border: 1, border: 1,
borderColor: borderColor:
pool.percentage >= 5 ? "success.main" : "success.light", pool.percentage >= 0.05 ? "success.main" : "success.light",
borderRadius: 1, borderRadius: 1,
backgroundColor: (theme) => backgroundColor: (theme) =>
pool.percentage >= 5 pool.percentage >= 0.05
? theme.palette.success.light + "10" ? theme.palette.success.light + "10"
: theme.palette.action.hover, : theme.palette.action.hover,
width: "100%", // Ensure full width width: "100%", // Ensure full width
minWidth: 0, minWidth: 0,
opacity: pool.percentage >= 5 ? 1 : 0.75, opacity: pool.percentage >= 0.05 ? 1 : 0.75,
transform: pool.percentage >= 5 ? "scale(1)" : "scale(0.95)", transform: pool.percentage >= 0.05 ? "scale(1)" : "scale(0.95)",
animation: animation:
pool.percentage >= 5 pool.percentage >= 0.05
? "poolPulse 2s ease-in-out infinite" ? "poolPulse 2s ease-in-out infinite"
: "none", : "none",
"@keyframes poolPulse": { "@keyframes poolPulse": {
@ -337,7 +337,7 @@ const PoolBreakdown = ({
justifyContent: "center", justifyContent: "center",
}} }}
> >
{pool.percentage >= 5 && ( {pool.percentage >= 0.05 && (
<Typography <Typography
variant="body2" variant="body2"
sx={(theme) => ({ sx={(theme) => ({
@ -348,7 +348,7 @@ const PoolBreakdown = ({
})} })}
> >
<PiconeroAmount <PiconeroAmount
amount={(pool.percentage * Number(xmr_receive_amount)) / 100} amount={pool.percentage * Number(xmr_receive_amount)}
/> />
</Typography> </Typography>
)} )}
@ -359,7 +359,7 @@ const PoolBreakdown = ({
whiteSpace: "nowrap", whiteSpace: "nowrap",
})} })}
> >
{pool.percentage}% {pool.percentage * 100}%
</Typography> </Typography>
</Box> </Box>
</Box> </Box>
@ -442,9 +442,7 @@ const MoneroMainBox = ({
> >
<PiconeroAmount <PiconeroAmount
amount={ amount={
(highestPercentagePool.percentage * highestPercentagePool.percentage * Number(xmr_receive_amount)
Number(xmr_receive_amount)) /
100
} }
/> />
</Typography> </Typography>