File tree Expand file tree Collapse file tree 3 files changed +3
-135
lines changed Expand file tree Collapse file tree 3 files changed +3
-135
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import React from "react";
2
2
import CopyIcon from "./icons/CopyIcon" ;
3
3
import { mapValues } from "../utils/ObjectHelpers" ;
4
4
import { useCopyToClipboard } from "../utils/useCopyToClipboard" ;
5
- import "@formatjs/intl-durationformat/polyfill" ;
6
5
7
6
// SponsoredFeed interface has the same structure as defined in deployment yaml/json files
8
7
interface SponsoredFeed {
@@ -28,7 +27,8 @@ interface UpdateParamsProps {
28
27
*/
29
28
// Convert time_difference (seconds) to human readable format
30
29
const formatTimeUnit = ( seconds : number ) : { value : number ; unit : string } => {
31
- const duration = new ( Intl as any ) . DurationFormat ( "en" , {
30
+ // @ts -expect-error - Intl.DurationFormat is not a standard type
31
+ const duration = new Intl . DurationFormat ( "en" , {
32
32
style : "long" ,
33
33
numeric : "auto" ,
34
34
} ) ;
@@ -61,7 +61,7 @@ const formatUpdateParams = (feed: SponsoredFeed): string => {
61
61
return `${ timeStr } heartbeat / ${ feed . price_deviation } % price deviation` ;
62
62
} ;
63
63
64
- const UpdateParams : React . FC < UpdateParamsProps > = ( { feed, isDefault } ) => {
64
+ const UpdateParams = ( { feed, isDefault } : UpdateParamsProps ) => {
65
65
const timeFormat = formatTimeUnit ( feed . time_difference ) ;
66
66
const timeStr =
67
67
timeFormat . value === 1 ? timeFormat . unit : `${ timeFormat . unit } s` ;
Original file line number Diff line number Diff line change 16
16
"@codesandbox/sandpack-react" : " ^2.6.1" ,
17
17
"@cookbookdev/docsbot" : " ^4.21.5" ,
18
18
"@cosmjs/cosmwasm-stargate" : " ^0.31.0" ,
19
- "@formatjs/intl-durationformat" : " ^0.7.4" ,
20
19
"@headlessui/react" : " ^1.7.14" ,
21
20
"@metamask/detect-provider" : " ^2.0.0" ,
22
21
"connectkit" : " ^1.4.0" ,
You can’t perform that action at this time.
0 commit comments