Skip to content

Commit

Permalink
fix order of PieBar
Browse files Browse the repository at this point in the history
  • Loading branch information
mikestarrdev committed Oct 5, 2023
1 parent be0ab8f commit d483e51
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/features/common/utils/formatNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const formatNumber = (
} else {
_number = number;
}

return _number.toLocaleString(window.navigator.language, {
minimumFractionDigits: 0,
maximumFractionDigits: 2,
Expand Down
28 changes: 14 additions & 14 deletions src/features/staking/PieBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ export const PieBar = () => {
const zeroBalance = !unstakablePercent && !stakedPercent && !unstakedPercent;

const stakableData = [
{
color: "transparent",
bg: "checkered-blue",
var: unstaked,
text: "unstaked",
},
{
color: "text-blue-500",
bg: null,
var: unstakable,
text: "unstakable",
},
{
color: "transparent",
bg: "checkered-blue",
var: staked,
text: "staked",
},
{
color: "text-gray-500",
bg: null,
var: unstakable,
text: "unstakable",
var: unstaked,
text: "Not staked",
},
];

Expand All @@ -64,27 +64,27 @@ export const PieBar = () => {
<div className="flex w-full flex-col my-6 gap-4">
<div className="m-auto flex h-2 mb-2 w-full flex-row rounded-full">
<div
style={{ flexBasis: `${unstakedPercent}%` }}
style={{ flexBasis: `${unstakablePercent}%` }}
className={twJoin(
"checkered-blue",
"bg-airswap-blue",
zeroBalance
? "min-w-full rounded-full"
: "min-w-[3px] rounded-l-full",
unstakedPercent &&
unstakablePercent &&
!stakedPercent &&
!unstakablePercent &&
"rounded-full",
)}
/>
<div
style={{ flexBasis: `${stakedPercent}%` }}
className={twJoin("bg-airswap-blue", stakedPercent && "min-w-[3px]")}
className={twJoin("checkered-blue", stakedPercent && "min-w-[3px]")}
/>
<div
style={{ flexBasis: `${unstakablePercent}%` }}
style={{ flexBasis: `${unstakedPercent}%` }}
className={twJoin(
"bg-gray-500",
unstakablePercent && "min-w-[3px] rounded-r-full",
unstakedPercent && "min-w-[3px] rounded-r-full",
)}
/>
</div>
Expand Down

0 comments on commit d483e51

Please sign in to comment.