Skip to content

Commit

Permalink
Fix very minor layout issues
Browse files Browse the repository at this point in the history
  • Loading branch information
spaaaacccee committed May 19, 2024
1 parent e61eb6b commit 130bbf0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/components/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export function usePaper(): (e?: number) => SxProps<Theme> {
borderRadius: 4,
backdropFilter: "blur(32px)",
background: ({ palette }) =>
`url(img/noise.png), ${alpha(palette.background.paper, 0.8)}`,
`url(/img/noise.png), ${alpha(palette.background.paper, 0.8)}`,
backgroundSize: "32px 32px",
});
}
Expand Down
8 changes: 3 additions & 5 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,9 @@ function Content() {
function ContentWithTheme() {
const [mode] = useContext(ModeContext);
return (
<ThemeProvider theme={themes[mode]}>
<CssBaseline>
<Content />
</CssBaseline>
</ThemeProvider>
<CssBaseline>
<Content />
</CssBaseline>
);
}

Expand Down
27 changes: 16 additions & 11 deletions src/theme/Navbar/ColorModeToggle/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import BrowserOnly from "@docusaurus/BrowserOnly";
import { useColorMode, useThemeConfig } from "@docusaurus/theme-common";
import { DarkModeOutlined, LightModeOutlined } from "@mui/icons-material";
import { Box, IconButton } from "@mui/material";
Expand All @@ -11,16 +12,20 @@ export default function NavbarColorModeToggle({ className }) {
return null;
}
return (
<Box>
<IconButton
sx={{ color: "text.primary" }}
onClick={() => {
setColorMode(mode === "light" ? "dark" : "light");
setMode(mode === "light" ? "dark" : "light");
}}
>
{mode === "dark" ? <LightModeOutlined /> : <DarkModeOutlined />}
</IconButton>
</Box>
<BrowserOnly>
{() => (
<Box>
<IconButton
sx={{ color: "text.primary" }}
onClick={() => {
setColorMode(mode === "light" ? "dark" : "light");
setMode(mode === "light" ? "dark" : "light");
}}
>
{mode === "dark" ? <LightModeOutlined /> : <DarkModeOutlined />}
</IconButton>
</Box>
)}
</BrowserOnly>
);
}

0 comments on commit 130bbf0

Please sign in to comment.