From 24da53bf400346fb7865f9c34c8d4581711f12eb Mon Sep 17 00:00:00 2001 From: IRBorisov <8611739+IRBorisov@users.noreply.github.com> Date: Wed, 23 Aug 2023 01:36:17 +0300 Subject: [PATCH] Add frontend for CstRename function --- .../frontend/src/components/Common/Modal.tsx | 18 +++-- .../src/components/Common/TextInput.tsx | 4 +- .../frontend/src/context/RSFormContext.tsx | 42 +++++++---- .../src/pages/RSFormPage/DlgRenameCst.tsx | 72 +++++++++++-------- .../pages/RSFormPage/EditorConstituenta.tsx | 15 +++- .../frontend/src/pages/RSFormPage/RSTabs.tsx | 26 ++++++- rsconcept/frontend/src/utils/backendAPI.ts | 10 ++- 7 files changed, 133 insertions(+), 54 deletions(-) diff --git a/rsconcept/frontend/src/components/Common/Modal.tsx b/rsconcept/frontend/src/components/Common/Modal.tsx index 404c0429..55a60ed5 100644 --- a/rsconcept/frontend/src/components/Common/Modal.tsx +++ b/rsconcept/frontend/src/components/Common/Modal.tsx @@ -6,6 +6,7 @@ import Button from './Button'; interface ModalProps { title?: string submitText?: string + submitInvalidTooltip?: string readonly?: boolean canSubmit?: boolean hideWindow: () => void @@ -14,7 +15,13 @@ interface ModalProps { children: React.ReactNode } -function Modal({ title, hideWindow, onSubmit, readonly, onCancel, canSubmit, children, submitText = 'Продолжить' }: ModalProps) { +function Modal({ + title, hideWindow, onSubmit, + readonly, onCancel, canSubmit, + submitInvalidTooltip, + children, + submitText = 'Продолжить' +}: ModalProps) { const ref = useRef(null); useEscapeKey(hideWindow); @@ -30,19 +37,20 @@ function Modal({ title, hideWindow, onSubmit, readonly, onCancel, canSubmit, chi return ( <> -
-
+
{ title &&

{title}

} -
+
{children}
- {!readonly &&