Skip to content

Theme the lab2 share modal #66064

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

Open
wants to merge 7 commits into
base: staging
Choose a base branch
from
Open

Conversation

molly-moen
Copy link
Contributor

The lab2 share dialog was not using themed variables, and required a different approach to getting the theme value from the lab than other elements on the page. This is because the share dialog is rendered via the header, which is a whole different tree from the rest of the page. Therefore, it does not exist inside the ThemeContext in lab2 labs.

The simplest solution I could find to this problem was, for lab2 labs, to copy the theme value over to the header redux whenever it changes. I did this by setting up a useEffect in ProjectContainer that listens to the theme. The header is controlled entirely by the header redux (which version of the header is visible), so it made sense to put the theme value there. I don't love that we have to duplicate the value to the header redux, if anyone has other ideas let me know! I considered passing the theme in when we set up the header, but that didn't solve for how we respond to theme changes.

Dark mode should be mostly unchanged (there may be a slightly different white text color used to align with dsco). We have a special share modal for Music Lab Jam Session, which is specifically designed for dark mode. I made it readable in light mode but adjust the blue background used since it's unlikely to be seen in light mode.

Before

Screenshot 2025-05-22 at 2 00 08 PM Screenshot 2025-05-22 at 2 00 01 PM

After

Dark Mode

Screenshot 2025-05-22 at 2 00 42 PM Screenshot 2025-05-22 at 2 00 34 PM

Light Mode

Screenshot 2025-05-22 at 1 52 01 PM Screenshot 2025-05-22 at 1 50 42 PM

Links

Testing story

Tested locally.

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@molly-moen molly-moen marked this pull request as ready for review May 22, 2025 21:03
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.

1 participant