-
Notifications
You must be signed in to change notification settings - Fork 38
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
wrap all website examples in ThemeProvider #1353
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this search bar is supposed to be longer? (the rest of the bars in the SearchBox doc are also short)
Or did we update all input boxes to have a smaller size at some point? 🤔
@LostABike I've fixed the styles issue. It was because there was an additional wrapper element. It's a bit hacky but works. We'll need to find a more robust solution in the future. The problem was that #1300 introduced an extra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
export { default as VisuallyHiddenIconExample } from './VisuallyHidden.icon'; | ||
export { default as VisuallyHiddenMoreTextExample } from './VisuallyHidden.moretext'; | ||
import * as React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a lot of lines 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, but it's a lot fewer lines than adding <ThemeProvider></ThemeProvider>
manually to every single example usage - especially when you consider that we will start using examples in other places (like #1352)
Good catch, but this means context is actually working now (previously it portaled into |
Changes
What I did: Changed
examples/index.tsx
so that all exports are wrapped in<ThemeProvider>
using a HOCwithThemeProvider
. Also some examples were using (nonexistent)args
, so removed those too.Why: In #1351, toasts were not working on website because context was not being found somehow. I figured out it's because context doesn't work in Astro between islands. (Previously,
ThemeProvider
and the examples were rendered in separate islands). Within the same island, context works fine.Testing
Tested against #1351 and toasts are now correctly showing up!
Screen.Recording.2023-06-13.at.3.45.04.PM.mov
Docs
N/A