Skip to content

Commit

Permalink
feat: added deeplink support for address
Browse files Browse the repository at this point in the history
  • Loading branch information
Kammerlo committed Aug 16, 2024
1 parent 4b43bbd commit 3034822
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const useQuery = () => {
};

const CardanoExplorer = () => {
const acceptedDeepLinks = ["transaction", "block", "epoch"];
const acceptedDeepLinks = ["transaction", "block", "epoch", "address"];
const query = useQuery();
const path = useLocation().pathname.split("/").reverse()[0]
const isDeepLink = acceptedDeepLinks.includes(path);
Expand Down
11 changes: 11 additions & 0 deletions src/common/DeepLinkResolver.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class DeepLinkResolver {
case "transaction":
link += `tx/${this.getValue()}`;
break;
case "address":
link += `address/${this.getValue()}`;
break;
}
return link;
}
Expand All @@ -41,6 +44,9 @@ class DeepLinkResolver {
case "transaction":
link += `transaction/${this.getValue()}`;
break;
case "address":
link += `address/${this.getValue()}`;
break;
}
return link;
}
Expand All @@ -57,6 +63,9 @@ class DeepLinkResolver {
case "transaction":
link += `tx/${this.getValue()}`;
break;
case "address":
link += `address/${this.getValue()}`;
break;
}
return link;
}
Expand All @@ -69,6 +78,8 @@ class DeepLinkResolver {
return this.query.get("id");
case "transaction":
return this.query.get("id");
case "address":
return this.query.get("address");
}
}
}
Expand Down

0 comments on commit 3034822

Please sign in to comment.