From cd050a59f9a3d231ca14ce383a7daf9a765d1cd7 Mon Sep 17 00:00:00 2001 From: 1ilit Date: Fri, 17 May 2024 03:45:42 +0300 Subject: [PATCH] Fix styling for overflowing elements --- src/components/EditorHeader/Modal/Modal.jsx | 1 + src/components/EditorHeader/Modal/New.jsx | 2 +- .../EditorSidePanel/AreasTab/AreasTab.jsx | 14 +++--- .../EditorSidePanel/NotesTab/NotesTab.jsx | 28 ++++++----- .../EditorSidePanel/TablesTab/TableInfo.jsx | 20 +++----- .../EditorSidePanel/TablesTab/TablesTab.jsx | 14 +++--- .../EditorSidePanel/TypesTab/TypesTab.jsx | 46 +++++++++---------- 7 files changed, 55 insertions(+), 70 deletions(-) diff --git a/src/components/EditorHeader/Modal/Modal.jsx b/src/components/EditorHeader/Modal/Modal.jsx index 409f017..d92ed19 100644 --- a/src/components/EditorHeader/Modal/Modal.jsx +++ b/src/components/EditorHeader/Modal/Modal.jsx @@ -333,6 +333,7 @@ export default function Modal({ }} cancelText={t("cancel")} width={modal === MODAL.NEW ? 740 : 600} + bodyStyle={{ maxHeight: window.innerHeight - 280, overflow: "auto" }} > {getModalBody()} diff --git a/src/components/EditorHeader/Modal/New.jsx b/src/components/EditorHeader/Modal/New.jsx index 48151fb..81ffcdb 100644 --- a/src/components/EditorHeader/Modal/New.jsx +++ b/src/components/EditorHeader/Modal/New.jsx @@ -10,7 +10,7 @@ export default function New({ selectedTemplateId, setSelectedTemplateId }) { const templates = useLiveQuery(() => db.templates.toArray()); return ( -
+
setSelectedTemplateId(0)}>
- - - - - +
+ +
- - +
+
{areas.length <= 0 ? ( - - - - setSelectedElement((prev) => ({ - ...prev, - id: parseInt(activeKey), - })) - } - /> - - +
+ + setSelectedElement((prev) => ({ + ...prev, + id: parseInt(activeKey), + })) + } + /> +
- - +
+
{notes.length <= 0 ? ( ) : ( diff --git a/src/components/EditorSidePanel/TablesTab/TableInfo.jsx b/src/components/EditorSidePanel/TablesTab/TableInfo.jsx index b23a16e..63bf392 100644 --- a/src/components/EditorSidePanel/TablesTab/TableInfo.jsx +++ b/src/components/EditorSidePanel/TablesTab/TableInfo.jsx @@ -1,8 +1,6 @@ import { useState } from "react"; import { Collapse, - Row, - Col, Input, TextArea, Button, @@ -210,8 +208,8 @@ export default function TableInfo({ data }) { - - +
+
@@ -263,12 +261,12 @@ export default function TableInfo({ data }) { showArrow >
- - +
+
- - - -
+
); } diff --git a/src/components/EditorSidePanel/TablesTab/TablesTab.jsx b/src/components/EditorSidePanel/TablesTab/TablesTab.jsx index 113c35d..47e99cd 100644 --- a/src/components/EditorSidePanel/TablesTab/TablesTab.jsx +++ b/src/components/EditorSidePanel/TablesTab/TablesTab.jsx @@ -1,4 +1,4 @@ -import { Collapse, Row, Col, Button } from "@douyinfe/semi-ui"; +import { Collapse, Button } from "@douyinfe/semi-ui"; import { IconPlus } from "@douyinfe/semi-icons"; import { useSelect, useTables } from "../../../hooks"; import { ObjectType } from "../../../data/constants"; @@ -14,16 +14,14 @@ export default function TablesTab() { return ( <> - - - - - +
+ +
- - +
+
{tables.length === 0 ? ( ) : ( diff --git a/src/components/EditorSidePanel/TypesTab/TypesTab.jsx b/src/components/EditorSidePanel/TypesTab/TypesTab.jsx index aee15b2..aec0701 100644 --- a/src/components/EditorSidePanel/TypesTab/TypesTab.jsx +++ b/src/components/EditorSidePanel/TypesTab/TypesTab.jsx @@ -1,4 +1,4 @@ -import { Collapse, Row, Col, Button, Popover } from "@douyinfe/semi-ui"; +import { Collapse, Button, Popover } from "@douyinfe/semi-ui"; import { IconPlus, IconInfoCircle } from "@douyinfe/semi-icons"; import { useSelect, useTypes } from "../../../hooks"; import { ObjectType } from "../../../data/constants"; @@ -14,33 +14,29 @@ export default function TypesTab() { return ( <> - - - - - +
+ +
- - - - {t("types_info") - .split("\n") - .map((line, index) => ( -
{line}
- ))} -
- } - showArrow - position="rightTop" - > -
+ + {t("types_info") + .split("\n") + .map((line, index) => ( +
{line}
+ ))} +
+ } + showArrow + position="rightTop" + > +
{types.length <= 0 ? ( ) : (