Allow raw display of non-decodable inputs
This commit is contained in:
parent
b9a9495c61
commit
d905afd75d
|
@ -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<ModeTabProps> = ({ disabled, children }) => (
|
||||
<Tab
|
||||
className={({ selected }) =>
|
||||
`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}
|
||||
</Tab>
|
||||
|
|
|
@ -72,7 +72,7 @@ const TraceInput: React.FC<TraceInputProps> = ({
|
|||
{(!hasParams || !expanded) && <>)</>}
|
||||
</span>
|
||||
</div>
|
||||
{hasParams && expanded && fourBytesTxDesc && (
|
||||
{hasParams && expanded && (
|
||||
<>
|
||||
<div className="ml-5 mr-1 my-2">
|
||||
<InputDecoder
|
||||
|
|
|
@ -39,7 +39,7 @@ const InputDecoder: React.FC<InputDecoderProps> = ({
|
|||
return (
|
||||
<Tab.Group>
|
||||
<Tab.List className="flex space-x-1 mb-1">
|
||||
<ModeTab>Decoded</ModeTab>
|
||||
<ModeTab disabled={!resolvedTxDesc}>Decoded</ModeTab>
|
||||
<ModeTab>Raw</ModeTab>
|
||||
<ModeTab>UTF-8</ModeTab>
|
||||
</Tab.List>
|
||||
|
|
Loading…
Reference in New Issue