diff --git a/src/Block.tsx b/src/Block.tsx index eaed7bf..44ae998 100644 --- a/src/Block.tsx +++ b/src/Block.tsx @@ -1,10 +1,16 @@ import React, { useEffect, useState, useMemo } from "react"; import { useParams, NavLink } from "react-router-dom"; import { ethers, BigNumber } from "ethers"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { + faChevronLeft, + faChevronRight, +} from "@fortawesome/free-solid-svg-icons"; import { provider } from "./ethersconfig"; import StandardFrame from "./StandardFrame"; import StandardSubtitle from "./StandardSubtitle"; import ContentFrame from "./ContentFrame"; +import NavButton from "./components/NavButton"; import Timestamp from "./components/Timestamp"; import GasValue from "./components/GasValue"; import BlockLink from "./components/BlockLink"; @@ -101,9 +107,23 @@ const Block: React.FC = () => { {block && ( - - {ethers.utils.commify(block.number)} - +
+ + {ethers.utils.commify(block.number)} + + + + + + + +
@@ -156,7 +176,7 @@ const Block: React.FC = () => { N/A - + diff --git a/src/components/NavButton.tsx b/src/components/NavButton.tsx new file mode 100644 index 0000000..a9c1a9d --- /dev/null +++ b/src/components/NavButton.tsx @@ -0,0 +1,31 @@ +import { NavLink } from "react-router-dom"; + +type NavButtonProps = { + blockNum: number; + disabled?: boolean; +}; + +const NavButton: React.FC = ({ + blockNum, + disabled, + children, +}) => { + if (disabled) { + return ( + + {children} + + ); + } + + return ( + + {children} + + ); +}; + +export default NavButton;