Skip to content

Commit

Permalink
display-direct-link
Browse files Browse the repository at this point in the history
Signed-off-by: Anil Kumar <anil.special2018@gmail.com>
  • Loading branch information
anilspecial committed May 14, 2021
1 parent bfcee09 commit 8d1db82
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions client/src/components/View/TransactionView.js
Expand Up @@ -106,6 +106,14 @@ export class TransactionView extends Component {
);
}
if (transaction) {
let baseUrl =
window.location.protocol +
'//' +
window.location.hostname +
':' +
window.location.port;
let directLink =
baseUrl + '/?tab=transactions&transId=' + transaction.txhash;
return (
<Modal>
{modalClasses => (
Expand Down Expand Up @@ -166,6 +174,19 @@ export class TransactionView extends Component {
<th>Time:</th>
<td>{transaction.createdt}</td>
</tr>
<tr>
<th>Direct Link:</th>
<td>
{directLink}
<button type="button" className={modalClasses.copyBtn}>
<div className={modalClasses.copy}>Copy</div>
<div className={modalClasses.copied}>Copied</div>
<CopyToClipboard text={directLink}>
<FontAwesome name="copy" />
</CopyToClipboard>
</button>
</td>
</tr>
<tr>
<th style={reads}>Reads:</th>
<td className={classes.JSONtree}>
Expand Down

0 comments on commit 8d1db82

Please sign in to comment.