chore: use a constant instead of a number

This commit is contained in:
Daniel
2025-11-26 00:44:06 +01:00
parent 6056b8f122
commit 167d169f1a
2 changed files with 4 additions and 3 deletions

View File

@@ -227,7 +227,7 @@ const Wrapper = styled("div")`
`;
const DRAWER_WIDTH = 264;
const MIN_MAIN_CONTENT_WIDTH_FOR_MOBILE = 768;
export const MIN_MAIN_CONTENT_WIDTH_FOR_MOBILE = 768;
const MainContent = styled("div")<{ isDrawerOpen: boolean }>`
margin-left: ${({ isDrawerOpen }) =>

View File

@@ -3,6 +3,7 @@ import type { Model } from "@ironcalc/workbook";
import { IconButton, Tooltip } from "@mui/material";
import { CloudOff, PanelLeftClose, PanelLeftOpen } from "lucide-react";
import { useLayoutEffect, useRef, useState } from "react";
import { MIN_MAIN_CONTENT_WIDTH_FOR_MOBILE } from "../App";
import { FileMenu } from "./FileMenu";
import { HelpMenu } from "./HelpMenu";
import { downloadModel } from "./rpc";
@@ -77,7 +78,7 @@ export function FileBar(properties: {
{properties.isDrawerOpen ? <PanelLeftClose /> : <PanelLeftOpen />}
</DrawerButton>
</Tooltip>
{width > 768 && (
{width > MIN_MAIN_CONTENT_WIDTH_FOR_MOBILE && (
<FileMenu
newModel={properties.newModel}
newModelFromTemplate={properties.newModelFromTemplate}
@@ -92,7 +93,7 @@ export function FileBar(properties: {
onDelete={properties.onDelete}
/>
)}
{width > 768 && <HelpMenu />}
{width > MIN_MAIN_CONTENT_WIDTH_FOR_MOBILE && <HelpMenu />}
<WorkbookTitleWrapper>
<WorkbookTitle
name={properties.model.getName()}