From 05953de0532cc5de2c3cc4a0ac65bdcb3584ee9e Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Thu, 28 Oct 2021 02:59:50 -0300 Subject: [PATCH] Apply selection highlighter to function sigs --- src/components/SelectionHighlighter.tsx | 2 ++ src/transaction/FunctionSignature.tsx | 29 ++++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/components/SelectionHighlighter.tsx b/src/components/SelectionHighlighter.tsx index baa2ec5..40a3431 100644 --- a/src/components/SelectionHighlighter.tsx +++ b/src/components/SelectionHighlighter.tsx @@ -18,6 +18,8 @@ export const genericSelector = selection.content === content; export const addressSelector: ContentSelector = genericSelector("address"); +export const functionSigSelector: ContentSelector = + genericSelector("functionSig"); type SelectionHighlighterProps = React.PropsWithChildren<{ myType: SelectionType; diff --git a/src/transaction/FunctionSignature.tsx b/src/transaction/FunctionSignature.tsx index 516e8a7..718138e 100644 --- a/src/transaction/FunctionSignature.tsx +++ b/src/transaction/FunctionSignature.tsx @@ -1,4 +1,7 @@ import React from "react"; +import SelectionHighlighter, { + functionSigSelector, +} from "../components/SelectionHighlighter"; type FunctionSignatureProps = { callType: string; @@ -9,17 +12,23 @@ const FunctionSignature: React.FC = ({ callType, sig, }) => ( - - {sig} - + + {sig} + + ); export default FunctionSignature;