Add support for switching between source files

This commit is contained in:
Willian Mitsuda 2021-07-24 20:47:09 -03:00
parent f15c75bb8e
commit 4adace4913

View File

@ -71,15 +71,20 @@ const Contracts: React.FC<ContractsProps> = ({ checksummedAddress }) => {
)} )}
{rawMetadata !== undefined && rawMetadata !== null && ( {rawMetadata !== undefined && rawMetadata !== null && (
<div> <div>
{Object.entries(rawMetadata.sources).map(([k]) => ( <div className="flex truncate">
<button {Object.entries(rawMetadata.sources).map(([k]) => (
className={`border-b-2 border-transparent rounded-t text-sm px-2 py-1 bg-gray-200 text-gray-500 ${ <button
selected === k ? "border-orange-300 font-bold" : "" className={`border-b-2 border-transparent rounded-t text-sm px-2 py-1 ${
}`} selected === k
> ? "border-orange-300 font-bold bg-gray-200 text-gray-500"
{k} : "bg-gray-100 text-gray-400 transform origin-bottom scale-95"
</button> }`}
))} onClick={() => setSelected(k)}
>
{k}
</button>
))}
</div>
{selected && ( {selected && (
<Contract <Contract
checksummedAddress={checksummedAddress} checksummedAddress={checksummedAddress}