Skip to content

Commit

Permalink
explorer: bump react-router type deps and fix type errors (solana-lab…
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarry authored Sep 29, 2022
1 parent 2c49bc9 commit 816940c
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 58 deletions.
90 changes: 45 additions & 45 deletions explorer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@types/node": "^18.0.3",
"@types/react": "^18.0.8",
"@types/react-dom": "^18.0.6",
"@types/react-router-dom": "^5.3.2",
"@types/react-router-dom": "^5.3.3",
"@types/react-select": "^3.1.2",
"@types/socket.io-client": "^3.0.0",
"chai": "^4.3.6",
Expand Down
29 changes: 17 additions & 12 deletions explorer/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ function App() {
<Route
exact
path={["/tx/inspector", "/tx/:signature/inspect"]}
render={({ match }) => (
<TransactionInspectorPage signature={match.params.signature} />
)}
render={({ match }) => {
const signature =
"signature" in match.params
? match.params.signature
: undefined;
return <TransactionInspectorPage signature={signature} />;
}}
/>
<Route
exact
Expand All @@ -61,9 +65,10 @@ function App() {
<Route
exact
path={["/block/:id", "/block/:id/:tab"]}
render={({ match }) => (
<BlockDetailsPage slot={match.params.id} tab={match.params.tab} />
)}
render={({ match }) => {
const tab = "tab" in match.params ? match.params.tab : undefined;
return <BlockDetailsPage slot={match.params.id} tab={tab} />;
}}
/>
<Route
exact
Expand All @@ -82,12 +87,12 @@ function App() {
<Route
exact
path={["/address/:address", "/address/:address/:tab"]}
render={({ match }) => (
<AccountDetailsPage
address={match.params.address}
tab={match.params.tab}
/>
)}
render={({ match }) => {
const tab = "tab" in match.params ? match.params.tab : undefined;
return (
<AccountDetailsPage address={match.params.address} tab={tab} />
);
}}
/>
<Route exact path="/">
<ClusterStatsPage />
Expand Down

0 comments on commit 816940c

Please sign in to comment.