chore: use a constant instead of a number
This commit is contained in:
@@ -227,7 +227,7 @@ const Wrapper = styled("div")`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const DRAWER_WIDTH = 264;
|
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 }>`
|
const MainContent = styled("div")<{ isDrawerOpen: boolean }>`
|
||||||
margin-left: ${({ isDrawerOpen }) =>
|
margin-left: ${({ isDrawerOpen }) =>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import type { Model } from "@ironcalc/workbook";
|
|||||||
import { IconButton, Tooltip } from "@mui/material";
|
import { IconButton, Tooltip } from "@mui/material";
|
||||||
import { CloudOff, PanelLeftClose, PanelLeftOpen } from "lucide-react";
|
import { CloudOff, PanelLeftClose, PanelLeftOpen } from "lucide-react";
|
||||||
import { useLayoutEffect, useRef, useState } from "react";
|
import { useLayoutEffect, useRef, useState } from "react";
|
||||||
|
import { MIN_MAIN_CONTENT_WIDTH_FOR_MOBILE } from "../App";
|
||||||
import { FileMenu } from "./FileMenu";
|
import { FileMenu } from "./FileMenu";
|
||||||
import { HelpMenu } from "./HelpMenu";
|
import { HelpMenu } from "./HelpMenu";
|
||||||
import { downloadModel } from "./rpc";
|
import { downloadModel } from "./rpc";
|
||||||
@@ -77,7 +78,7 @@ export function FileBar(properties: {
|
|||||||
{properties.isDrawerOpen ? <PanelLeftClose /> : <PanelLeftOpen />}
|
{properties.isDrawerOpen ? <PanelLeftClose /> : <PanelLeftOpen />}
|
||||||
</DrawerButton>
|
</DrawerButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
{width > 768 && (
|
{width > MIN_MAIN_CONTENT_WIDTH_FOR_MOBILE && (
|
||||||
<FileMenu
|
<FileMenu
|
||||||
newModel={properties.newModel}
|
newModel={properties.newModel}
|
||||||
newModelFromTemplate={properties.newModelFromTemplate}
|
newModelFromTemplate={properties.newModelFromTemplate}
|
||||||
@@ -92,7 +93,7 @@ export function FileBar(properties: {
|
|||||||
onDelete={properties.onDelete}
|
onDelete={properties.onDelete}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{width > 768 && <HelpMenu />}
|
{width > MIN_MAIN_CONTENT_WIDTH_FOR_MOBILE && <HelpMenu />}
|
||||||
<WorkbookTitleWrapper>
|
<WorkbookTitleWrapper>
|
||||||
<WorkbookTitle
|
<WorkbookTitle
|
||||||
name={properties.model.getName()}
|
name={properties.model.getName()}
|
||||||
|
|||||||
Reference in New Issue
Block a user