Skip to content
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

feat: add contract name in staking reward tooltip #388

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
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,6 +5,7 @@ import { gql, request } from 'graphql-request';
import { z } from 'zod';

import { SUBGRAPH_URL } from '@/constants/urls';
import { POPOVER_WIDTH_MEDIUM } from '@/constants/width';
import { useStakingProgram } from '@/hooks/useStakingProgram';
import { formatToTime } from '@/utils/time';

Expand Down Expand Up @@ -54,21 +55,22 @@ const useEpochEndTime = () => {

export const StakingRewardsThisEpoch = () => {
const { data: epochEndTimeInMs } = useEpochEndTime();
const { activeStakingProgramMeta } = useStakingProgram();

return (
<Text type="secondary">
Staking rewards this epoch&nbsp;
<Popover
arrow={false}
content={
<>
The epoch ends each day at ~{' '}
<div style={{ maxWidth: POPOVER_WIDTH_MEDIUM }}>
The epoch for {activeStakingProgramMeta?.name} ends each day at ~{' '}
<Text className="text-sm" strong>
{epochEndTimeInMs
? `${formatToTime(epochEndTimeInMs * 1000)} (UTC)`
: '--'}
</Text>
</>
</div>
}
>
<InfoCircleOutlined />
Expand Down
2 changes: 2 additions & 0 deletions frontend/constants/width.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export const MODAL_WIDTH = 412;

export const POPOVER_WIDTH_MEDIUM = 260;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool!

Loading