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

Commit

Permalink
fix: links to accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-calavera committed Oct 29, 2019
1 parent e647f08 commit b39d72f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/v2/components/Programs/Detail/Details/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const ProgramDetails = ({programAccounts}: {programAccounts: Object}) => {
</TableCell>
<TableCell>
<ValidatorName
to={`/accounts/${account.pubkey}`}
pubkey={account.pubkey}
name={account.pubkey}
avatar=""
Expand Down
10 changes: 8 additions & 2 deletions src/v2/components/Transactions/Detail/Program/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ type TProgram = {

const Program = ({id, accounts}: TProgram) => {
const classes = useStyles();

const renderAccount = (account, i) => (
<div className={classes.account}>
<div className={classes.account} key={account}>
<Label text={`Account ${i + 1}`} hint="" />
<ValidatorName pubkey={id} name={account} avatar="" />
<ValidatorName
to={`/accounts/${account}`}
pubkey={id}
name={account}
avatar=""
/>
</div>
);
return (
Expand Down
8 changes: 7 additions & 1 deletion src/v2/components/Transactions/Detail/ProgramsTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ import Program from './Program';

const ProgramsTab = ({transaction}: {transaction: Object}) => {
const renderProgram = instruction => {
return <Program id={instruction.programId} accounts={instruction.keys} />;
return (
<Program
key={instruction.programId}
id={instruction.programId}
accounts={instruction.keys}
/>
);
};
return <div>{map(renderProgram)(transaction.instructions)}</div>;
};
Expand Down
4 changes: 3 additions & 1 deletion src/v2/components/UI/ValidatorName/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ const ValidatorName = ({
pubkey,
name,
avatar,
to,
}: {
pubkey: string,
name: string,
avatar: string,
to?: string,
}) => {
const classes = useStyles();
return (
<div>
<Link to={`/validators/${pubkey}`} className={classes.root}>
<Link to={to || `/validators/${pubkey}`} className={classes.root}>
<Avatar pubkey={pubkey} avatarUrl={avatar} />
<div>{name || pubkey}</div>
</Link>
Expand Down

0 comments on commit b39d72f

Please sign in to comment.