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

Refactor right panel header buttons #5117

Merged
merged 5 commits into from
Sep 25, 2017

Conversation

lukebarnard1
Copy link
Contributor

To reduce repetition of code, simplify the process of adding header buttons and remove the need for many handler functions.

Luke Barnard added 2 commits September 25, 2017 14:13
To reduce repetition of code, simplify the process of adding header buttons and remove the need for many handler functions.
@lukebarnard1
Copy link
Contributor Author

(I'll squash merge this)

Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

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

otherwise lgtm

// If currentPhase is one of the specified phases, the button will be highlighted
phases: PropTypes.arrayOf(PropTypes.string).isRequired,
// The currentPhase of the RightPanel
currentPhase: PropTypes.string.isRequired,
Copy link
Member

Choose a reason for hiding this comment

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

Is there likely to be any need for the button to know the actual phases it represents or what the current phase is? Could we just pass in whether it should be highlighted or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could we just pass in whether it should be highlighted or not?

I was hoping to abstract this logic away such that, for example, we can't get two buttons highlighted at once. It's probably overkill but if every single header button is going to embody this logic, it seems inefficient to dupe it for each one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, it needs to know for the dispatch so 🤷‍♂️

@dbkr dbkr assigned lukebarnard1 and unassigned dbkr Sep 25, 2017
@lukebarnard1 lukebarnard1 assigned dbkr and unassigned lukebarnard1 Sep 25, 2017
Luke Barnard added 3 commits September 25, 2017 16:06
Use isHighlighted as a prop instead of computing based on phases and currentPhase
@dbkr dbkr merged commit 798558e into develop Sep 25, 2017
@t3chguy t3chguy deleted the luke/refactor-right-panel-header-buttons branch May 12, 2022 09:00
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.

2 participants