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
Parent table with params #218
Conversation
setListState(data); | ||
} | ||
}, [resourceName, currentListParams]); | ||
const setListParams = useMemo( |
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 why we're using useMemo
here?
|
||
// from https://usehooks.com/useDebounce/ | ||
|
||
const useDebounce = <T,>(value: T, delay: number): T => { |
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.
<T,> ? weird. prettier checks out though
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.
yeah i just lazily copied it...we have it in dac-ui too 🤷♀️
src/components/ListPane/ListPane.tsx
Outdated
@@ -148,7 +152,9 @@ const List = () => { | |||
backgroundColor: 'transparent', | |||
...(listParams.sortOrder === 'DESC' && { color: theme.colors.primary_5 }), | |||
}} | |||
// onClick={() => setListParams({ ...listParams, sortOrder: 'DESC' })} | |||
onClick={() => | |||
setListParams({ sortOrder: listParams.sortOrder === 'ASC' ? 'DESC' : 'ASC' }) |
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.
worth putting 'ASC' and 'DESC' into enum? used a fair bit
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.
Funny I thought I did have one, and forgot to use it here...but will do!
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.
Nvmd i def do, it was just a type instead of an enum...will use it here!
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
one suggestion if you fancy
Adds parameters to list context