-
Notifications
You must be signed in to change notification settings - Fork 9
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
[Feat] - Display referendum Titles, add react-query #49
[Feat] - Display referendum Titles, add react-query #49
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
LGTM after comment
const referendumData = referendumsData?.find(ref => ref?.referendumIndex === referendum.index) | ||
return ( | ||
<Select.Option | ||
headlineText={referendumData?.title || `Proposal #${referendum.index}`} |
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.
lets include the proposal number?
headlineText={referendumData?.title || `Proposal #${referendum.index}`} | |
headlineText={`#${referendum.index}: ${referendumData?.title}` || `Proposal #${referendum.index}`} |
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.
Done :)
Description
⛑️ What was done:
Technical:
Note: The API does not support a request with an array of IDs, N requests are required to get the data for each referendum. API calls to unsupported chains are not executed, though they how appear on client side cache as
chainId, { isChainSupported: false }, id
Type of change
Please delete options that are not relevant.
🧪 How to test:
/voting
🖼️ Screenshots:
Screen.Recording.2024-05-20.at.17.18.54.mov
React-query dev tools cache explorer:

If you are new to react-query, the left side is a list of the client side cache. Each item has an unique query key array as an identifier. For this hook the chain name, isChainSupported and the referendum ID are being used for uniqueness and debugging readability.
On the right side the details of a given query is displayed, including the cached data.