-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[docs][joy-ui] Move tutorial to iframe #40567
Conversation
Netlify deploy previewBundle size report |
165efc0
to
16aa6ed
Compare
if (!mounted) { | ||
return null; | ||
return <Button variant="soft">Change mode</Button>; | ||
} |
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.
Solve layout shift, annoying.
@@ -35,59 +35,56 @@ function ModeToggle() { | |||
|
|||
export default function LoginFinal() { | |||
return ( | |||
<CssVarsProvider> |
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.
This is duplicated, global styles are injected twice in the page, creating mess in the dev tools to debug.
Don't have an account? | ||
<main> | ||
<ModeToggle /> | ||
<CssBaseline /> |
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.
This was missing, not following the docs. I noticed because the export to codesandbox wouldn't look the same as in the iframe.
if (demoOptions.bg == null) { | ||
demoOptions.bg = 'outlined'; | ||
} | ||
|
||
if (demoOptions.iframe) { | ||
demoOptions.bg = true; | ||
if (demoOptions.iframe) { | ||
demoOptions.bg = true; | ||
} | ||
} | ||
|
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.
A Docs-infra bug, even if we set a default background for iframe different than for non-iframe demos, we should still be able to customize it.
{{"demo": "LoginFinal.js"}} | ||
{{"demo": "LoginFinal.js", "iframe": true, "height": 500, "bg": "outlined"}} |
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.
This demo shows a full page. I believe it makes more sense to isolate the code in an iframe.
https://mui.com/joy-ui/getting-started/tutorial/#interactive-demo has a couple of issues that this PR fix.