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

Update drop drown for logged in desktop (library) #2021

Conversation

saengel
Copy link
Contributor

@saengel saengel commented Sep 4, 2024

Description

Updating the user drop down for library logged-in view.

Code Changes

  1. In static/css/s2.css - CSS shifts to get everything working, tested to make sure it doesn't break anything. Commenting out the chevron dropdown (see note below)
  2. static/icons/logged_out.svg - The icon for logged out users.
  3. static/js/Header.jsx - The new logged in dropdown component (<LoggedInDropdown />), rendering it. Fixes also to the module switcher to jive with the adjustment to <DropdownMenu />
  4. static/js/common/DropdownMenu.jsx - Adjusting the dropdown menu component to flexibly allow opening in new tabs vs same window, and accepting an icon component instead of a url for more flexibility.

Notes

  • A subtle shift was introduced to the <DropdownMenu /> component, accepting the icon image (from which the dropdown 'hangs') as a component instead of a url string. This allows for greater flexibility when rendering components like the initials icon. We will need to likely shift some small pieces in other PRs for everything to merge seamlessly, but it should be fairly easy.
  • The hanging chevron was commented out, seems to no longer be in spec. Will return if needed.

@saengel saengel self-assigned this Sep 4, 2024
<DropdownMenuItemWithIcon icon={'/static/icons/library_icon.svg'} textEn={'Library'} textHe={'ספריה'} />
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem url={'//sheets.sefaria.org'}>
<DropdownMenuItem url={'//sheets.sefaria.org'} newTab={true}>
Copy link
Contributor

Choose a reason for hiding this comment

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

What are these double slashes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To make the URL not relative (i.e. route to sheets.sefaria.org vs localhost:8000/sheets.sefaria.org). It's a bit hacky, is there a better way to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might be /sheets, confirm with SK.

static/js/common/DropdownMenu.jsx Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this icon in this PR if the PR is for logged in menu?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mistake, taking out. Thanks for catching :)

<DropdownMenuItemWithIcon icon={'/static/icons/sheets_icon.svg'} textEn={'Sheets'} textHe={'דפים'}/>
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem url={'//developers.sefaria.org'}>
<DropdownMenuItem url={'//developers.sefaria.org'} newTab={true}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switch to full URL

@saengel saengel requested review from edamboritz and yitzhakc and removed request for akiva10b November 19, 2024 11:05
@saengel saengel merged commit de21ad2 into modularization-main Nov 20, 2024
15 of 18 checks passed
@saengel saengel deleted the feature/sc-27509/library-update-drop-drown-for-logged-in-desktop branch November 20, 2024 12:22
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