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

Feature: Optimize theme switcher performance #4124

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

KevinMulhern
Copy link
Member

Because:

This commit:

  • Toggles the theme class in the same turbo stream request we use to update the theme icon.
  • Adds a custom turbo stream action to toggle classes on elements

Before:
https://github.com/TheOdinProject/theodinproject/assets/7963776/6870d2a3-27af-413a-9df8-3adca85d6c4d

After:
https://github.com/TheOdinProject/theodinproject/assets/7963776/28cbb153-2348-4976-b11a-8245d85143fd

@KevinMulhern KevinMulhern force-pushed the feature/speed-up-theme-switching branch from 6c1d135 to e0541e0 Compare September 9, 2023 09:32
@KevinMulhern KevinMulhern self-assigned this Sep 9, 2023
@KevinMulhern KevinMulhern added the Type: Enhancement Involves a new feature or enhancement request label Sep 9, 2023
@KevinMulhern KevinMulhern temporarily deployed to odin-review-app-pr-4124 September 9, 2023 09:37 Inactive
@CouchofTomato
Copy link
Member

My bad on the merge conflict mate.

Because:
* There is a noticeable delay between switching the theme and the theme icon updating

This commit:
* Toggles the theme class in the same turbo stream request we use to update the theme icon.
* Adds a custom turbo stream action to toggle classes on elements
@KevinMulhern KevinMulhern temporarily deployed to odin-review-app-pr-4124 September 11, 2023 17:30 Inactive
@KevinMulhern KevinMulhern merged commit 1e0b7b1 into main Sep 11, 2023
3 checks passed
@KevinMulhern KevinMulhern deleted the feature/speed-up-theme-switching branch September 11, 2023 17:37
@KevinMulhern
Copy link
Member Author

No worries @CouchofTomato, easy enough sorted. Thanks for the review mate 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Involves a new feature or enhancement request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants