From 0fe2360886e06e910ef3d56e9eb29e511ae42c5e Mon Sep 17 00:00:00 2001 From: IRBorisov <8611739+IRBorisov@users.noreply.github.com> Date: Tue, 8 Aug 2023 23:04:21 +0300 Subject: [PATCH] UI improvements --- .../frontend/src/components/Common/Modal.tsx | 22 ++++++++++-------- .../src/components/Common/SubmitButton.tsx | 2 +- .../src/components/Common/TextArea.tsx | 2 +- .../src/components/Common/TextInput.tsx | 2 +- .../src/components/Navigation/UserTools.tsx | 4 +++- .../frontend/src/context/RSFormContext.tsx | 2 +- rsconcept/frontend/src/index.css | 8 +++++-- rsconcept/frontend/src/pages/HomePage.tsx | 14 +++++++---- .../src/pages/RSFormPage/DlgShowAST.tsx | 10 ++------ .../pages/RSFormPage/EditorConstituenta.tsx | 4 ++-- .../pages/RSFormPage/EditorRSExpression.tsx | 23 ++++++++++--------- .../RSFormPage/elements/MatchModePicker.tsx | 2 +- .../pages/RSFormPage/elements/StatusBar.tsx | 4 ++-- rsconcept/frontend/vite.config.ts | 6 ++++- 14 files changed, 59 insertions(+), 46 deletions(-) diff --git a/rsconcept/frontend/src/components/Common/Modal.tsx b/rsconcept/frontend/src/components/Common/Modal.tsx index 975dafea..404c0429 100644 --- a/rsconcept/frontend/src/components/Common/Modal.tsx +++ b/rsconcept/frontend/src/components/Common/Modal.tsx @@ -6,14 +6,15 @@ import Button from './Button'; interface ModalProps { title?: string submitText?: string + readonly?: boolean canSubmit?: boolean hideWindow: () => void - onSubmit: () => void + onSubmit?: () => void onCancel?: () => void children: React.ReactNode } -function Modal({ title, hideWindow, onSubmit, onCancel, canSubmit, children, submitText = 'Продолжить' }: ModalProps) { +function Modal({ title, hideWindow, onSubmit, readonly, onCancel, canSubmit, children, submitText = 'Продолжить' }: ModalProps) { const ref = useRef(null); useEscapeKey(hideWindow); @@ -24,29 +25,32 @@ function Modal({ title, hideWindow, onSubmit, onCancel, canSubmit, children, sub const handleSubmit = () => { hideWindow(); - onSubmit(); + if (onSubmit) onSubmit(); }; return ( <>
-
+
{ title &&

{title}

} -
+
{children}
-
-