From d905afd75d384079de8ed0c04ccde6d0b2b92f77 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Mon, 8 Nov 2021 14:53:23 -0300 Subject: [PATCH] Allow raw display of non-decodable inputs --- src/components/ModeTab.tsx | 15 +++++++++++---- src/transaction/TraceInput.tsx | 2 +- src/transaction/decoder/InputDecoder.tsx | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/components/ModeTab.tsx b/src/components/ModeTab.tsx index 14a33fd..6b7cc01 100644 --- a/src/components/ModeTab.tsx +++ b/src/components/ModeTab.tsx @@ -1,13 +1,20 @@ import React from "react"; import { Tab } from "@headlessui/react"; -const ModeTab: React.FC = ({ children }) => ( +type ModeTabProps = { + disabled?: boolean | undefined; +}; + +const ModeTab: React.FC = ({ disabled, children }) => ( - `border rounded-lg px-2 py-1 bg-gray-100 hover:bg-gray-200 hover:shadow text-xs text-gray-500 hover:text-gray-600 ${ - selected ? "border-blue-300" : "" - }` + `border rounded-lg px-2 py-1 bg-gray-100 ${ + disabled + ? "text-gray-300" + : "hover:bg-gray-200 hover:shadow text-gray-500 hover:text-gray-600" + } text-xs ${selected ? "border-blue-300" : ""}` } + disabled={disabled} > {children} diff --git a/src/transaction/TraceInput.tsx b/src/transaction/TraceInput.tsx index 39184b5..06cdedf 100644 --- a/src/transaction/TraceInput.tsx +++ b/src/transaction/TraceInput.tsx @@ -72,7 +72,7 @@ const TraceInput: React.FC = ({ {(!hasParams || !expanded) && <>)} - {hasParams && expanded && fourBytesTxDesc && ( + {hasParams && expanded && ( <>
= ({ return ( - Decoded + Decoded Raw UTF-8