我如何使用theprovider造型材料daterangepicker?
我正在尝试设计超级派。我希望该元素显示黑暗模式,但仍显示光模式。
这是我正在使用的软件包: https://github.com/ jungsoft/材料 - daterange-picker/esloces/5
如果我尝试此叉子,它确实有效: https://github.com/nikhilgoud/nikhilgoud/materialialui-daterange-picker
但是还有另一个问题。残疾日期不会出现。
是否不可能以这种方式造型DateTangePicker?还是还有另一种样式的方式?
const theme = createTheme({
palette: {
// Dark Mode
mode: 'dark',
primary: {
main: "#0057FF"
},
},
});
return (
<StyledEngineProvider injectFirst>
<ThemeProvider theme={theme}>
<DateRangePicker
open={open}
toggle={() => {toggle()}}
onChange={(dateRange) => {onChange(dateRange)}}
maxDate={new Date(Date.now())}
wrapperClassName="w-max"
initialDateRange={initialDateRange}
/>
</ThemeProvider>
</StyledEngineProvider>
)
I'm trying to style the DateRangePicker. I would expect the element to show the dark mode but it's still showing the light mode.
This is the package that I'm using: https://github.com/jungsoft/materialui-daterange-picker/issues/5
If I try this fork it does work:
https://github.com/nikhilgoud/materialui-daterange-picker
However that package has another problem. The disabled dates don't show up.
Is it not possible to style the DateRangePicker this way? Or Is there another way to style it?
const theme = createTheme({
palette: {
// Dark Mode
mode: 'dark',
primary: {
main: "#0057FF"
},
},
});
return (
<StyledEngineProvider injectFirst>
<ThemeProvider theme={theme}>
<DateRangePicker
open={open}
toggle={() => {toggle()}}
onChange={(dateRange) => {onChange(dateRange)}}
maxDate={new Date(Date.now())}
wrapperClassName="w-max"
initialDateRange={initialDateRange}
/>
</ThemeProvider>
</StyledEngineProvider>
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以防万一其他人仍在寻找答案。
面对同一问题,发现工作 fork 。
该软件包都可以拾取MUI主题播放器样式并正确显示残疾日期。
安装:
或纱线
Just in case someone else is still looking for an answer.
Faced the same issue and found a working fork.
This package both picks up the MUI ThemeProvider styles and correctly displays disabled dates.
Installation:
or with yarn