-
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(PHC-4380): row selection to TableModule #333
Conversation
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.
Looks good! A couple small pieces of feedback, and I'll approve after the few type errors blocking merge are resolved.
}, | ||
cell: { | ||
content: (rowData: any) => ( | ||
<Checkbox |
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.
If you think it's not too much for this PR, could you add a class to the checkbox here that makes its click area larger for improved UX? Here it is for your reference:
checkboxClass: {
padding: theme.spacing(1.5),
margin: `calc(-1 * ${theme.spacing(1.5)})`,
},
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'd like to add something to the TableModule.stories.tsx
but there's no theme
so just need to figure out how to use this snippet
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 see some other components that leverage a theme in /src/styles.
IMO, every table should have the same spacing here as a default and maybe it should be extensible, but I'm guessing most cases will want the basic spacing (or we may want to just enforce this)
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.
Since this is a temp solution before deprecating the table in favor of one that leverages tanStack's we can go without this for now
@@ -412,6 +427,51 @@ export const TableModule = React.memo( | |||
} | |||
}; | |||
|
|||
const isRowSelected = (row: any, index: number): boolean => { |
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.
again, double checking that this any (and the following one) are definitely what we want
13e31a4
to
c873ce9
Compare
🎉 This PR is included in version 4.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
It uses the row selection API from tanstack to simplify developers' learning curve.
This is an temporary solution before fully adopting the TanStack table API via #331