-
-
Notifications
You must be signed in to change notification settings - Fork 287
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] Fix integration docs _app.tsx
#4239
[docs] Fix integration docs _app.tsx
#4239
Conversation
}; | ||
|
||
export default theme; | ||
function getDefaultLayout(page: React.ReactElement) { |
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.
For the purpose of this doc, would it make sense to just show the absolute minimal integration. Without authentication and getDefaultLayout
. Just simply showing the principles and leave the rest for the example?
Just copying the full example code in a doc is not very helpful to me, I can just go read it on github then.
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.
Agreed, I'll remove getDefaultLayout
as well. I've removed auth features and moved that to an optional bullet below this
Co-authored-by: Jan Potoms <[email protected]> Signed-off-by: Bharat Kashyap <[email protected]>
Looking better. How do you feel about removing the credentials provider in this section and only keep the oauth providers? Maybe we should also add something like "for a full example look here..."? |
Agreed, updated with those recommendations |
error.type === 'CredentialsSignin' | ||
? 'Invalid credentials.' | ||
: 'An error with Auth.js occurred.', | ||
error: 'An error with Auth.js occurred.', |
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.
Can this be?
error: 'An error with Auth.js occurred.', | |
error: error.message, |
type AppPropsWithLayout = AppProps & { | ||
Component: NextPageWithLayout; | ||
}; | ||
import type { Navigation } from '@toolpad/core'; |
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.
Would this be imported from '@toolpad/core/AppProvider';
?
cc @apedroferreira ?
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.
It can be, but all the exported types are also importable from @toolpad/core
.
If there's a reason not to allow this though we can change it.
In all the docs demos it's always being imported from just @toolpad/core
too.
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.
In core demoes it's encouraged to use subpath imports. We have eslint rules for this.
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.
Ok I thought it didn't apply to types and not getting any eslint warnings for those.
I can update all these type imports separately from this PR to use specific subpaths.
Edit: ah you mean they have that rule in MUI Core, I can copy it too then
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.
The problem we solve with it doesn't apply to types, but it's less confusing for users to be consistent. It also forces us to organize well.
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.
Few comments. Would make sure that there is a clear subpath to import Navigation
from
I've updated the |
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 everything has been addressed. Thank you 👍
No description provided.