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

Fixes #1941 - Implement panel component with collapse ability #1948

Merged
merged 5 commits into from
May 13, 2019

Conversation

bryceosterhaus
Copy link
Member

@bryceosterhaus bryceosterhaus commented May 1, 2019

I haven't added the animation for the height expanding yet. Wanted to make sure this was the route we wanted to go first.

@coveralls
Copy link

coveralls commented May 1, 2019

Pull Request Test Coverage Report for Build 2488

  • 41 of 41 (100.0%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+2.2%) to 81.707%

Totals Coverage Status
Change from base Build 2486: 2.2%
Covered Lines: 751
Relevant Lines: 883

💛 - Coveralls

@matuzalemsteles
Copy link
Member

Just started reviewing :)

:octocat: Sent from GH.

@matuzalemsteles
Copy link
Member

hey @bryceosterhaus this component looks good to me but I'm not sure if we should follow with Panel implemented with Collapse or just a hook for the Collapse, I do not know what use cases it had or if it was used.

But it's fine with me if we go with that, since it no longer makes sense in the context of React to write as it was before.

@bryceosterhaus
Copy link
Member Author

@matuzalemsteles I think we just keep collapse prop for panel. We can extract the transition height logic to its own hook and share it throughout clay though. I will wait for Diegos PR for navigation bar since he has a similar hook for transitioning height.

@bryceosterhaus
Copy link
Member Author

@matuzalemsteles updated.

I went ahead and extracted useTransitionHeight from nav bar and put it into a @clayui/shared package. I went with the shared package because we need to publicly expose it as well as have versions for it. I'm not too concerned about the overhead in maintaining it since it is just another package similar to the others we are creating and should go through the same workflow. For now I think we isolate shared hooks there and avoid publicly promoting it as a package that other people should consume, this way we can keep from the overhead of adding features to this specific package.

}
}

export function useTransitionHeight(
Copy link
Member Author

Choose a reason for hiding this comment

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

I decided to make this explicit to only "height" right now. In the future I can imagine this being expanded to all transitions, but wanted to narrow our scope now and not make it generic until we actually need it for other use cases.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, makes sense. You did well.

Copy link
Member

@matuzalemsteles matuzalemsteles left a comment

Choose a reason for hiding this comment

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

No problem Bryce, we can go with it that way. Thanks for this, I just left a comment to add warnings.

# clay-shared

Shared utilities and hooks used across clay components

Copy link
Member

Choose a reason for hiding this comment

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

hey @bryceosterhaus you can put some warnings that this package for a moment is only for internal use and that the API's are unstable and can be modified at any time and that "use at your own risk".

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call, I went ahead and updated the README.

Copy link
Member

@matuzalemsteles matuzalemsteles left a comment

Choose a reason for hiding this comment

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

LGTM!

@matuzalemsteles matuzalemsteles merged commit ee626e9 into liferay:develop May 13, 2019
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.

3 participants