Skip to content

Commit 1e62312

Browse files
committed
not use Readt.FS, remove type cast and no polyfil
1 parent 9647761 commit 1e62312

File tree

3 files changed

+3
-135
lines changed

3 files changed

+3
-135
lines changed

components/SponsoredFeedsTableWithData.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from "react";
22
import CopyIcon from "./icons/CopyIcon";
33
import { mapValues } from "../utils/ObjectHelpers";
44
import { useCopyToClipboard } from "../utils/useCopyToClipboard";
5-
import "@formatjs/intl-durationformat/polyfill";
65

76
// SponsoredFeed interface has the same structure as defined in deployment yaml/json files
87
interface SponsoredFeed {
@@ -28,7 +27,8 @@ interface UpdateParamsProps {
2827
*/
2928
// Convert time_difference (seconds) to human readable format
3029
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", {
3232
style: "long",
3333
numeric: "auto",
3434
});
@@ -61,7 +61,7 @@ const formatUpdateParams = (feed: SponsoredFeed): string => {
6161
return `${timeStr} heartbeat / ${feed.price_deviation}% price deviation`;
6262
};
6363

64-
const UpdateParams: React.FC<UpdateParamsProps> = ({ feed, isDefault }) => {
64+
const UpdateParams = ({ feed, isDefault }: UpdateParamsProps) => {
6565
const timeFormat = formatTimeUnit(feed.time_difference);
6666
const timeStr =
6767
timeFormat.value === 1 ? timeFormat.unit : `${timeFormat.unit}s`;

package-lock.json

Lines changed: 0 additions & 131 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"@codesandbox/sandpack-react": "^2.6.1",
1717
"@cookbookdev/docsbot": "^4.21.5",
1818
"@cosmjs/cosmwasm-stargate": "^0.31.0",
19-
"@formatjs/intl-durationformat": "^0.7.4",
2019
"@headlessui/react": "^1.7.14",
2120
"@metamask/detect-provider": "^2.0.0",
2221
"connectkit": "^1.4.0",

0 commit comments

Comments
 (0)