lbry-desktop/ui/component/common/transaction-link.jsx
Tobias Speicher 21af8f4f28 refactor: replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
2022-03-23 12:12:44 -04:00

18 lines
361 B
JavaScript

// @flow
import React from 'react';
import Button from 'component/button';
type Props = {
id: string,
};
const TransactionLink = (props: Props) => {
const { id } = props;
const href = `https://explorer.lbry.com/tx/${id}`;
const label = id.slice(0, 7);
return <Button button="link" href={href} label={label} />;
};
export default TransactionLink;