Skip to content

Commit

Permalink
Merge pull request #9 from CardanoExplorer/main
Browse files Browse the repository at this point in the history
Add AdaStat deeplinks
  • Loading branch information
fabianbormann authored Sep 4, 2024
2 parents ea4a6a5 + 936764d commit 0b9d8b9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ const CardanoExplorer = () => {
name: "AdaStat",
description:
"Ideal for analysts and researcher who need to advanced statistical analyses and network monitoring.",
url: "https://adastat.net/",
url: deepLinkResolver.getAdaStatLink("https://adastat.net/"),
image: adaStatLogo,
isDeepLink: false,
isDeepLink: true,
},
explorer: {
name: "Explorer (Beta)",
Expand Down Expand Up @@ -305,4 +305,4 @@ function App() {
);
}

export default App;
export default App;
19 changes: 19 additions & 0 deletions src/common/DeepLinkResolver.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,25 @@ class DeepLinkResolver {
return link;
}

getAdaStatLink(baseLink) {
var link = baseLink;
switch (this.mode) {
case "epoch":
link += `epochs/${this.getValue()}`;
break;
case "block":
link += `blocks/${this.getValue()}`;
break;
case "transaction":
link += `transactions/${this.getValue()}`;
break;
case "address":
link += `addresses/${this.getValue()}`;
break;
}
return link;
}

getValue() {
switch (this.mode) {
case "epoch":
Expand Down

0 comments on commit 0b9d8b9

Please sign in to comment.