Skip to content

Commit

Permalink
feat: add a check on the isFinished
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Jul 29, 2024
1 parent 2e2ae9b commit 707d30d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 18 deletions.
8 changes: 5 additions & 3 deletions components/v1/ListViewVault.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ export function ListViewVault(props: TVaultUIProps): ReactElement {
<span
suppressHydrationWarning
className={'col-span-2 flex flex-col gap-2'}>
{`${formatWithUnit(Number(onChainData?.weeklyStakingRewards || 0), 0, 0, {
locales: ['en-US']
})}/week`}
{onChainData?.weeklyStakingRewards === 0
? 'None'
: `${formatWithUnit(Number(onChainData?.weeklyStakingRewards || 0), 0, 0, {
locales: ['en-US']
})}/week`}
<span
suppressHydrationWarning
className={'col-span-2 text-xs font-normal text-neutral-700'}>
Expand Down
16 changes: 10 additions & 6 deletions components/v1/StakerWithReward.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,11 @@ function DesktopStats(props: {vault: TVaultData}): ReactElement {
<b
suppressHydrationWarning
className={'block break-all text-3xl text-neutral-900'}>
{`${formatWithUnit(Number(props.vault.onChainData?.weeklyStakingRewards || 0), 0, 0, {
locales: ['en-US']
})}/week`}
{props.vault.onChainData?.weeklyStakingRewards || 0 === 0
? 'None'
: `${formatWithUnit(Number(props.vault.onChainData?.weeklyStakingRewards || 0), 0, 0, {
locales: ['en-US']
})}/week`}
</b>
</div>
<div className={'rounded-lg border-2 border-neutral-900 bg-beige p-4 leading-4'}>
Expand Down Expand Up @@ -520,9 +522,11 @@ function MobileStats(props: {vault: TVaultData}): ReactElement {
<b
className={'block text-neutral-900'}
suppressHydrationWarning>
{`${formatWithUnit(Number(props.vault.onChainData?.weeklyStakingRewards || 0), 0, 0, {
locales: ['en-US']
})}/week`}
{props.vault.onChainData?.weeklyStakingRewards || 0 === 0
? 'None'
: `${formatWithUnit(Number(props.vault.onChainData?.weeklyStakingRewards || 0), 0, 0, {
locales: ['en-US']
})}/week`}
</b>
</div>
<div className={'flex items-center justify-between'}>
Expand Down
8 changes: 5 additions & 3 deletions components/v2/ListViewVault.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ export function ListViewVault(props: TVaultUIProps): ReactElement {
<span
suppressHydrationWarning
className={'col-span-2 flex flex-col gap-2'}>
{`${formatWithUnit(Number(onChainData?.weeklyStakingRewards || 0), 0, 0, {
locales: ['en-US']
})}/week`}
{onChainData?.weeklyStakingRewards === 0
? 'None'
: `${formatWithUnit(Number(onChainData?.weeklyStakingRewards || 0), 0, 0, {
locales: ['en-US']
})}/week`}
<span
suppressHydrationWarning
className={'col-span-2 text-xs font-normal text-neutral-700'}>
Expand Down
16 changes: 10 additions & 6 deletions components/v2/StakerWithReward.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,11 @@ function DesktopStats(props: {vault: TVaultData}): ReactElement {
<b
suppressHydrationWarning
className={'block break-all text-3xl text-neutral-900'}>
{`${formatWithUnit(Number(props.vault.onChainData?.weeklyStakingRewards || 0), 0, 0, {
locales: ['en-US']
})}/week`}
{props.vault.onChainData?.weeklyStakingRewards || 0 === 0
? 'None'
: `${formatWithUnit(Number(props.vault.onChainData?.weeklyStakingRewards || 0), 0, 0, {
locales: ['en-US']
})}/week`}
</b>
</div>
<div className={'rounded-lg border-2 border-neutral-900 bg-beige p-4 leading-4'}>
Expand Down Expand Up @@ -485,9 +487,11 @@ function MobileStats(props: {vault: TVaultData}): ReactElement {
<b
className={'block text-neutral-900'}
suppressHydrationWarning>
{`${formatWithUnit(Number(props.vault.onChainData?.weeklyStakingRewards || 0), 0, 0, {
locales: ['en-US']
})}/week`}
{props.vault.onChainData?.weeklyStakingRewards || 0 === 0
? 'None'
: `${formatWithUnit(Number(props.vault.onChainData?.weeklyStakingRewards || 0), 0, 0, {
locales: ['en-US']
})}/week`}
</b>
</div>
<div className={'flex items-center justify-between'}>
Expand Down

0 comments on commit 707d30d

Please sign in to comment.