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

[PanelStack] use IPanel in openPanel() public API #2738

Merged
merged 4 commits into from
Jul 30, 2018

Conversation

giladgray
Copy link
Contributor

  • openPanel accepts IPanel instead of three args.
    -this is more future-proof as we can update the one interface in non-breaking ways and see benefits everywhere, whereas changing the signature of the function would be breaking.
  • PanelView onClose/Open props cleans up the PanelStack logic

cc @kadhirvelm

@blueprint-bot
Copy link

PanelView onClose/Open props skips getPanelProps() step

Preview: documentation | landing | table

@blueprint-bot
Copy link

fix tests

Preview: documentation | landing | table

Copy link
Contributor

@kadhirvelm kadhirvelm left a comment

Choose a reason for hiding this comment

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

One tiny thing, not major though

safeInvoke(this.props.onClose, panel);
this.setState(state => ({
direction: "pop",
stack: state.stack.filter(p => p !== panel),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we not slice(1) here again? If the panel is not at the top of the stack, it won't get here either way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's not necessarily at the top inside this callback as it's async. the filter is ultimately the most robust check.

@giladgray giladgray merged commit 9dac016 into km/panel-stack Jul 30, 2018
@giladgray giladgray deleted the gg/panel-view-props branch July 30, 2018 21:51
giladgray pushed a commit that referenced this pull request Jul 30, 2018
* Added panel stack

* First test integrated

* Tests added

* Transitions adjusted

* Updated readme

* Made lower case

* Dark theme added

* Linting fixed

* Review items fixed, transitions reverted

* Removed extra panelClassName

* _panel-stack.scss

* minor docs

* updated tests

* Tests adjusted and fixed

* [PanelStack] refactors & fix transitions (#2717)

* fix the transitions!

* example refactor: move stack to options bar

* lint example

* refactor header styles to use fewer classes

* Classes.PANEL_STACK

* fix tests

* style fixes, simpler transition

* no stack limit

* back button nowrap

* Adjusted transition to include opacity and -50% left movement

* Removed useless type checking

* Fixed opacity

* Opacity

* Opacity flipped

* Removed 0

* Reversed opacities

* One more attempt

* [PanelStack] merge some files (#2719)

* merge PanelHeader into PanelView

* panelProps file with more docs

* panelProps.ts

* export panelProps, more docs

* example key

* docs

* safeInvoke

* changed easing settings

* fix copyrights

* onClose/Open param names

* [PanelStack] use IPanel in openPanel() public API (#2738)

* openPanel accepts IPanel instead of three args

* PanelView onClose/Open props skips getPanelProps() step

* fix tests

* remove IPanelPptions

* [PanelStack] documentation (#2737)

* PanelStack docs

* more docs refactors

* adjust docs-modifiers margins

* remove "pop the stack"
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.

3 participants