fix: error initial style when first in dark mode (#1543)
This commit is contained in:
@@ -38,7 +38,7 @@ const ThemeInjector = React.memo<{
|
|||||||
|
|
||||||
const ThemeProviderInner = memo<React.PropsWithChildren>(
|
const ThemeProviderInner = memo<React.PropsWithChildren>(
|
||||||
function ThemeProviderInner({ children }) {
|
function ThemeProviderInner({ children }) {
|
||||||
const { theme } = useTheme();
|
const { resolvedTheme: theme } = useTheme();
|
||||||
const [currentWorkspace] = useCurrentWorkspace();
|
const [currentWorkspace] = useCurrentWorkspace();
|
||||||
const currentPage = useCurrentPage();
|
const currentPage = useCurrentPage();
|
||||||
const pageMeta = usePageMeta(currentWorkspace?.blockSuiteWorkspace ?? null);
|
const pageMeta = usePageMeta(currentWorkspace?.blockSuiteWorkspace ?? null);
|
||||||
@@ -71,9 +71,10 @@ const themes = ['dark', 'light'];
|
|||||||
|
|
||||||
export const ThemeProvider = ({
|
export const ThemeProvider = ({
|
||||||
children,
|
children,
|
||||||
|
...props
|
||||||
}: PropsWithChildren<ThemeProviderProps>) => {
|
}: PropsWithChildren<ThemeProviderProps>) => {
|
||||||
return (
|
return (
|
||||||
<NextThemeProvider themes={themes}>
|
<NextThemeProvider themes={themes} enableSystem={true} {...props}>
|
||||||
<ThemeProviderInner>{children}</ThemeProviderInner>
|
<ThemeProviderInner>{children}</ThemeProviderInner>
|
||||||
</NextThemeProvider>
|
</NextThemeProvider>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ export const StyledButton = styled('button', {
|
|||||||
? {
|
? {
|
||||||
cursor: 'not-allowed',
|
cursor: 'not-allowed',
|
||||||
pointerEvents: 'none',
|
pointerEvents: 'none',
|
||||||
color: theme.colors.borderColor,
|
color: theme.colors.disableColor,
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
transition: 'background .15s',
|
transition: 'background .15s',
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export const StyledMenuItem = styled('button')<{
|
|||||||
cursor: isDir ? 'pointer' : '',
|
cursor: isDir ? 'pointer' : '',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
backgroundColor: 'transparent',
|
backgroundColor: 'transparent',
|
||||||
|
color: theme.colors.textColor,
|
||||||
':hover': {
|
':hover': {
|
||||||
color: theme.colors.primaryColor,
|
color: theme.colors.primaryColor,
|
||||||
backgroundColor: theme.colors.hoverBackground,
|
backgroundColor: theme.colors.hoverBackground,
|
||||||
|
|||||||
Reference in New Issue
Block a user