Skip to content

Commit

Permalink
fix mobile dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
actualwitch committed Dec 23, 2024
1 parent 23d9d75 commit 9107ab3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Mobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styled from "@emotion/styled";
import { useAtom, useAtomValue } from "jotai";

import { css } from "@emotion/react";
import { isActionPanelOpenAtom, isNavPanelOpenAtom, layoutAtom } from "../state/common";
import { isActionPanelOpenAtom, isDarkModeAtom, isNavPanelOpenAtom, layoutAtom } from "../state/common";
import { Button, bs } from "../style";
import { type WithDarkMode, withDarkMode } from "../style/darkMode";
import { Palette } from "../style/palette";
Expand Down Expand Up @@ -41,13 +41,15 @@ export const MobileAction = styled.div`
`;

export const MobileHeader = () => {
const [isDarkMode] = useAtom(isDarkModeAtom);
const [isNavPanelOpen, setIsNavPanelOpened] = useAtom(isNavPanelOpenAtom);
const [isActionsPanelOpen, setIsActionPanelOpened] = useAtom(isActionPanelOpenAtom);
const layout = useAtomValue(layoutAtom);
if (layout !== "mobile") return null;
return (
<>
<MobileHeaderContainer
isDarkMode={isDarkMode}
onClick={() => {
setIsNavPanelOpened(!isNavPanelOpen);
}}
Expand Down
4 changes: 4 additions & 0 deletions src/style/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ export const appStyle = [
font: inherit;
}
body {
overflow-x: hidden;
}
${button}
${input}
`,
Expand Down

0 comments on commit 9107ab3

Please sign in to comment.