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

feat(ListItemView): ability to pass custom react node as a content prop #1726

Merged

Conversation

IsaevAlexandr
Copy link
Contributor

…ent prop

What has been done:

  • Added the ability to transfer a custom react component as a content prop in ListItemView;
  • Removed Flex component from root of ListItemView component. Flex uses inline styles what prevent class override approach of ListItemView;

Now ListItemView look very close to previous approach of current List component

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@gravity-ui-bot
Copy link
Contributor

Visual Tests Report is ready.

modToHeight[size][
Number(Boolean(isListItemContentPropsGuard(content) ? content?.subtitle : false))
]
}px)`,
Copy link
Contributor Author

@IsaevAlexandr IsaevAlexandr Jul 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here may be too match) but it's works and do exactly what i wont

minHeight: `var(--g-list-item-height, ${height ?? modToHeight[size][Number(Boolean(isListItemContentPropsGuard(content) ? content?.subtitle : false))]

can set minHeight from props or override during css custom property in styles


{endSlot}
</Flex>
{isListItemContentPropsGuard(content) ? (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here entry point in all changes of this pr

@IsaevAlexandr IsaevAlexandr changed the title feat(ListItemView): added ability to pass custom react node as a cont… feat(ListItemView): ability to pass custom react node as a content prop Aug 1, 2024
@IsaevAlexandr IsaevAlexandr merged commit 5d5417a into gravity-ui:main Aug 1, 2024
7 checks passed
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.

6 participants