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

Module switcher #1936

Conversation

saengel
Copy link
Contributor

@saengel saengel commented Jun 24, 2024

Description

Module switcher first pass for modularization

Code changes:

  1. s2.css - Styling for the new <DropdownMenu /> generic component, and all of its sub-components. Small shifts to existing code for .interfaceLinks-options to enable compatibility with the existing language menu dropdown and the new generic dropdown, mostly with using flex for text alignment & switching between languages, as opposed to setting text-align
  2. static/js/common/DropdownMenu.jsx - A new file containing a generic dropdown menu (to be reused in the future) that's able to render children as a composable component. Heavily based on the existing code for <InterfaceLanguageMenu /> in Misc.jsx. The subcomponents are re-usable as well.
  3. static/js/Header.jsx - Added the module switcher next to the language toggle, with the implementation configuration of the composable components in such a way to meet the specs of this specific project.
  4. Added the specific icons needed for the specific implementation of the module switcher.

Notes:

  • Once sheets vs library internal state is confirmed, the logic around opening links will have to be slightly modified to enable conditional opening in a new tab.

@saengel saengel self-assigned this Jun 24, 2024
Copy link
Contributor

@edamboritz edamboritz left a comment

Choose a reason for hiding this comment

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

This is great work

As discussed -

  1. Lets make the css for the generic component its own. As in separate it out from existing css and give distinct class names rather than ones that existed on the menu used for inspiration
  2. Lets move out the code for the module switcher into its own component and use that inside the Header render
  3. We can use above new component to set things things like width that should be flexible on the generic component

@saengel
Copy link
Contributor Author

saengel commented Jul 30, 2024

Thank you for the helpful feedback @edamboritz - I just finished pushing changes which address all of the above. Let me know what you think now :)

@saengel saengel requested a review from edamboritz July 30, 2024 07:50
@saengel saengel merged commit a9c343d into modularization-main Aug 5, 2024
16 of 17 checks passed
@saengel saengel deleted the feature/sc-26679/implement-module-switcher-in-main-navigation branch August 5, 2024 12:57
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