diff --git a/docs/data/joy/getting-started/templates/email/components/EmailContent.tsx b/docs/data/joy/getting-started/templates/email/components/EmailContent.tsx index cdd1a459d2adc1..5e0acece0ac9ec 100644 --- a/docs/data/joy/getting-started/templates/email/components/EmailContent.tsx +++ b/docs/data/joy/getting-started/templates/email/components/EmailContent.tsx @@ -160,7 +160,8 @@ export default function EmailContent() { Yosemite National Park @@ -168,7 +169,8 @@ export default function EmailContent() { Yosemite National Park diff --git a/docs/data/joy/getting-started/tutorial/LoginFinal.js b/docs/data/joy/getting-started/tutorial/LoginFinal.js index ee7b6c45e6f741..ebb448485e35c4 100644 --- a/docs/data/joy/getting-started/tutorial/LoginFinal.js +++ b/docs/data/joy/getting-started/tutorial/LoginFinal.js @@ -6,7 +6,7 @@ import TextField from '@mui/joy/TextField'; import Button from '@mui/joy/Button'; import Link from '@mui/joy/Link'; -const ModeToggle = () => { +function ModeToggle() { const { mode, setMode } = useColorScheme(); const [mounted, setMounted] = React.useState(false); @@ -23,17 +23,13 @@ const ModeToggle = () => { ); -}; +} export default function App() { return ( @@ -42,7 +38,7 @@ export default function App() { - + Sign up} fontSize="sm" diff --git a/docs/data/joy/getting-started/tutorial/tutorial.md b/docs/data/joy/getting-started/tutorial/tutorial.md index e6bd133873ad1b..e958ab0d748ce2 100644 --- a/docs/data/joy/getting-started/tutorial/tutorial.md +++ b/docs/data/joy/getting-started/tutorial/tutorial.md @@ -15,9 +15,9 @@ By the end, you should understand how to: ## Interactive demo -Here's what the final product looks like—click on the **< >** icon underneath the demo to see the full source code: +Here's what the final product looks like—click on the **<>** icon underneath the demo to see the full source code: -{{"demo": "LoginFinal.js", "hideToolbar": false, "bg": true}} +{{"demo": "LoginFinal.js"}} ## Prerequisites @@ -63,7 +63,7 @@ Replace your basic Sheet from the previous step with the following `sx`-styled S ```jsx + { +function ModeToggle() { const { mode, setMode } = useColorScheme(); const [mounted, setMounted] = React.useState(false); @@ -209,30 +205,26 @@ const ModeToggle = () => { ); -}; +} ``` Finally, add your newly built `` button above ``: ```diff export default function App() { - return ( - + return ( + + - ... - - ); -} + ... + + ); + } ``` Your app should now look like the [interactive demo](#interactive-demo) at the top of the page. diff --git a/docs/data/material/experimental-api/css-theme-variables/migration.md b/docs/data/material/experimental-api/css-theme-variables/migration.md index 52b5e7eb2116bf..8c18fb7b0cd182 100644 --- a/docs/data/material/experimental-api/css-theme-variables/migration.md +++ b/docs/data/material/experimental-api/css-theme-variables/migration.md @@ -151,7 +151,7 @@ import { useColorScheme, } from '@mui/material/styles'; -const ModeToggle = () => { +function ModeToggle() { const { mode, setMode } = useColorScheme(); return ( ); -}; +} const theme = extendTheme({ // ...your custom theme diff --git a/docs/public/_redirects b/docs/public/_redirects index f6194a2a145c04..f1b69e582e160d 100644 --- a/docs/public/_redirects +++ b/docs/public/_redirects @@ -3,6 +3,7 @@ /inbox* / 301 /trash / 301 /spam / 301 +/sign-up / 301 /size-snapshot https://s3.eu-central-1.amazonaws.com/mui-org-ci/artifacts/master/latest/size-snapshot.json 200 diff --git a/docs/src/modules/components/Demo.js b/docs/src/modules/components/Demo.js index 7d61b17c58e032..895e2c2f00ae6a 100644 --- a/docs/src/modules/components/Demo.js +++ b/docs/src/modules/components/Demo.js @@ -250,10 +250,23 @@ const InitialFocus = styled(IconButton)(({ theme }) => ({ height: theme.spacing(4), pointerEvents: 'none', })); + export default function Demo(props) { const router = useRouter(); const asPathWithoutLang = router.asPath.replace(/^\/[a-zA-Z]{2}\//, '/'); const { demo, demoOptions, disableAd, githubLocation, mode } = props; + + if (process.env.NODE_ENV !== 'production') { + if (demoOptions.hideToolbar === false) { + throw new Error( + [ + '"hiddenToolbar": false is already the default.', + `Please remove the property in {{"demo": "${demoOptions.demo}", …}}.`, + ].join('\n'), + ); + } + } + const t = useTranslate(); const codeVariant = useCodeVariant(); const demoData = useDemoData(codeVariant, demo, githubLocation); @@ -339,7 +352,7 @@ export default function Demo(props) { - + {demoOptions.hideToolbar ? null : ( }> }>