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

Move mobile display detection to Redux #1717

Merged
merged 4 commits into from
Nov 10, 2023

Conversation

victorlin
Copy link
Member

@victorlin victorlin commented Oct 23, 2023

Description of proposed changes

Addressing a task defined in a comment:

as state here, but his has since ben moved to redux state. The mobile
display should likewise be lifted to redux state */

and getting rid of the prop drilling before more layers are added in #1704.

Related issue(s)

Testing

  • Checks pass
  • There should be no functional changes, and it'd be good to check that all modified components still behave properly.
    • Confirm existing behavior: Interface on a window with narrow width defaults to hidden sidebar, and when the sidebar is opened, there is no info icon for hover. Tested locally on Chromium and Safari.

Previously, it was determined in the Main component and passed down as
props.

It is still passed down as props, but that is no longer necessary and
subsequent commits will remove that.

I chose state.general.mobileDisplay since this seems like a "general"
value.
It is now available in the Redux state, so access it directly within
AnnotatedHeader and ChooseExplodeAttr.
This was already unused in NavBar, and it is newly unused in Sidebar.
Instead of passing down from Main.

Also take the opportunity to convert this file to TypeScript.
@victorlin victorlin self-assigned this Oct 23, 2023
@nextstrain-bot nextstrain-bot temporarily deployed to auspice-victorlin-move--ralwm0 October 23, 2023 22:51 Inactive
Copy link
Member

@jameshadfield jameshadfield left a comment

Choose a reason for hiding this comment

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

Thanks!

@victorlin victorlin merged commit 477d27b into master Nov 10, 2023
19 checks passed
@victorlin victorlin deleted the victorlin/move-mobileDisplay-to-redux branch November 10, 2023 00:04
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