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

Max Width & Callback Improvements #21

Closed
wants to merge 2 commits into from

Conversation

pdfowler
Copy link

This PR implements the following features:

  • #20 Add basic support for maxWidth for Panels. This can be specified just like "minWidth", and defaults to 0 (ie: disabled)
  • Add a second argument to the onUpdate callback, allowing more seamless integration with external state libraries

Additionally, code has been refactored to break apart Divider, Panel, and Panel Group into standalone components.

Remaining TODO:

  • Add tests covering the maxWidth and isComplete behaviors.

* Add basic support for `maxWidth` for Panels. This can be specified just like "minWidth", and defaults to 0
* Add a second argument to the `onUpdate` callback, allowing more seamless integration with external state libraries

Additionally, code has been refactored to break apart Divider, Panel, and Panel Group into standalone components.

Remaining TODO:

* Add tests covering the `maxWidth` and `isComplete` behaviors.
@codecov-io
Copy link

Codecov Report

Merging #21 into master will decrease coverage by 0.51%.
The diff coverage is 1.58%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #21      +/-   ##
=========================================
- Coverage    9.89%   9.37%   -0.52%     
=========================================
  Files           1       3       +2     
  Lines         182     192      +10     
=========================================
  Hits           18      18              
- Misses        164     174      +10
Impacted Files Coverage Δ
src/PanelGroup.js 12.05% <0%> (+2.16%) ⬆️
src/Panel.js 0% <0%> (ø)
src/Divider.js 2.7% <2.7%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 38d4523...6a8a43b. Read the comment docs.

Copy link
Owner

@DanFessler DanFessler left a comment

Choose a reason for hiding this comment

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

Love this PR. Thanks for the contribution. Couple of questions for you.

onResizeComplete = (i) => {
var tempPanels = this.state.panels.slice();

tempPanels[i].updated = true;
Copy link
Owner

@DanFessler DanFessler Mar 14, 2018

Choose a reason for hiding this comment

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

What is this tempPanels[i].updated property used for?

e.stopPropagation()
e.preventDefault()

return this.onResizeComplete(this.props.panelID)
Copy link
Owner

Choose a reason for hiding this comment

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

Aside from this new function, were there any other changes two Divider or Panel - I can't easily see the changes since you separated them into their own files

@pdfowler
Copy link
Author

@DanFessler I'll revisit this over the weekend ... been a busy few weeks since pushing this 🤹‍♂️

@cust0dian-old
Copy link

@pdfowler sorry for the ping, but would you be able to get back to this PR any time soon?

Being able to specify max width is a highly desirable feature for me and I'd love to see it land sooner rather than later, so I'd be willing to lend a hand or take over this PR if that OK with you (and maybe scope it down to just that feature, or break it into several PRs, if it would be easier to review for @DanFessler)

@pdfowler
Copy link
Author

pdfowler commented Apr 23, 2018 via email

@DanFessler
Copy link
Owner

max width merged with #27. If you'd like to submit a new PR for the onUpdate callback, feel free. I don't really understand its utility.

@DanFessler DanFessler closed this Nov 17, 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.

4 participants