From 1009a2ec984b4ee25222ccf2f4e47876a7b212c2 Mon Sep 17 00:00:00 2001
From: IRBorisov <8611739+IRBorisov@users.noreply.github.com>
Date: Sun, 17 Dec 2023 20:19:28 +0300
Subject: [PATCH] Refactor and simplify UI
---
rsconcept/frontend/README.md | 2 +-
rsconcept/frontend/src/App.tsx | 18 +--
.../src/components/Common/Dropdown.tsx | 2 +-
.../frontend/src/components/Common/Modal.tsx | 2 +-
.../src/components/Common/SubmitButton.tsx | 10 +-
.../src/components/DataTable/DataTable.tsx | 138 +++++-------------
.../src/components/DataTable/SortingIcon.tsx | 9 +-
.../src/components/DataTable/TableBody.tsx | 74 ++++++++++
.../src/components/DataTable/TableFooter.tsx | 24 +++
.../src/components/DataTable/TableHeader.tsx | 56 +++++++
rsconcept/frontend/src/components/Footer.tsx | 7 +-
.../src/components/Help/HelpLibrary.tsx | 9 +-
rsconcept/frontend/src/components/Icons.tsx | 122 ----------------
.../frontend/src/components/InfoError.tsx | 4 +-
.../src/components/Navigation/Navigation.tsx | 8 +-
.../src/components/Navigation/UserMenu.tsx | 6 +-
.../components/Shared/ConstituentaPicker.tsx | 27 ++--
.../DlgConstituentaTemplate/ArgumentsTab.tsx | 49 +++----
.../DlgEditReference/DlgEditReference.tsx | 32 ++--
.../DlgEditWordForms/DlgEditWordForms.tsx | 48 +++---
.../DlgEditWordForms/WordFormsTable.tsx | 51 +++----
rsconcept/frontend/src/models/rslangAPI.ts | 2 +-
.../frontend/src/pages/CreateRSFormPage.tsx | 2 +-
rsconcept/frontend/src/pages/HomePage.tsx | 6 +-
.../src/pages/LibraryPage/ItemIcons.tsx | 9 +-
.../src/pages/LibraryPage/SearchPanel.tsx | 4 +-
rsconcept/frontend/src/pages/LoginPage.tsx | 15 +-
.../src/pages/ManualsPage/ViewTopic.tsx | 2 +-
.../ConstituentaToolbar.tsx | 15 +-
.../EditorConstituenta/EditorConstituenta.tsx | 48 +++---
.../EditorConstituenta/FormConstituenta.tsx | 34 +++--
.../EditorRSExpression/EditorRSExpression.tsx | 20 +--
.../EditorRSExpression/StatusBar.tsx | 2 +-
.../RSFormPage/EditorRSForm/EditorRSForm.tsx | 31 ++--
.../RSFormPage/EditorRSForm/FormRSForm.tsx | 23 ++-
.../RSFormPage/EditorRSForm/RSFormStats.tsx | 2 +-
.../RSFormPage/EditorRSForm/RSFormToolbar.tsx | 15 +-
.../RSFormPage/EditorRSList/EditorRSList.tsx | 10 +-
.../RSFormPage/EditorRSList/RSListToolbar.tsx | 27 +---
.../pages/RSFormPage/EditorRSList/RSTable.tsx | 10 +-
.../EditorTermGraph/GraphSidebar.tsx | 3 +-
.../EditorTermGraph/GraphToolbar.tsx | 9 +-
.../frontend/src/pages/RSFormPage/RSTabs.tsx | 88 +++++------
.../src/pages/RSFormPage/RSTabsMenu.tsx | 5 +-
.../ViewConstituents/ConstituentsTable.tsx | 6 +-
.../ViewConstituents/ViewConstituents.tsx | 9 +-
rsconcept/frontend/src/pages/RegisterPage.tsx | 4 +-
.../pages/UserProfilePage/EditorPassword.tsx | 15 +-
.../pages/UserProfilePage/EditorProfile.tsx | 57 ++++----
.../src/pages/UserProfilePage/UserTabs.tsx | 20 +--
.../UserProfilePage/ViewSubscriptions.tsx | 11 +-
51 files changed, 554 insertions(+), 648 deletions(-)
create mode 100644 rsconcept/frontend/src/components/DataTable/TableBody.tsx
create mode 100644 rsconcept/frontend/src/components/DataTable/TableFooter.tsx
create mode 100644 rsconcept/frontend/src/components/DataTable/TableHeader.tsx
diff --git a/rsconcept/frontend/README.md b/rsconcept/frontend/README.md
index 8cbcd381..01cc86e4 100644
--- a/rsconcept/frontend/README.md
+++ b/rsconcept/frontend/README.md
@@ -9,7 +9,7 @@ Styling conventions
- layer: z-position
- outer layout: fixed bottom-1/2 left-0 -translate-x-1/2
- - rectangle: mt-3 w-full min-w-10 h-fit
+ - rectangle: mt-3 w-full min-w-10 h-fit flex-grow
- inner layout: px-3 py-2 flex flex-col gap-3 justify-start items-center
- overflow behavior: overflow-auto
- border: borer-2 outline-none shadow-md
diff --git a/rsconcept/frontend/src/App.tsx b/rsconcept/frontend/src/App.tsx
index 73feda82..00349130 100644
--- a/rsconcept/frontend/src/App.tsx
+++ b/rsconcept/frontend/src/App.tsx
@@ -1,4 +1,3 @@
-import clsx from 'clsx';
import { createBrowserRouter, Outlet, RouterProvider } from 'react-router-dom';
import ConceptToaster from './components/ConceptToaster';
@@ -19,14 +18,10 @@ import UserProfilePage from './pages/UserProfilePage';
import { globalIDs } from './utils/constants';
function Root() {
- const { noNavigation, noFooter, viewportHeight, mainHeight, showScroll } = useConceptTheme();
+ const { viewportHeight, mainHeight, showScroll } = useConceptTheme();
return (
-
+
- {(!noNavigation && !noFooter) ? : null}
+
);
diff --git a/rsconcept/frontend/src/components/Common/Dropdown.tsx b/rsconcept/frontend/src/components/Common/Dropdown.tsx
index 17119d1d..3d310976 100644
--- a/rsconcept/frontend/src/components/Common/Dropdown.tsx
+++ b/rsconcept/frontend/src/components/Common/Dropdown.tsx
@@ -18,7 +18,7 @@ function Dropdown({
layer='z-modal-tooltip'
position='mt-3'
className={clsx(
- 'flex flex-col items-stretch justify-start',
+ 'flex flex-col items-stretch',
'border rounded-md shadow-lg',
'text-sm',
'clr-input',
diff --git a/rsconcept/frontend/src/components/Common/Modal.tsx b/rsconcept/frontend/src/components/Common/Modal.tsx
index 5fa741b5..f9f0cf56 100644
--- a/rsconcept/frontend/src/components/Common/Modal.tsx
+++ b/rsconcept/frontend/src/components/Common/Modal.tsx
@@ -59,7 +59,7 @@ function Modal({
'clr-app'
)}
>
-
+
}
diff --git a/rsconcept/frontend/src/components/Common/SubmitButton.tsx b/rsconcept/frontend/src/components/Common/SubmitButton.tsx
index 217a8d6a..729e7e4e 100644
--- a/rsconcept/frontend/src/components/Common/SubmitButton.tsx
+++ b/rsconcept/frontend/src/components/Common/SubmitButton.tsx
@@ -1,7 +1,7 @@
import clsx from 'clsx';
interface SubmitButtonProps
-extends Omit, 'className' | 'children' | 'title'> {
+extends Omit, 'children' | 'title'> {
text?: string
tooltip?: string
loading?: boolean
@@ -10,21 +10,21 @@ extends Omit, 'className' | 'child
}
function SubmitButton({
- text = 'ОК', icon, disabled, tooltip, loading,
+ text = 'ОК', icon, disabled, tooltip, loading, className,
dimensions = 'w-fit h-fit', ...restProps
}: SubmitButtonProps) {
return (