-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Foldable Card: Add border between summary and expand button if summary is included #2390
Conversation
… between open/close icon and action button to the left of it
@@ -55,6 +55,15 @@ module.exports = React.createClass( { | |||
</p> | |||
<p> | |||
<FoldableCard | |||
header="This is a FoldableCard with iconBorder" | |||
iconBorder={ true } | |||
summary={ <button className="button">Update</button> } |
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.
Could we just render the border if there's content in summary
?
We could but this forces every FoldableCard to inherit this style, which I'm comfortable doing if others are ok with it. |
It would be every FoldableCard that has content to display on that right side, otherwise it remains with no border. I think it's a fair expectation and makes it a bit easier to use (instead of having to decide case by case). If there's content to the right, we render border, otherwise we don't. |
@mtias I went ahead and removed the |
Its only supposed to show when there's a button, right? |
@kellychoffman It's now basing the line on whether the |
Okay. I don't think its bad, just doesn't seem needed. |
Agreed. We can probably update that (little-seen) plugins component to not use the summary prop? |
This is what it looks like with the Updater component showing: we can refactor it after the FoldableCard is updated, and have it only pass in the |
Makes sense. |
Once everything is merged and a tiny css update is made, it'll look like this on sharing @kellychoffman |
I dig it. |
Pinging @dmsnell for code review |
@@ -41,7 +41,7 @@ var FoldableCard = React.createClass( { | |||
onClose: noop, | |||
cardKey: '', | |||
icon: 'chevron-down', | |||
isExpanded: false | |||
isExpanded: false, |
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.
is this a typo?
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 thought it was good practice to end all lines in objects with a comma to avoid double-line diffs when a single line gets added (clarity) and making all the lines uniform.
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 couldn't find this explicit in our style guide. There was one example that included a list and it had the trailing comma. Most of the time I see them I feel like the don't have the trailing comma, but Babel handles it gracefully, so maybe this boils down to personal preference here.
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.
Typo, since I had an extra prop defined at first, which I removed. I'll remove the comma here.
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.
Fixed.
@alternatekev I don't know exactly what |
Foldable Card: Add border between summary and expand button if summary is included
During the discussions of #1477 and #1898, it's become clear that we could use a divider between the expand/collapse icon and the action button (if present) on a FoldableCard. This icon helps divide the disclosure icon from a potentially destructive action, like accidentally disabling your Twitter connection.
Instead of forcing every single instance of FoldableCard that has an action button to inherit this style, I'm adding an
iconBorder
prop to the component, the rendering of which looks like this:cc @mtias @kellychoffman @folletto