Skip to content

Commit

Permalink
add back realtime distribution data
Browse files Browse the repository at this point in the history
  • Loading branch information
alelliott committed Jun 14, 2024
1 parent d471397 commit 110a15f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/common/WalletDashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ onMounted(() => {
align-items: center;
height: toRem(48);
padding: 0 toRem(16);
color: var(--text-secondary-light);
transition: var(--transition-duration-fast) var(--transition-timing-default);
border-bottom: toRem(1) solid transparent;
Expand Down
2 changes: 1 addition & 1 deletion src/const/time.const.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const DEFAULT_TIME_FORMAT = 'D MMM YYYY [at] HH:mm'
export const DEFAULT_TIME_FORMAT = 'D MMM YYYY [at] h:mm A'
36 changes: 30 additions & 6 deletions src/pages/HomePage/views/PublicPoolView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ import {
WithdrawModal,
} from '@/common'
import { useI18n, usePool } from '@/composables'
import { DEFAULT_TIME_FORMAT } from '@/const'
import { ICON_NAMES } from '@/enums'
import { useWeb3ProvidersStore } from '@/store'
import type { InfoBarType, InfoDashboardType } from '@/types'
import { formatEther } from '@/utils'
import { formatEther, Time } from '@/utils'
import { computed, ref } from 'vue'
import { ZeroPoolDescription } from '../components'
Expand All @@ -122,6 +123,7 @@ const { t } = useI18n()
const {
currentUserReward,
dailyReward,
poolData,
userPoolData,
Expand All @@ -138,24 +140,46 @@ const web3ProvidersStore = useWeb3ProvidersStore()
const barIndicators = computed<InfoBarType.Indicator[]>(() => [
{
title: t('home-page.public-pool-view.total-deposits-title'),
value: '0 stETH',
value: poolData.value
? `${formatEther(poolData.value.totalDeposited)} stETH`
: '',
},
{
title: t('home-page.public-pool-view.daily-reward-title'),
value: '66,666.60 SPACE',
value: dailyReward.value ? `${formatEther(dailyReward.value)} SPACE` : '',
},
{
title: t('home-page.public-pool-view.started-at-title'),
value: '14 Jun 2024 at 1:11 UTC',
value: poolData.value
? new Time(poolData.value.payoutStart.toNumber()).format(
DEFAULT_TIME_FORMAT,
)
: '',
},
{
title: t('home-page.public-pool-view.withdraw-at-title'),
value: '21 Jun 2024 at 1:11 UTC',
value: poolData.value
? new Time(
userPoolData.value && !userPoolData.value.lastStake.isZero()
? userPoolData.value.lastStake
.add(poolData.value.withdrawLockPeriodAfterStake)
.toNumber()
: poolData.value.payoutStart
.add(poolData.value.withdrawLockPeriod)
.toNumber(),
).format(DEFAULT_TIME_FORMAT)
: '',
note: t('home-page.public-pool-view.withdraw-at-note'),
},
{
title: t('home-page.public-pool-view.claim-at-title'),
value: '12 Sept 2024 at 1:11 UTC',
value: poolData.value
? new Time(
poolData.value.payoutStart
.add(poolData.value.claimLockPeriod)
.toNumber(),
).format(DEFAULT_TIME_FORMAT)
: '',
note: t('home-page.public-pool-view.claim-at-note'),
},
])
Expand Down

0 comments on commit 110a15f

Please sign in to comment.