From 24c634d40afbfa4a006817e471d59257fc748e14 Mon Sep 17 00:00:00 2001 From: Pabloader Date: Fri, 27 Mar 2026 19:44:41 +0000 Subject: [PATCH] Fix some mobile styles --- .../storywriter/assets/editor.module.css | 4 +++ .../storywriter/assets/sidebar.module.css | 5 ---- src/games/storywriter/components/editor.tsx | 2 +- src/games/storywriter/components/sidebar.tsx | 30 +++++-------------- 4 files changed, 13 insertions(+), 28 deletions(-) diff --git a/src/games/storywriter/assets/editor.module.css b/src/games/storywriter/assets/editor.module.css index 70c8d82..d86d7df 100644 --- a/src/games/storywriter/assets/editor.module.css +++ b/src/games/storywriter/assets/editor.module.css @@ -24,6 +24,10 @@ padding: 0 72px 72px; } +.content.menuContent { + padding-bottom: 10px; +} + .editable { width: 100%; min-height: 100%; diff --git a/src/games/storywriter/assets/sidebar.module.css b/src/games/storywriter/assets/sidebar.module.css index 7eb3fa6..5fc3c03 100644 --- a/src/games/storywriter/assets/sidebar.module.css +++ b/src/games/storywriter/assets/sidebar.module.css @@ -29,11 +29,6 @@ } .closed { - width: 32px; - min-width: 32px; -} - -.closed[data-controlled] { width: 0; min-width: 0; border: none; diff --git a/src/games/storywriter/components/editor.tsx b/src/games/storywriter/components/editor.tsx index ce4fb6a..adb8934 100644 --- a/src/games/storywriter/components/editor.tsx +++ b/src/games/storywriter/components/editor.tsx @@ -94,7 +94,7 @@ export const Editor = () => { return (
{currentStory &&
{currentStory.title}
} -
+
{currentTab === "menu" && ( )} diff --git a/src/games/storywriter/components/sidebar.tsx b/src/games/storywriter/components/sidebar.tsx index f57dd60..f6f1106 100644 --- a/src/games/storywriter/components/sidebar.tsx +++ b/src/games/storywriter/components/sidebar.tsx @@ -1,43 +1,29 @@ import clsx from "clsx"; import type { ComponentChildren } from "preact"; -import { useBool } from "@common/hooks/useBool"; import styles from '../assets/sidebar.module.css'; import { PanelLeftClose, PanelLeftOpen, PanelRightClose, PanelRightOpen } from "lucide-preact"; interface Props { side: 'left' | 'right'; children?: ComponentChildren; - open?: boolean; - onToggle?: () => void; - onCollapseChanged?: (collapsed: boolean) => void; + open: boolean; + onToggle: () => void; class?: string; } -export const Sidebar = ({ side, children, open: controlledOpen, onToggle, onCollapseChanged, class: className }: Props) => { - const internalOpen = useBool(true); - const isControlled = controlledOpen !== undefined; - const isOpen = isControlled ? controlledOpen : internalOpen.value; - - const handleToggle = () => { - if (isControlled) { - onToggle?.(); - } else { - internalOpen.toggle(); - } - onCollapseChanged?.(!isOpen); - }; +export const Sidebar = ({ side, children, open, onToggle, class: className }: Props) => { const isLeft = side === 'left'; const IconComponent = isLeft - ? (isOpen ? PanelLeftClose : PanelLeftOpen) - : (isOpen ? PanelRightClose : PanelRightOpen); + ? (open ? PanelLeftClose : PanelLeftOpen) + : (open ? PanelRightClose : PanelRightOpen); return ( -
- - {isOpen && ( + {open && (
{children}