Skip to content

Commit

Permalink
Update base provider props
Browse files Browse the repository at this point in the history
  • Loading branch information
Luiyit committed Jul 27, 2023
1 parent 59c5bdc commit b52f1ca
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions core/providers/base/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import { ThemeConfig } from 'antd';

interface Props extends ComponentProps {
config?: CoreConfig | undefined | null;
theme?: ThemeConfig
theme?: ThemeConfig,
disableDarkMode?: boolean
}

const BaseCoreProviders: FC<Props> = ({ children, config, theme }) => {
const BaseCoreProviders: FC<Props> = ({ children, config, theme, disableDarkMode }) => {
return (
<ConfigProvider config={config} >
<ThemeProvider theme={theme}>
<ThemeProvider {...{ theme, disableDarkMode }}>
<NotifierProvider>
{ children }
</NotifierProvider>
Expand Down
1 change: 0 additions & 1 deletion core/providers/config/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ interface Props extends ComponentProps {
}

const ConfigProvider: FC<Props> = ({ children, config }) => {
console.log(generateConfig(config))
const [state, setState] = useState<ProviderValueI>(generateConfig(config));

useOnChange(() => {
Expand Down
2 changes: 2 additions & 0 deletions core/providers/theme/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const AntdThemeProvider: FC<AntdThemeProviderProps> = ({ children, disableDarkMo
setDark(dark)
}

console.log("dark: ", dark)

return (
<ConfigProvider
theme={{
Expand Down
2 changes: 1 addition & 1 deletion core/types/util.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type ComponentProps = {
className?: string;
}

export type LayoutType = 'sider' | 'main' | 'auth'
export type LayoutType = 'sider' | 'main' | 'auth' | 'none'

export type SubmitEvent = React.BaseSyntheticEvent<object, any, any>

Expand Down

0 comments on commit b52f1ca

Please sign in to comment.