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

[Storybook] fix(.storybook/preview): sync theme from global with storage key #13672

Merged

Conversation

TylerAPfledderer
Copy link
Contributor

@TylerAPfledderer TylerAPfledderer commented Aug 16, 2024

Description

Fixes issue in Storybook where the update of color mode in the global context was not being recognized in the next-themes provider, as the storage key the provider uses was not updating.

Creates a custom withNextthemes decorator that initializes the global theme and sends it to next-themes via setTheme(). This should ensure the default theme gets to the provider on first load.

See Writing a [next-themes] custom decorator

@github-actions github-actions bot added the tooling 🔧 Changes related to tooling of the project label Aug 16, 2024
Copy link

netlify bot commented Aug 16, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit bf1edaa
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/66bfa1a7afa6590008c51e68
😎 Deploy Preview https://deploy-preview-13672--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 46 (🔴 down 3 from production)
Accessibility: 93 (no change from production)
Best Practices: 83 (🔴 down 9 from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@TylerAPfledderer TylerAPfledderer marked this pull request as draft August 16, 2024 18:22
@TylerAPfledderer
Copy link
Contributor Author

@pettinarip hit a blocker with Chromatic check. Not sure if I can do anything about it

@pettinarip
Copy link
Member

@pettinarip hit a blocker with Chromatic check. Not sure if I can do anything about it

A re-run did it. A dep fetch had failed.

@TylerAPfledderer TylerAPfledderer marked this pull request as ready for review August 19, 2024 19:18
Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @TylerAPfledderer

@pettinarip pettinarip merged commit d02cfc3 into ethereum:dev Aug 21, 2024
9 of 11 checks passed
This was referenced Aug 21, 2024
@TylerAPfledderer TylerAPfledderer deleted the fix/sb-color-mode-next-themes-sync branch August 22, 2024 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling 🔧 Changes related to tooling of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants