From b87d6cd03db296e54eb33a05db921525ad673091 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Jan 2021 09:40:56 +0800 Subject: [PATCH] chore:(deps): bump typescript from 4.0.5 to 4.1.3 in /explorer (#14284) * chore:(deps): bump typescript from 4.0.5 to 4.1.3 in /explorer Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.0.5 to 4.1.3. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.0.5...v4.1.3) Signed-off-by: dependabot[bot] * bump Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Justin Starry --- explorer/.gitignore | 1 + explorer/package-lock.json | 6 +- explorer/package.json | 2 +- explorer/src/App.tsx | 1 - explorer/src/components/UnlockAlert.tsx | 97 ------------------------- explorer/tsconfig.json | 2 +- 6 files changed, 6 insertions(+), 103 deletions(-) delete mode 100644 explorer/src/components/UnlockAlert.tsx diff --git a/explorer/.gitignore b/explorer/.gitignore index 4d29575de..00ec607c8 100644 --- a/explorer/.gitignore +++ b/explorer/.gitignore @@ -17,6 +17,7 @@ .env.development.local .env.test.local .env.production.local +.eslintcache npm-debug.log* yarn-debug.log* diff --git a/explorer/package-lock.json b/explorer/package-lock.json index d416e8d67..db1984ee5 100644 --- a/explorer/package-lock.json +++ b/explorer/package-lock.json @@ -18334,9 +18334,9 @@ } }, "typescript": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz", - "integrity": "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==" + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", + "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==" }, "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", diff --git a/explorer/package.json b/explorer/package.json index b97cd71ab..0e1834467 100644 --- a/explorer/package.json +++ b/explorer/package.json @@ -39,7 +39,7 @@ "react-scripts": "^4.0.1", "react-select": "^3.1.1", "superstruct": "github:solana-labs/superstruct", - "typescript": "^4.0.5" + "typescript": "^4.1.3" }, "scripts": { "start": "react-scripts start", diff --git a/explorer/src/App.tsx b/explorer/src/App.tsx index 0f2799fb7..be665a6be 100644 --- a/explorer/src/App.tsx +++ b/explorer/src/App.tsx @@ -12,7 +12,6 @@ import { ClusterStatsPage } from "pages/ClusterStatsPage"; import { SupplyPage } from "pages/SupplyPage"; import { TransactionDetailsPage } from "pages/TransactionDetailsPage"; import { BlockDetailsPage } from "pages/BlockDetailsPage"; -import { UnlockAlert } from "components/UnlockAlert"; const ADDRESS_ALIASES = ["account", "accounts", "addresses"]; const TX_ALIASES = ["txs", "txn", "txns", "transaction", "transactions"]; diff --git a/explorer/src/components/UnlockAlert.tsx b/explorer/src/components/UnlockAlert.tsx deleted file mode 100644 index 97fd02317..000000000 --- a/explorer/src/components/UnlockAlert.tsx +++ /dev/null @@ -1,97 +0,0 @@ -import React from "react"; - -import { Connection } from "@solana/web3.js"; -import { useCluster, Cluster } from "providers/cluster"; - -const CLUSTER_SYNC_INTERVAL = 30000; - -export function displayTimestamp(unixTimestamp: number): string { - const expireDate = new Date(unixTimestamp); - const dateString = new Intl.DateTimeFormat("en-US", { - year: "numeric", - month: "long", - day: "numeric", - timeZone: "UTC", - }).format(expireDate); - const timeString = new Intl.DateTimeFormat("en-US", { - hour: "numeric", - minute: "numeric", - hour12: false, - timeZone: "UTC", - }).format(expireDate); - return `${dateString} ${timeString}`; -} - -export function UnlockAlert() { - const { cluster, url } = useCluster(); - const [active, setActive] = React.useState(false); - const [blockTime, setBlockTime] = React.useState(null); - - React.useEffect(() => { - if (!active || !url) { - return; - } - - const connection = new Connection(url); - const getBlockTime = async () => { - try { - const epochInfo = await connection.getEpochInfo(); - const blockTime = await connection.getBlockTime(epochInfo.absoluteSlot); - if (blockTime !== null) { - setBlockTime(blockTime); - } - } catch (error) {} - }; - - getBlockTime(); - - const blockTimeInterval = setInterval(getBlockTime, CLUSTER_SYNC_INTERVAL); - const secondInterval = setInterval(() => { - setBlockTime((time) => (time !== null ? time + 1 : null)); - }, 1000); - - return () => { - clearInterval(blockTimeInterval); - clearInterval(secondInterval); - }; - }, [active, url]); - - React.useEffect(() => { - if (cluster !== Cluster.MainnetBeta) { - return; - } - - setActive(true); - return () => { - setActive(false); - }; - }, [setActive, cluster]); - - if (cluster !== Cluster.MainnetBeta || blockTime === null) { - return null; - } - - return ( -
-

- An unlock event is scheduled for January 7, 2021 00:00 cluster time. -

-

- Cluster time is currently {displayTimestamp(blockTime * 1000)}. -

-

- More information can be found{" "} - - - here - - - . -

-
- ); -} diff --git a/explorer/tsconfig.json b/explorer/tsconfig.json index b5b96a953..8d11498dd 100644 --- a/explorer/tsconfig.json +++ b/explorer/tsconfig.json @@ -13,7 +13,7 @@ "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, - "jsx": "react", + "jsx": "react-jsx", "baseUrl": "src", "noFallthroughCasesInSwitch": true },