-
Notifications
You must be signed in to change notification settings - Fork 174
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
Refactor/list #953
base: main
Are you sure you want to change the base?
Refactor/list #953
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.
Added one comment in the code and also, we get this error now:
Warning: validateDOMNesting(...): <a> cannot appear as a child of <tr>.
I am not 100% sure whats the correct way to handle this tbh. I did some research and found 3 options, that don't require JS:
- We place the link inside each td and set them to display: block. This could be a bit messy in terms of code but its a proper solution
- We place the link inside but not as a wrapper of . We give it absolute position and we stretch it over teh whole to cover it
- Combination of both. Use the link inside the first column only, and then use css to stretch it over teh whole row with absolute positioning
- Re-create the table with divs instead of table elements and use something like this:
.table {
display: table;
}
.row {
display: table-row;
}
.cell {
display: table-cell;
padding: 10px;
}
.row:hover {
background-color: #cccccc;
}
.cell:hover {
background-color: #e5e5e5;
}
I actually dont think that last option is that bad because we already have components for all the table stuff so we would just need to edit those components. What we have to make sure is it fully behaves as a normal table tho.
LMK what you think and lets decide which solution to go for.
@@ -34,6 +34,8 @@ export const List = ({ | |||
newButtonContent: string; | |||
buttonProps?: any; | |||
}; | |||
link?: ListItemProps["link"]; |
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.
Can you please add some comments on the type definition so we can see them when we hover the prop in vscode. Same for onRowClick.
No description provided.