Sefaria / Sefaria-Project

New Interfaces for Jewish Texts
https://www.sefaria.org
654 stars 268 forks source link

Module switcher #1936

Closed saengel closed 2 months ago

saengel commented 3 months ago

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:

saengel commented 2 months ago

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 :)