Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Add Collapse #11

Merged
merged 6 commits into from Oct 17, 2018
Merged

Add Collapse #11

merged 6 commits into from Oct 17, 2018

Conversation

Chalarangelo
Copy link
Owner

A simple collapse component:

  • Uses state.
  • Binds an event listener callback to its own context.
  • Uses props.children to render content.
  • Is accessible via aria-expanded.
  • Has some CSS-in-JS (as unopinionated and minimal as possible).

@Chalarangelo
Copy link
Owner Author

Linecount aside, I think this turned out pretty good. Opinions @skatcat31 @fejes713?

@Chalarangelo Chalarangelo requested review from fejes713, skatcat31 and a team October 17, 2018 17:46
Copy link
Contributor

@skatcat31 skatcat31 left a comment

Choose a reason for hiding this comment

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

All good except for deriving state at PIT on an async action

snippets/Collapse.md Outdated Show resolved Hide resolved
@Chalarangelo
Copy link
Owner Author

Chalarangelo commented Oct 17, 2018

@skatcat31 Already fixed - I used GitHub's suggestion feature to use your code, so one of the commits is on you now! 😉 - Please use that feature whenever possible, it helps us improve PRs faster and improves git history/blame.

snippets/Collapse.md Outdated Show resolved Hide resolved
@skatcat31
Copy link
Contributor

@skatcat31 Already fixed - I used GitHub's suggestion feature to use your code, so one of the commits is on you now! 😉 - Please use that feature whenever possible, it helps us improve PRs faster and improves git history/blame.

I'll have to check into that feature, haven't noticed it quite yet

Copy link
Contributor

@skatcat31 skatcat31 left a comment

Choose a reason for hiding this comment

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

Original comment by @skatcat31

Shouldn't this use a div wrapping the button and context that is collapsible, not a fragment?

While a fragment should work, it'll mean that where Collapse is called will nest it's children on the parent directly, not under a div(IIRC)

reply by @Chalarangelo

Yeah, I usually opt for not adding extra elements for no reason in components, but this might be a good case against fragments actually.

reply by @Chalarangelo

Removing the Fragment will also probably drop expertise to 1 instead of 2 and make reading this a bit easier.

I wanna test out that suggestions thing

edit: umm... I can't seem to find it. I wonder if it only shows up if you're the branch author??

edit2: darn seems to be to short for it to detect easily...

edit3: OHHH

snippets/Collapse.md Outdated Show resolved Hide resolved
snippets/Collapse.md Outdated Show resolved Hide resolved
@Chalarangelo
Copy link
Owner Author

@skatcat31 I think this is alright now.

@skatcat31
Copy link
Contributor

Agreed however I think it should be left as a 2 since it's nesting context and using children

@Chalarangelo
Copy link
Owner Author

Alright, I think there is no controversy surrounding this, so I'm gonna merge the first ever snippet into the master branch! 🚀

@Chalarangelo Chalarangelo merged commit 96a5c59 into master Oct 17, 2018
@fejes713 fejes713 deleted the Chalarangelo-collapse branch October 20, 2018 08:58
@lock
Copy link

lock bot commented Dec 18, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for any follow-up tasks.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants