Skip to content

Commit 91f2570

Browse files
committed
Enhance examples with descriptions
1 parent ca43452 commit 91f2570

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

src/app/page.tsx

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ const API_BASE_URL = process.env.NEXT_PUBLIC_OPENCHAIN_API_URL || "https://api.o
4343

4444
// Example selectors for users to try
4545
const exampleSelectors = [
46-
"0xa9059cbb",
47-
"transfer*",
48-
"*Supply*",
49-
"transferFrom(address,address,uint256)",
50-
"0xbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae0595",
46+
{ query: "0xa9059cbb", description: "4-byte function selector" },
47+
{ query: "transfer*", description: "Wildcard text search for signatures starting with 'transfer'" },
48+
{ query: "*Supply*", description: "Signatures containing 'Supply'" },
49+
{ query: "transferFrom(address,address,uint256)", description: "Full function signature" },
50+
{ query: "0xbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae0595", description: "32-byte event hash" },
5151
];
5252

5353
function SearchInterface() {
@@ -352,33 +352,34 @@ function SearchInterface() {
352352
</button>
353353
</form>
354354

355-
<div className="mt-6 text-xs md:text-sm text-gray-600 space-y-1">
356-
<div>
357-
<b>Text search:</b> Use &apos;*&apos; and &apos;?&apos; for wildcards, case insensitive.
358-
</div>
359-
<div>
360-
<b>0x hash search:</b> Start with &apos;0x&apos;. Search 4byte or full 32 byte hash.
361-
</div>
362-
<div>
363-
<b>?q=0x12345678 in URL:</b> Use the ?q=0x12345678 query parameter for a sharable link.
364-
</div>
365-
</div>
366-
367355
{/* Example Selectors */}
368356
<div className="mt-6">
369-
<div className="text-sm md:text-base font-medium text-gray-800 mb-2">Examples</div>
370-
<div className="flex flex-wrap gap-2">
357+
<div className="text-sm md:text-base font-medium text-gray-800 mb-2">Try Some Examples</div>
358+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
371359
{exampleSelectors.map((example, i) => (
372360
<button
373361
key={i}
374-
onClick={() => handleExampleClick(example)}
375-
className="text-xs md:text-sm bg-gray-100 px-2 md:px-4 py-1 md:py-2 hover:bg-gray-200 text-gray-800 transition-colors font-mono cursor-pointer rounded-md break-all"
362+
onClick={() => handleExampleClick(example.query)}
363+
className="text-left bg-gray-50 hover:bg-gray-100 border border-gray-200 hover:border-cerulean-blue-300 p-3 rounded-md transition-all cursor-pointer"
376364
>
377-
<span className="font-mono">{example}</span>
365+
<div className="font-mono text-xs md:text-sm text-gray-900 break-all mb-1">{example.query}</div>
366+
<div className="text-xs text-gray-600">{example.description}</div>
378367
</button>
379368
))}
380369
</div>
381370
</div>
371+
372+
<div className="mt-6 text-xs md:text-sm text-gray-600 space-y-1">
373+
<div>
374+
<b>Text search:</b> Use &apos;*&apos; and &apos;?&apos; for wildcards, case sensitive.
375+
</div>
376+
<div>
377+
<b>0x hash search:</b> Start with &apos;0x&apos;. Search 4byte or full 32 byte hash.
378+
</div>
379+
<div>
380+
<b>?q=0x12345678 in URL:</b> Use the ?q=0x12345678 query parameter for a sharable link.
381+
</div>
382+
</div>
382383
</div>
383384
</div>
384385

0 commit comments

Comments
 (0)