Skip to content
This repository was archived by the owner on Jul 22, 2020. It is now read-only.

Commit b39d72f

Browse files
fix: links to accounts
1 parent e647f08 commit b39d72f

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

src/v2/components/Programs/Detail/Details/index.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const ProgramDetails = ({programAccounts}: {programAccounts: Object}) => {
1515
</TableCell>
1616
<TableCell>
1717
<ValidatorName
18+
to={`/accounts/${account.pubkey}`}
1819
pubkey={account.pubkey}
1920
name={account.pubkey}
2021
avatar=""

src/v2/components/Transactions/Detail/Program/index.jsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ type TProgram = {
1616

1717
const Program = ({id, accounts}: TProgram) => {
1818
const classes = useStyles();
19+
1920
const renderAccount = (account, i) => (
20-
<div className={classes.account}>
21+
<div className={classes.account} key={account}>
2122
<Label text={`Account ${i + 1}`} hint="" />
22-
<ValidatorName pubkey={id} name={account} avatar="" />
23+
<ValidatorName
24+
to={`/accounts/${account}`}
25+
pubkey={id}
26+
name={account}
27+
avatar=""
28+
/>
2329
</div>
2430
);
2531
return (

src/v2/components/Transactions/Detail/ProgramsTab.jsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ import Program from './Program';
66

77
const ProgramsTab = ({transaction}: {transaction: Object}) => {
88
const renderProgram = instruction => {
9-
return <Program id={instruction.programId} accounts={instruction.keys} />;
9+
return (
10+
<Program
11+
key={instruction.programId}
12+
id={instruction.programId}
13+
accounts={instruction.keys}
14+
/>
15+
);
1016
};
1117
return <div>{map(renderProgram)(transaction.instructions)}</div>;
1218
};

src/v2/components/UI/ValidatorName/index.jsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ const ValidatorName = ({
99
pubkey,
1010
name,
1111
avatar,
12+
to,
1213
}: {
1314
pubkey: string,
1415
name: string,
1516
avatar: string,
17+
to?: string,
1618
}) => {
1719
const classes = useStyles();
1820
return (
1921
<div>
20-
<Link to={`/validators/${pubkey}`} className={classes.root}>
22+
<Link to={to || `/validators/${pubkey}`} className={classes.root}>
2123
<Avatar pubkey={pubkey} avatarUrl={avatar} />
2224
<div>{name || pubkey}</div>
2325
</Link>

0 commit comments

Comments
 (0)