-
-
Notifications
You must be signed in to change notification settings - Fork 295
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] Improve Core tutorial #3874
Conversation
I did this intentionally, to show how the composability works together with app router layouts |
import { LoadingButton } from '@mui/lab'; | ||
import { Box } from '@mui/material'; | ||
|
||
export default function NavigateButton() { |
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 it doesn't make sense to make this a separate file/component? Seems too specific, better for it to be in the intro page(s) directly?
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 a client component, so – I could be wrong – it must be in its own file with "use client" at the top
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 you can have 'use client'
as the first line inside the component?
But if in terms of file structure you think this makes more sense anyway it's not a big deal!
title: 'Page', | ||
icon: <DashboardIcon />, | ||
}, | ||
]; | ||
|
||
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) { | ||
return ( | ||
<html lang="en"> | ||
<html lang="en" data-toolpad-color-scheme="light"> |
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.
Matching the playground should be good here!
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 the playground app also contains the same attribute in the app/layout.tsx
file, isn'it? That's what I can see here: https://github.com/mui/mui-toolpad/blob/master/playground/nextjs/src/app/layout.tsx#L27
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.
Yep that's what I meant, was just confirming that it seems good!
The issue with this was that adding a second page required adding a |
Usually, the features of the CLI should drive the tutorial content, not the other way around. But I'm not heavily against the change, we can go with it for now. |
core-tutorial
example in sync with the docs pagecore-tutorial
to make the tutorial work better, for instance: AddPageContainer
todashboard/layout
instead ofdashboard/page/layout
NavigateButton
to the example to improve interactivity on the first button in dev mode:before.mov
after.mov