From 8b27be8b1880995d68fb4437a579fb73d8564877 Mon Sep 17 00:00:00 2001 From: aednikanov Date: Mon, 23 Sep 2024 16:20:17 +0300 Subject: [PATCH 1/2] feat(docs): added handling for object input field --- src/components/ParserOpenRPC/InteractiveBox/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/ParserOpenRPC/InteractiveBox/index.tsx b/src/components/ParserOpenRPC/InteractiveBox/index.tsx index 90731705a9..53c2401fe8 100644 --- a/src/components/ParserOpenRPC/InteractiveBox/index.tsx +++ b/src/components/ParserOpenRPC/InteractiveBox/index.tsx @@ -128,6 +128,9 @@ export default function InteractiveBox({ return [checkName(name), getObjectWithAddress(value)]; } } + if (isObject(value)) { + return [checkName(name), value?.value]; + } return [checkName(name), value]; }) ); From a02036b6255a7a0d8426e4f6d0c8825088811e66 Mon Sep 17 00:00:00 2001 From: aednikanov Date: Mon, 23 Sep 2024 17:50:20 +0300 Subject: [PATCH 2/2] feat(docs): added full handling for edge case --- src/components/ParserOpenRPC/InteractiveBox/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/ParserOpenRPC/InteractiveBox/index.tsx b/src/components/ParserOpenRPC/InteractiveBox/index.tsx index 53c2401fe8..0bf092575e 100644 --- a/src/components/ParserOpenRPC/InteractiveBox/index.tsx +++ b/src/components/ParserOpenRPC/InteractiveBox/index.tsx @@ -129,7 +129,10 @@ export default function InteractiveBox({ } } if (isObject(value)) { - return [checkName(name), value?.value]; + return [ + checkName(name), + Object.fromEntries(Object.entries(value).map(([key, val]) => [key, isObject(val) ? val.value : val])) + ]; } return [checkName(name), value]; })