Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rockingrohit9639
Copy link
Contributor

No description provided.

Copy link
Contributor

@DonKoko DonKoko left a 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:

  1. 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
  2. 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
  3. 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
  4. 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"];
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants