From c2e0cfae07d7ef51282b8810154956964a8165f5 Mon Sep 17 00:00:00 2001 From: IRBorisov <8611739+IRBorisov@users.noreply.github.com> Date: Mon, 4 Dec 2023 14:19:54 +0300 Subject: [PATCH] Small UI design improvements --- .../src/components/Common/Dropdown.tsx | 10 +- .../frontend/src/components/Common/Modal.tsx | 25 ++++- .../src/components/Help/HelpRSTemplates.tsx | 14 ++- .../src/components/Shared/SelectedCounter.tsx | 23 +++++ .../frontend/src/context/RSFormContext.tsx | 6 +- .../src/dialogs/DlgCloneLibraryItem.tsx | 90 +++++++++++++++++ .../frontend/src/dialogs/DlgCloneRSForm.tsx | 89 ----------------- .../DlgConstituentaTemplate.tsx | 2 +- .../frontend/src/dialogs/DlgCreateCst.tsx | 99 +++++++++---------- .../frontend/src/dialogs/DlgDeleteCst.tsx | 73 +++++++------- .../frontend/src/dialogs/DlgEditWordForms.tsx | 71 +++++++------ .../frontend/src/dialogs/DlgGraphParams.tsx | 6 +- .../frontend/src/dialogs/DlgRenameCst.tsx | 59 +++++------ rsconcept/frontend/src/dialogs/DlgShowAST.tsx | 69 +++++++------ rsconcept/frontend/src/index.css | 7 ++ .../ConstituentaToolbar.tsx | 22 ++--- .../EditorConstituenta/EditorConstituenta.tsx | 6 +- .../EditorConstituenta/FormConstituenta.tsx | 4 +- .../RSFormPage/EditorRSForm/EditorRSForm.tsx | 4 +- .../RSFormPage/EditorRSForm/FormRSForm.tsx | 14 +-- .../RSFormPage/EditorRSForm/RSFormToolbar.tsx | 10 +- .../RSFormPage/EditorRSList/EditorRSList.tsx | 41 ++++---- .../RSFormPage/EditorRSList/RSListToolbar.tsx | 86 ++++++++-------- .../pages/RSFormPage/EditorRSList/RSTable.tsx | 1 - .../EditorTermGraph/EditorTermGraph.tsx | 11 ++- .../EditorTermGraph/GraphToolbar.tsx | 30 +++--- .../EditorTermGraph/SelectedCounter.tsx | 18 ---- .../RSFormPage/EditorTermGraph/ViewHidden.tsx | 2 +- .../frontend/src/pages/RSFormPage/RSTabs.tsx | 7 +- .../src/pages/RSFormPage/RSTabsMenu.tsx | 24 ++--- rsconcept/frontend/src/utils/misc.ts | 9 +- 31 files changed, 487 insertions(+), 445 deletions(-) create mode 100644 rsconcept/frontend/src/components/Shared/SelectedCounter.tsx create mode 100644 rsconcept/frontend/src/dialogs/DlgCloneLibraryItem.tsx delete mode 100644 rsconcept/frontend/src/dialogs/DlgCloneRSForm.tsx delete mode 100644 rsconcept/frontend/src/pages/RSFormPage/EditorTermGraph/SelectedCounter.tsx diff --git a/rsconcept/frontend/src/components/Common/Dropdown.tsx b/rsconcept/frontend/src/components/Common/Dropdown.tsx index dd57ca5e..1ad70286 100644 --- a/rsconcept/frontend/src/components/Common/Dropdown.tsx +++ b/rsconcept/frontend/src/components/Common/Dropdown.tsx @@ -6,11 +6,11 @@ interface DropdownProps { function Dropdown({ children, dimensions = 'w-fit', stretchLeft }: DropdownProps) { return ( -
-
- {children} -
-
+
+
+ {children} +
+
); } diff --git a/rsconcept/frontend/src/components/Common/Modal.tsx b/rsconcept/frontend/src/components/Common/Modal.tsx index f144ec7c..0c0a4735 100644 --- a/rsconcept/frontend/src/components/Common/Modal.tsx +++ b/rsconcept/frontend/src/components/Common/Modal.tsx @@ -1,7 +1,9 @@ import { useRef } from 'react'; import useEscapeKey from '../../hooks/useEscapeKey'; +import { CrossIcon } from '../Icons'; import Button from './Button'; +import MiniButton from './MiniButton'; export interface ModalProps { title?: string @@ -35,16 +37,29 @@ function Modal({ if (onSubmit) onSubmit(); }; - return (<> + return ( + <>
- {title ?

{title}

: null} -
+
+
+ } + onClick={handleCancel} + /> +
+
+ + {title ?

{title}

: null} + +
{children}
-
+ +
{!readonly ?