react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

Custom theme not working after adding custom appLayout

Open tjvanderende opened this issue 8 years ago • 3 comments

What you were expecting: My custom theme applying to the layout as described in the documentation

What happened instead: The custom theme is not working. (Just setting its default) after adding appLayout. When applying MuiLayoutProvider manually in my appLayout (By wrapping the outer

) it is only applying the style on my content (thus ingnoring AppBar & Sidebar).

Steps to reproduce: Create a custom layout and add it on the Admin component. Like <Admin theme={theme} dashboard={Dashboard} dataProvider={dataProvider} title="" appLayout={Layout}

Used the code described on this page for the appLayout: https://marmelab.com/react-admin/Theming.html#using-a-custom-layout And for a custom theme: https://marmelab.com/react-admin/Theming.html#writing-a-custom-theme

React-admin version: 2.1.2 Last version that did not exhibit the issue (if applicable): - React version: 16.4.1 Browser: Chrome 67.0.3 Stack trace (in case of a JS error): -

tjvanderende avatar Jul 18 '18 10:07 tjvanderende

How did you customize the Layout ? Did you extend the default one or created your own ?

djhi avatar Jul 18 '18 12:07 djhi

Did the last one, so I guess creating a own one and not extending: https://marmelab.com/react-admin/Theming.html#using-a-custom-layout. Should I extend one?

tjvanderende avatar Jul 18 '18 12:07 tjvanderende

Depends on what you want to change. If you only want to override the appBar, the menu, or the notification component, just extend the default one.

If you want more, you'll have to implement your own and include the MuiThemeProvider by yourself like we do in the default layout here

djhi avatar Jul 18 '18 13:07 djhi