Skip to content

Commit ba07cf0

Browse files
authored
chore(explorer): input parameter names (#3785)
1 parent 7cd553a commit ba07cf0

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changeset/green-experts-obey.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@latticexyz/explorer": patch
3+
---
4+
5+
Input parameter names are now displayed alongside method names in the "Interact" page.

packages/explorer/src/app/(explorer)/[chainName]/worlds/[worldAddress]/interact/content/FunctionField.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ const formSchema = z.object({
5757

5858
const getInputLabel = (input: AbiParameter): string => {
5959
if (!("components" in input)) {
60-
return input.type;
60+
return input.name || input.type;
6161
}
6262

6363
if (input.type === "tuple") {
6464
return input.name || input.type;
6565
} else if (input.type === "tuple[]") {
6666
return `${input.name}[]`;
6767
}
68-
return input.type;
68+
return input.name || input.type;
6969
};
7070

7171
export function FunctionField({ systemId, worldAbi, functionAbi, useSearchParamsArgs }: Props) {

0 commit comments

Comments
 (0)