-
Notifications
You must be signed in to change notification settings - Fork 7
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
Create pagination on home page proposals list #2655
Conversation
✅ Deploy Preview for decent-interface-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Holy hell, what? This has gotta be the best ad for Cursor yet. |
Cursor loves working in React codebases. |
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.
Code-wise, Looks good. I want to QA this a bit. before approval. will do some testing later.
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.
Have some comments about components usage and initial state for useState
icon: ComponentType; | ||
} | ||
|
||
function NavButton({ onClick, isDisabled, icon: IconComponent }: NavButtonProps) { |
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.
Why just not naming it IconComponent
right on the interface?
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
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.
One change request, a comment about potential error handling, then should be good to go for me
src/hooks/utils/usePagination.ts
Outdated
|
||
const [pageSize, setPageSize] = useState(() => { | ||
const size = searchParams.get(QUERY_PARAMS.SIZE); | ||
return size && PAGE_SIZE_OPTIONS.includes(parseInt(size)) ? parseInt(size) : DEFAULT_PAGE_SIZE; |
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.
Might as well parseInt
on searchParams.get(QUERY_PARAMS.SIZE)
instead. Also worried about QUERY_PARAMS
having non-numeric values
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've cleaned up the query param validation and making sure weird user input (via query params in url) are handled properly. Please try to break it yourself!
Bug I noticed while David was screensharing and testing. When a list of proposals is being loaded for the first time, the "last item" on the first page will get stuck on a "loading" component. |
…tual proposals loading in
Closes https://linear.app/decent-labs/issue/ENG-108/create-pagination-controls-for-proposals-list
I wanted it to exist, so I told the AI to do it, and it did.
Will create PM artifacts in the AM.