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

fix(CapacitiesTable): fix duration in tooltip #88

Merged
merged 4 commits into from
Sep 16, 2024
Merged

fix(CapacitiesTable): fix duration in tooltip #88

merged 4 commits into from
Sep 16, 2024

Conversation

MixailE
Copy link
Contributor

@MixailE MixailE commented Sep 16, 2024

No description provided.

@MixailE MixailE self-assigned this Sep 16, 2024
Copy link

vercel bot commented Sep 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
network-explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 16, 2024 7:58am
network-explorer-mainnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 16, 2024 7:58am
network-explorer-stage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 16, 2024 7:58am
network-explorer-testnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 16, 2024 7:58am

@vercel vercel bot temporarily deployed to Preview – network-explorer-stage September 16, 2024 07:06 Inactive
@vercel vercel bot temporarily deployed to Preview – network-explorer-testnet September 16, 2024 07:07 Inactive
@vercel vercel bot temporarily deployed to Preview – network-explorer September 16, 2024 07:08 Inactive
@vercel vercel bot temporarily deployed to Preview – network-explorer-mainnet September 16, 2024 07:09 Inactive
@vercel vercel bot temporarily deployed to Preview – network-explorer-stage September 16, 2024 07:49 Inactive
@vercel vercel bot temporarily deployed to Preview – network-explorer-mainnet September 16, 2024 07:50 Inactive
@vercel vercel bot temporarily deployed to Preview – network-explorer-testnet September 16, 2024 07:50 Inactive
@vercel vercel bot temporarily deployed to Preview – network-explorer September 16, 2024 07:51 Inactive
@@ -129,7 +132,7 @@ export const CapacitiesTable: React.FC<CapacitiesTableProps> = ({
<Tooltip trigger={<InfoOutlineIcon />}>
<Text color="grey600" weight={600} size={12}>
Duration capacity commitment in epochs. Currently, one epoch is
set as 24 hours.
set as {formatDistanceToNowStrict(Date.now() + epochDuration)}
Copy link
Member

Choose a reason for hiding this comment

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

I guess you can use just formatDistanceStrict without Date.now()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added formatDuration fn

@vercel vercel bot temporarily deployed to Preview – network-explorer-stage September 16, 2024 07:53 Inactive
@vercel vercel bot temporarily deployed to Preview – network-explorer September 16, 2024 07:54 Inactive
import { formatDistanceStrict } from 'date-fns'

export function formatDuration(duration: number) {
return formatDistanceStrict(Date.now() + duration, Date.now(), {
Copy link
Member

Choose a reason for hiding this comment

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

formatDistanceStrict(duration, 0... will be simplier

@vercel vercel bot temporarily deployed to Preview – network-explorer-mainnet September 16, 2024 07:54 Inactive
@vercel vercel bot temporarily deployed to Preview – network-explorer September 16, 2024 07:56 Inactive
@vercel vercel bot temporarily deployed to Preview – network-explorer-testnet September 16, 2024 07:57 Inactive
@vercel vercel bot temporarily deployed to Preview – network-explorer-stage September 16, 2024 07:58 Inactive
@vercel vercel bot temporarily deployed to Preview – network-explorer-mainnet September 16, 2024 07:58 Inactive
@MixailE MixailE added testnet and removed testnet labels Sep 16, 2024
@MixailE MixailE merged commit f317b47 into main Sep 16, 2024
6 checks passed
@MixailE MixailE deleted the fix-duration branch September 16, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants