From 873541ec647dab211f6e5fec0f3d330183c4212d Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Wed, 28 Jul 2021 16:27:06 -0300 Subject: [PATCH] Add hyperlinks to EIP tx types --- src/components/ExternalLink.tsx | 23 +++++++++++++++++++++++ src/components/TransactionType.tsx | 15 ++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 src/components/ExternalLink.tsx diff --git a/src/components/ExternalLink.tsx b/src/components/ExternalLink.tsx new file mode 100644 index 0000000..5232a9d --- /dev/null +++ b/src/components/ExternalLink.tsx @@ -0,0 +1,23 @@ +import React from "react"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faExternalLinkAlt } from "@fortawesome/free-solid-svg-icons"; + +type ExternalLinkProps = { + href: string; +}; + +const ExternalLink: React.FC = ({ href, children }) => ( + + + {children} + + + +); + +export default ExternalLink; diff --git a/src/components/TransactionType.tsx b/src/components/TransactionType.tsx index ab4c58a..e7faa6c 100644 --- a/src/components/TransactionType.tsx +++ b/src/components/TransactionType.tsx @@ -1,20 +1,29 @@ import React from "react"; +import ExternalLink from "./ExternalLink"; type TransactionTypeProps = { type: number; }; const TransactionType: React.FC = ({ type }) => { - let description: string; + let description: React.ReactNode; switch (type) { case 0: description = "legacy"; break; case 1: - description = "EIP-2930"; + description = ( + + EIP-2930 + + ); break; case 2: - description = "EIP-1559"; + description = ( + + EIP-1559 + + ); break; default: description = "unknown";