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(Accordion): Added support for bordered, display large … #6085

Merged
merged 2 commits into from Jul 30, 2021

Conversation

tlabaj
Copy link
Contributor

@tlabaj tlabaj commented Jul 29, 2021

…and multiple body content

What: Closes #5498

@patternfly-build
Copy link
Contributor

patternfly-build commented Jul 29, 2021

mcarrano
mcarrano previously approved these changes Jul 29, 2021
Copy link
Member

@mcarrano mcarrano left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks @tlabaj !

@@ -18,6 +19,8 @@ export interface AccordionContentProps extends React.HTMLProps<HTMLDivElement> {
'aria-label'?: string;
/** Component to use as content container */
component?: React.ElementType;
/** Flag indicating content is custom. Expanded content Body wrapper will be removed from children. This allows multiple bodies to be rendered as content. */
isCustomContent?: React.ReactNode;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is an interesting way to handle this. I think we don't usually conditionally expect the consumer to wrap elements in a body component. I wonder if it's be more consistent if we allowed people to just pass a single child, or an array of children? and we wrap things in body components for them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nicole I was debating both approaches. I initially stared with the single Node or array. I was thinking in the long run it would be nice to handle this similar to other components with bodies (Card, Drawer) where the consumer composes it themself, that is why I took this approach.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be better then, to always tell the consumer to wrap content in a body?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we could update to always wrapping the content in a body in the next breaking release?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nicolethoen that would break consumers who are already using the component.
@kmcfaul that is what I was thinking long term.

I am ok with either approach here... Like I said, I was debating which one to go with.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think either way will work, as long as it's clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kmcfaul what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think having the custom prop is good until we can refactor 👍

mcoker
mcoker previously approved these changes Jul 29, 2021
Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

LGTM!!

@@ -5,42 +5,45 @@ cssPrefix: pf-c-accordion
propComponents: ['Accordion', 'AccordionItem', 'AccordionContent', 'AccordionToggle']
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add AccordionExpandedContentBody here

@tlabaj tlabaj dismissed stale reviews from mcoker and mcarrano via e38fa4b July 29, 2021 21:15
Copy link
Member

@mcarrano mcarrano left a comment

Choose a reason for hiding this comment

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

Looks good!

@nicolethoen nicolethoen merged commit da59273 into patternfly:main Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new variant of Accordion for marketing use cases
7 participants