Apply selection highlighter to function sigs
This commit is contained in:
parent
f800f05787
commit
05953de053
|
@ -18,6 +18,8 @@ export const genericSelector =
|
||||||
selection.content === content;
|
selection.content === content;
|
||||||
|
|
||||||
export const addressSelector: ContentSelector = genericSelector("address");
|
export const addressSelector: ContentSelector = genericSelector("address");
|
||||||
|
export const functionSigSelector: ContentSelector =
|
||||||
|
genericSelector("functionSig");
|
||||||
|
|
||||||
type SelectionHighlighterProps = React.PropsWithChildren<{
|
type SelectionHighlighterProps = React.PropsWithChildren<{
|
||||||
myType: SelectionType;
|
myType: SelectionType;
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import SelectionHighlighter, {
|
||||||
|
functionSigSelector,
|
||||||
|
} from "../components/SelectionHighlighter";
|
||||||
|
|
||||||
type FunctionSignatureProps = {
|
type FunctionSignatureProps = {
|
||||||
callType: string;
|
callType: string;
|
||||||
|
@ -9,17 +12,23 @@ const FunctionSignature: React.FC<FunctionSignatureProps> = ({
|
||||||
callType,
|
callType,
|
||||||
sig,
|
sig,
|
||||||
}) => (
|
}) => (
|
||||||
<span
|
<SelectionHighlighter
|
||||||
className={`font-bold ${
|
myType="functionSig"
|
||||||
callType === "STATICCALL"
|
myContent={sig}
|
||||||
? "text-red-700"
|
selector={functionSigSelector}
|
||||||
: callType === "DELEGATECALL" || callType === "CALLCODE"
|
|
||||||
? "text-gray-400"
|
|
||||||
: "text-blue-900"
|
|
||||||
}`}
|
|
||||||
>
|
>
|
||||||
{sig}
|
<span
|
||||||
</span>
|
className={`font-bold ${
|
||||||
|
callType === "STATICCALL"
|
||||||
|
? "text-red-700"
|
||||||
|
: callType === "DELEGATECALL" || callType === "CALLCODE"
|
||||||
|
? "text-gray-400"
|
||||||
|
: "text-blue-900"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{sig}
|
||||||
|
</span>
|
||||||
|
</SelectionHighlighter>
|
||||||
);
|
);
|
||||||
|
|
||||||
export default FunctionSignature;
|
export default FunctionSignature;
|
||||||
|
|
Loading…
Reference in New Issue