Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added voi explorer links #49

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions app/app-sandbox/src/pages/TokenAddress/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ const Token = ({ address, token, transactions }) => {
<code style={{ display: "inline-block" }}>
{token.appId && (
<span>
Id: <Link to={`/token/${token.appId}`}>{token.appId}</Link>
Id:{" "}
<a
href={`https://voi.observer/explorer/application/${token.appId}/transactions/`}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have this link be return by a function that takes node, appId. You may leave the link for 'algorand' and 'algorand-testnet' not yet implemented.

Also, use target _blank and rel nofollow,noreferrer.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So there will be two functions. One for the appId and one for address?

>
{token.appId}
</a>
</span>
)}
<br />
Expand Down Expand Up @@ -83,7 +88,21 @@ const Token = ({ address, token, transactions }) => {
<Box sx={{ textAlign: "left" }}>
<h2>Transactions</h2>
<h3>
For: {NFDService.getNFDByAddress(address)?.[address]?.name || address}
For:{" "}
{NFDService.getNFDByAddress(address)?.[address]?.name ? (
<a
href={`https://voi.observer/explorer/account/${NFDService.getNFDByAddress(address)?.[address]?.name
}/transactions`}
>
{NFDService.getNFDByAddress(address)?.[address]?.name}
</a>
) : (
<a
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above here

href={`https://voi.observer/explorer/account/${address}/transactions`}
>
{address}
</a>
)}
</h3>
<TableContainer component={Paper}>
<Table sx={{ minWidth: 700 }} aria-label="customized table">
Expand Down Expand Up @@ -185,7 +204,7 @@ function Page() {
if (!transactions) return;
(async () => {
const addresses = Array.from(
new Set(transactions.map(([, from, to]) => [from, to]).flat())
new Set(transactions.map(([, from, to]) => [from, to]).flat()),
);
let doReload = false;
for (const address of addresses) {
Expand Down