Skip to content

feat: show different crv emission label with tooltip for sidechains #1139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import { ETHEREUM_CHAIN_ID } from '@/dao/constants'
import networks from '@/dao/networks'
import { GaugeFormattedData } from '@/dao/types/dao.types'
import { getChainIdFromGaugeData } from '@/dao/utils'
import { StyledInformationSquare16 } from '@/dex/components/PagePool/PoolDetails/PoolStats/styles'
import Box from '@ui/Box'
import { ExternalLink } from '@ui/Link'
import { Chip } from '@ui/Typography'
import { convertToLocaleTimestamp, formatDate, formatNumber } from '@ui/utils'
import { t } from '@ui-kit/lib/i18n'
import { shortenAddress } from '@ui-kit/utils'
import { Chain, shortenAddress } from '@ui-kit/utils'

const GaugeDetails = ({ gaugeData, className }: { gaugeData: GaugeFormattedData; className?: string }) => {
const chainId = getChainIdFromGaugeData(gaugeData)
Expand Down Expand Up @@ -60,7 +62,7 @@ const GaugeDetails = ({ gaugeData, className }: { gaugeData: GaugeFormattedData;
<Box flex flexColumn>
<StatsTitleRow>
<h6>{t`Gauge`}</h6>
<h6>{t`Current Week Emissions (CRV)`}</h6>
<h6>{chainId === Chain.Ethereum ? t`Current Week Emissions (CRV)` : t`Next Week Emissions (CRV)`}</h6>
<h6>{t`Created`}</h6>
</StatsTitleRow>
<StatsRow>
Expand All @@ -74,13 +76,24 @@ const GaugeDetails = ({ gaugeData, className }: { gaugeData: GaugeFormattedData;
/>
<CopyIconButton tooltip={t`Copy Gauge Address`} copyContent={gaugeData.address} />
</Box>
<h5>
{gaugeData.emissions
? formatNumber(gaugeData.emissions, {
showDecimalIfSmallNumberOnly: true,
})
: 'N/A'}
</h5>
<Chip
size="md"
tooltip={
chainId !== Chain.Ethereum &&
t`Side chain gauge emissions are on a 1-week delay, as they first have to be accumulated before they can be bridged to the designated chain`
}
>
<h5>
{gaugeData.emissions
? formatNumber(gaugeData.emissions, {
showDecimalIfSmallNumberOnly: true,
})
: 'N/A'}
{chainId !== Chain.Ethereum && (
<StyledInformationSquare16 name="InformationSquare" size={16} className="svg-tooltip" />
)}
</h5>
</Chip>
<h5>{formatDate(new Date(convertToLocaleTimestamp(new Date(gaugeData.creation_date).getTime())), 'long')}</h5>
</StatsRow>
</Box>
Expand Down
Loading