-
Notifications
You must be signed in to change notification settings - Fork 10
fix(event): add support for event detail page #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
glihm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| decodedEvent && (hasDecodedKeys || hasDecodedData), | ||
| ); | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know enough react to evaluate if this is correct or not. Maybe need some review here @nrmnqdds.
| value="decoded" | ||
| className="mt-0 flex-1 overflow-auto" | ||
| > | ||
| {/* TODO: handle the nested events without flat, where the selector could be composed of multiple felts. */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not critical, but definitely worthy to have a look later. But most of contracts are using flat attribute.
| key={type} | ||
| value={type} | ||
| className={cn( | ||
| "data-[state=active]:shadow-none py-[2px] pr-[8px] pl-[10px] rounded-sm data-[state=active]:bg-background-200 data-[state=inactive]:bg-background-100 data-[state=inactive]:text-foreground-400 data-[state=active]:text-foreground-100 box-border border border-background-200 h-[20px] text-[11px]/[16px] font-medium uppercase tracking-[0.24px]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a lot, but I can take more time checking in the codebase if this is acceptable or not.
| * @param value - The value to stringify. Which usually represents a data fetched from the chain. | ||
| * @returns The stringified data. | ||
| */ | ||
| export function stringifyData(value: unknown): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we have a function for that already, I've checked the utils and I've seen some for call data, but maybe it applies also to events.
Feel free to change if necessary.
WIP on the event details page.
The goal here is to:
Note
Revamps the Event page with raw/decoded tabs and formatting controls, and refactors the event hook to decode events via ABI with improved validation and types.
src/modules/Event/hooks.ts):SuccessfulTransactionReceiptResponse, strict index parsing/validation, and queryenabledguard.EmittedEventlocally; parses viaevents.parseEventswithAbiParser2,sortedAbi, and extracts decoded keys/data.decodedEvent(name, qualifiedName, keys, data) plusreceipt,block,event.src/modules/Event/page.tsx):FeltDisplayAsToggle).CopyableInteger, improved metadata (transaction, from, block, timestamp, event type), responsive updates, and cleaner rendering.src/shared/components/ToggleButton.tsx):Selectorwith@cartridge/uiTabs-based toggle; updated styles/behavior.abi.ts: exportsAbiEventMember; usessortedAbihelper.string.ts: addsstringifyDatafor human-readable event values.Written by Cursor Bugbot for commit c8306ab. This will update automatically on new commits. Configure here.