From 40cb8b4ce873c81e79f062700450b4593d11c7c7 Mon Sep 17 00:00:00 2001 From: IRBorisov <8611739+IRBorisov@users.noreply.github.com> Date: Thu, 28 Dec 2023 14:04:44 +0300 Subject: [PATCH] Refactoring: apply prettier on save --- .vscode/settings.json | 260 ++++---- rsconcept/frontend/.prettierrc.json | 13 + rsconcept/frontend/src/App.tsx | 82 ++- rsconcept/frontend/src/GlobalProviders.tsx | 10 +- .../frontend/src/components/Common/Button.tsx | 73 +-- .../src/components/Common/Checkbox.tsx | 72 ++- .../src/components/Common/ConceptLoader.tsx | 20 +- .../src/components/Common/ConceptSearch.tsx | 40 +- .../src/components/Common/ConceptTab.tsx | 43 +- .../src/components/Common/ConceptTooltip.tsx | 51 +- .../src/components/Common/Divider.tsx | 20 +- .../src/components/Common/Dropdown.tsx | 65 +- .../src/components/Common/DropdownButton.tsx | 65 +- .../components/Common/DropdownCheckbox.tsx | 41 +- .../src/components/Common/EmbedYoutube.tsx | 50 +- .../src/components/Common/FileInput.tsx | 56 +- .../src/components/Common/FlexColumn.tsx | 23 +- .../src/components/Common/GraphUI.tsx | 8 +- .../frontend/src/components/Common/Label.tsx | 20 +- .../src/components/Common/LabeledValue.tsx | 29 +- .../src/components/Common/MiniButton.tsx | 55 +- .../frontend/src/components/Common/Modal.tsx | 145 +++-- .../src/components/Common/Overlay.tsx | 40 +- .../src/components/Common/PDFViewer.tsx | 71 --- .../src/components/Common/PageControls.tsx | 44 -- .../src/components/Common/PrettyJSON.tsx | 9 +- .../src/components/Common/SelectMulti.tsx | 110 ++-- .../src/components/Common/SelectSingle.tsx | 101 ++-- .../src/components/Common/SelectorButton.tsx | 59 +- .../src/components/Common/SubmitButton.tsx | 52 +- .../src/components/Common/SwitchButton.tsx | 63 +- .../src/components/Common/TextArea.tsx | 62 +- .../src/components/Common/TextInput.tsx | 66 ++- .../src/components/Common/TextURL.tsx | 35 +- .../src/components/Common/Tristate.tsx | 80 ++- .../src/components/ConceptToaster.tsx | 10 +- .../src/components/DataTable/DataTable.tsx | 158 ++--- .../components/DataTable/DefaultNoData.tsx | 7 +- .../components/DataTable/PaginationTools.tsx | 153 ++--- .../src/components/DataTable/SelectAll.tsx | 24 +- .../src/components/DataTable/SelectRow.tsx | 12 +- .../src/components/DataTable/SortingIcon.tsx | 22 +- .../src/components/DataTable/TableBody.tsx | 98 +-- .../src/components/DataTable/TableFooter.tsx | 29 +- .../src/components/DataTable/TableHeader.tsx | 87 ++- .../src/components/DataTable/index.tsx | 10 +- .../frontend/src/components/ErrorFallback.tsx | 16 +- .../src/components/ExpectedAnonymous.tsx | 32 +- rsconcept/frontend/src/components/Footer.tsx | 38 +- .../components/Help/ConstituentaTooltip.tsx | 16 +- .../src/components/Help/HelpButton.tsx | 39 +- .../src/components/Help/HelpConstituenta.tsx | 3 +- .../src/components/Help/HelpExteor.tsx | 3 +- .../src/components/Help/HelpLibrary.tsx | 3 +- .../frontend/src/components/Help/HelpMain.tsx | 3 +- .../src/components/Help/HelpPrivacy.tsx | 9 +- .../src/components/Help/HelpRSFormItems.tsx | 3 +- .../src/components/Help/HelpRSFormMeta.tsx | 3 +- .../src/components/Help/HelpRSLang.tsx | 8 +- .../src/components/Help/HelpRSTemplates.tsx | 3 +- .../src/components/Help/HelpTermGraph.tsx | 3 +- .../Help/HelpTerminologyControl.tsx | 4 +- .../src/components/Help/InfoTopic.tsx | 4 +- rsconcept/frontend/src/components/Icons.tsx | 49 +- .../frontend/src/components/InfoError.tsx | 34 +- .../src/components/Navigation/Logo.tsx | 12 +- .../src/components/Navigation/Navigation.tsx | 85 ++- .../Navigation/NavigationButton.tsx | 49 +- .../Navigation/ToggleNavigationButton.tsx | 35 +- .../components/Navigation/UserDropdown.tsx | 36 +- .../src/components/Navigation/UserMenu.tsx | 31 +- .../src/components/Navigation/index.tsx | 2 +- .../src/components/PDFViewer/PDFViewer.tsx | 60 ++ .../src/components/PDFViewer/PageControls.tsx | 51 ++ .../src/components/PDFViewer/index.tsx | 1 + .../src/components/RSInput/RSInput.tsx | 192 +++--- .../src/components/RSInput/bracketMatching.ts | 10 +- .../frontend/src/components/RSInput/index.tsx | 2 +- .../components/RSInput/rslang/highlight.ts | 40 +- .../src/components/RSInput/rslang/index.ts | 8 +- .../src/components/RSInput/textEditing.ts | 318 ++++++---- .../src/components/RSInput/tooltip.ts | 13 +- .../src/components/RefsInput/RefsInput.tsx | 275 ++++----- .../src/components/RefsInput/index.tsx | 2 +- .../components/RefsInput/parse/highlight.ts | 4 +- .../src/components/RefsInput/parse/index.ts | 8 +- .../components/RefsInput/parse/parser.test.ts | 5 +- .../src/components/RefsInput/tooltip.ts | 20 +- .../frontend/src/components/RequireAuth.tsx | 17 +- .../components/Shared/ConstituentaBadge.tsx | 63 +- .../components/Shared/ConstituentaPicker.tsx | 117 ++-- .../src/components/Shared/GrammemeBadge.tsx | 39 +- .../components/Shared/InfoConstituenta.tsx | 63 +- .../src/components/Shared/InfoCstClass.tsx | 53 +- .../src/components/Shared/InfoCstStatus.tsx | 54 +- .../src/components/Shared/InfoLibraryItem.tsx | 45 +- .../src/components/Shared/SelectGrammeme.tsx | 42 +- .../src/components/Shared/SelectedCounter.tsx | 25 +- .../src/components/Shared/WordFormBadge.tsx | 21 +- rsconcept/frontend/src/components/props.d.ts | 69 +-- .../src/context/AccessModeContext.tsx | 21 +- .../frontend/src/context/AuthContext.tsx | 115 ++-- .../frontend/src/context/LibraryContext.tsx | 292 +++++---- .../src/context/NavigationContext.tsx | 104 ++-- .../frontend/src/context/RSFormContext.tsx | 520 ++++++++-------- .../frontend/src/context/ThemeContext.tsx | 102 ++-- .../src/context/UserProfileContext.tsx | 67 +-- .../frontend/src/context/UsersContext.tsx | 59 +- .../src/dialogs/DlgCloneLibraryItem.tsx | 58 +- .../DlgConstituentaTemplate/ArgumentsTab.tsx | 315 +++++----- .../ConstituentaTab.tsx | 100 ++-- .../DlgConstituentaTemplate.tsx | 139 ++--- .../DlgConstituentaTemplate/TemplateTab.tsx | 148 ++--- .../dialogs/DlgConstituentaTemplate/index.tsx | 2 +- .../frontend/src/dialogs/DlgCreateCst.tsx | 128 ++-- .../dialogs/DlgDeleteCst/ConstituentsList.tsx | 44 +- .../src/dialogs/DlgDeleteCst/DlgDeleteCst.tsx | 63 +- .../src/dialogs/DlgDeleteCst/index.tsx | 2 +- .../DlgEditReference/DlgEditReference.tsx | 120 ++-- .../dialogs/DlgEditReference/EntityTab.tsx | 103 ++-- .../DlgEditReference/SelectWordForm.tsx | 39 +- .../dialogs/DlgEditReference/SyntacticTab.tsx | 56 +- .../DlgEditReference/WordformButton.tsx | 45 +- .../src/dialogs/DlgEditReference/index.tsx | 2 +- .../DlgEditWordForms/DlgEditWordForms.tsx | 227 ++++--- .../DlgEditWordForms/WordFormsTable.tsx | 136 +++-- .../src/dialogs/DlgEditWordForms/index.tsx | 2 +- .../frontend/src/dialogs/DlgGraphParams.tsx | 169 +++--- .../frontend/src/dialogs/DlgRenameCst.tsx | 80 ++- rsconcept/frontend/src/dialogs/DlgShowAST.tsx | 98 ++- .../frontend/src/dialogs/DlgUploadRSForm.tsx | 45 +- .../frontend/src/hooks/useCheckExpression.ts | 34 +- .../frontend/src/hooks/useClickedOutside.ts | 4 +- .../frontend/src/hooks/useConceptText.ts | 11 +- rsconcept/frontend/src/hooks/useDropdown.ts | 2 +- rsconcept/frontend/src/hooks/useEscapeKey.ts | 15 +- .../frontend/src/hooks/useLocalStorage.ts | 12 +- .../frontend/src/hooks/usePartialUpdate.tsx | 4 +- .../frontend/src/hooks/useQueryStrings.ts | 2 +- .../frontend/src/hooks/useRSFormDetails.ts | 40 +- .../frontend/src/hooks/useResolveText.ts | 2 +- rsconcept/frontend/src/hooks/useWindowSize.ts | 5 +- rsconcept/frontend/src/index.css | 104 ++-- rsconcept/frontend/src/main.tsx | 4 +- rsconcept/frontend/src/models/language.ts | 197 +++--- .../frontend/src/models/languageAPI.test.ts | 117 ++-- rsconcept/frontend/src/models/languageAPI.ts | 46 +- rsconcept/frontend/src/models/library.ts | 83 ++- .../frontend/src/models/libraryAPI.test.ts | 9 +- rsconcept/frontend/src/models/libraryAPI.ts | 4 +- .../frontend/src/models/miscellaneous.ts | 56 +- .../frontend/src/models/miscellaneousAPI.ts | 31 +- rsconcept/frontend/src/models/rsform.ts | 178 +++--- rsconcept/frontend/src/models/rsformAPI.ts | 124 ++-- rsconcept/frontend/src/models/rslang.ts | 79 ++- .../frontend/src/models/rslangAPI.test.ts | 17 +- rsconcept/frontend/src/models/rslangAPI.ts | 24 +- .../frontend/src/pages/CreateRSFormPage.tsx | 119 ++-- rsconcept/frontend/src/pages/HomePage.tsx | 18 +- .../src/pages/LibraryPage/ItemIcons.tsx | 44 +- .../src/pages/LibraryPage/LibraryPage.tsx | 75 +-- .../src/pages/LibraryPage/PickerStrategy.tsx | 66 ++- .../src/pages/LibraryPage/SearchPanel.tsx | 70 +-- .../src/pages/LibraryPage/ViewLibrary.tsx | 190 +++--- .../frontend/src/pages/LibraryPage/index.tsx | 2 +- rsconcept/frontend/src/pages/LoginPage.tsx | 88 ++- .../src/pages/ManualsPage/ManualsPage.tsx | 17 +- .../src/pages/ManualsPage/TopicsList.tsx | 37 +- .../src/pages/ManualsPage/ViewTopic.tsx | 11 +- .../frontend/src/pages/ManualsPage/index.tsx | 2 +- rsconcept/frontend/src/pages/NotFoundPage.tsx | 13 +- .../ConstituentaToolbar.tsx | 93 +-- .../EditorConstituenta/EditorConstituenta.tsx | 111 ++-- .../EditorConstituenta/FormConstituenta.tsx | 248 ++++---- .../RSFormPage/EditorConstituenta/index.tsx | 2 +- .../EditorRSExpression/EditorRSExpression.tsx | 202 ++++--- .../EditorRSExpression/ParsingResult.tsx | 61 +- .../EditorRSExpression/RSEditControls.tsx | 125 ++-- .../EditorRSExpression/RSLocalButton.tsx | 41 +- .../EditorRSExpression/RSTokenButton.tsx | 49 +- .../EditorRSExpression/StatusBar.tsx | 60 +- .../EditorRSExpression/StatusIcon.tsx | 6 +- .../RSFormPage/EditorRSExpression/index.tsx | 2 +- .../RSFormPage/EditorRSList/EditorRSList.tsx | 83 ++- .../RSFormPage/EditorRSList/RSListToolbar.tsx | 129 ++-- .../pages/RSFormPage/EditorRSList/RSTable.tsx | 234 ++++---- .../pages/RSFormPage/EditorRSList/index.tsx | 2 +- .../EditorTermGraph/EditorTermGraph.tsx | 198 +++---- .../EditorTermGraph/GraphSidebar.tsx | 48 +- .../EditorTermGraph/GraphToolbar.tsx | 125 ++-- .../RSFormPage/EditorTermGraph/TermGraph.tsx | 198 ++++--- .../RSFormPage/EditorTermGraph/ViewHidden.tsx | 93 ++- .../RSFormPage/EditorTermGraph/index.tsx | 2 +- .../EditorTermGraph/useGraphFilter.ts | 12 +- .../src/pages/RSFormPage/RSFormPage.tsx | 13 +- .../frontend/src/pages/RSFormPage/RSTabs.tsx | 560 +++++++++--------- .../src/pages/RSFormPage/RSTabsMenu.tsx | 274 +++++---- .../ViewConstituents/ConstituentsSearch.tsx | 153 ++--- .../ViewConstituents/ConstituentsTable.tsx | 191 +++--- .../ViewConstituents/ViewConstituents.tsx | 65 +- .../RSFormPage/ViewConstituents/index.tsx | 2 +- .../frontend/src/pages/RSFormPage/index.tsx | 2 +- rsconcept/frontend/src/pages/RegisterPage.tsx | 172 +++--- .../src/pages/RestorePasswordPage.tsx | 13 +- .../pages/UserProfilePage/EditorPassword.tsx | 112 ++-- .../pages/UserProfilePage/EditorProfile.tsx | 78 +-- .../pages/UserProfilePage/UserProfilePage.tsx | 13 +- .../src/pages/UserProfilePage/UserTabs.tsx | 67 +-- .../UserProfilePage/ViewSubscriptions.tsx | 118 ++-- .../src/pages/UserProfilePage/index.tsx | 2 +- rsconcept/frontend/src/utils/Graph.test.ts | 53 +- rsconcept/frontend/src/utils/Graph.ts | 28 +- rsconcept/frontend/src/utils/animations.ts | 4 +- rsconcept/frontend/src/utils/backendAPI.ts | 121 ++-- rsconcept/frontend/src/utils/codemirror.ts | 148 +++-- rsconcept/frontend/src/utils/color.ts | 218 +++---- rsconcept/frontend/src/utils/constants.ts | 8 +- rsconcept/frontend/src/utils/labels.ts | 507 ++++++++-------- rsconcept/frontend/src/utils/misc.ts | 55 +- rsconcept/frontend/src/utils/selectors.ts | 59 +- rsconcept/frontend/src/utils/utils.tsx | 16 +- rsconcept/frontend/src/vite-env.d.ts | 2 +- 222 files changed, 7652 insertions(+), 7666 deletions(-) create mode 100644 rsconcept/frontend/.prettierrc.json delete mode 100644 rsconcept/frontend/src/components/Common/PDFViewer.tsx delete mode 100644 rsconcept/frontend/src/components/Common/PageControls.tsx create mode 100644 rsconcept/frontend/src/components/PDFViewer/PDFViewer.tsx create mode 100644 rsconcept/frontend/src/components/PDFViewer/PageControls.tsx create mode 100644 rsconcept/frontend/src/components/PDFViewer/index.tsx diff --git a/.vscode/settings.json b/.vscode/settings.json index cdda5ed1..37daf584 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,137 +1,133 @@ { - "search.exclude": { + "search.exclude": { ".mypy_cache/": true, ".pytest_cache/": true - }, - "python.testing.unittestArgs": [ - "-v", - "-s", - "./tests", - "-p", - "test*.py" - ], - "python.testing.pytestEnabled": false, - "python.testing.unittestEnabled": true, - "eslint.workingDirectories": [ - { - "mode": "auto" - } - ], - "python.analysis.typeCheckingMode": "off", - "python.analysis.diagnosticSeverityOverrides": { - // "reportOptionalMemberAccess": "none" - }, - "python.analysis.ignore": ["**/tests/**", "**/node_modules/**", "**/venv/**"], - "python.analysis.packageIndexDepths": [ + }, + "python.testing.unittestArgs": ["-v", "-s", "./tests", "-p", "test*.py"], + "python.testing.pytestEnabled": false, + "python.testing.unittestEnabled": true, + "eslint.workingDirectories": [ { - "name": "django", - "depth": 5 + "mode": "auto" } - ], - "colorize.include": [".tsx", ".jsx", ".ts", ".js"], - "colorize.languages": [ - "typescript", - "javascript", - "css", - "typescriptreact", - "javascriptreact" - ], - "cSpell.words": [ - "ablt", - "accs", - "actv", - "ADJF", - "ADJS", - "ADVB", - "Analyse", - "Backquote", - "BIGPR", - "cctext", - "CIHT", - "clsx", - "codemirror", - "Constituenta", - "csrftoken", - "cstlist", - "csttype", - "datv", - "Debool", - "Decart", - "EMPTYSET", - "exteor", - "femn", - "filterset", - "forceatlas", - "futr", - "Grammeme", - "Grammemes", - "GRND", - "impr", - "inan", - "indc", - "INFN", - "Infr", - "INTJ", - "Keymap", - "lezer", - "Litr", - "loct", - "moprho", - "nomn", - "nooverlap", - "NPRO", - "NUMR", - "perfectivity", - "ponomarev", - "PRCL", - "PRTF", - "PRTS", - "pssv", - "pyconcept", - "pymorphy", - "Quantor", - "razdel", - "reagraph", - "Reindex", - "rsedit", - "rseditor", - "rsform", - "rsforms", - "rslang", - "rstemplates", - "SIDELIST", - "signup", - "Slng", - "SMALLPR", - "tanstack", - "toastify", - "tooltipic", - "Viewset", - "viewsets", - "wordform", - "Wordforms", - "Булеан", - "Бурбаки", - "Десинглетон", - "компаратив", - "конституент", - "Конституента", - "конституенту", - "конституенты", - "неинтерпретируемый", - "неитерируемого", - "пересинтез", - "Родоструктурная", - "Родоструктурное", - "Синглетон", - "твор", - "Терминологизация", - "Цермелло", - "ЦИВТ", - "Экстеор", - "Экстеора", - "Экстеоре" - ], - "cSpell.language": "en,ru", - "cSpell.ignorePaths": ["node_modules/**", "*.json"] -} \ No newline at end of file + ], + "python.analysis.typeCheckingMode": "off", + "python.analysis.diagnosticSeverityOverrides": { + // "reportOptionalMemberAccess": "none" + }, + "python.analysis.ignore": ["**/tests/**", "**/node_modules/**", "**/venv/**"], + "python.analysis.packageIndexDepths": [ + { + "name": "django", + "depth": 5 + } + ], + "colorize.include": [".tsx", ".jsx", ".ts", ".js"], + "colorize.languages": [ + "typescript", + "javascript", + "css", + "typescriptreact", + "javascriptreact" + ], + "cSpell.words": [ + "ablt", + "accs", + "actv", + "ADJF", + "ADJS", + "ADVB", + "Analyse", + "Backquote", + "BIGPR", + "cctext", + "CIHT", + "clsx", + "codemirror", + "Constituenta", + "csrftoken", + "cstlist", + "csttype", + "datv", + "Debool", + "Decart", + "Downvote", + "EMPTYSET", + "exteor", + "femn", + "filterset", + "forceatlas", + "futr", + "Grammeme", + "Grammemes", + "GRND", + "impr", + "inan", + "indc", + "INFN", + "Infr", + "INTJ", + "Keymap", + "lezer", + "Litr", + "loct", + "moprho", + "nomn", + "nooverlap", + "NPRO", + "NUMR", + "perfectivity", + "ponomarev", + "PRCL", + "PRTF", + "PRTS", + "pssv", + "pyconcept", + "pymorphy", + "Quantor", + "razdel", + "reagraph", + "Reindex", + "rsedit", + "rseditor", + "rsform", + "rsforms", + "rslang", + "rstemplates", + "SIDELIST", + "signup", + "Slng", + "SMALLPR", + "tanstack", + "toastify", + "tooltipic", + "Upvote", + "Viewset", + "viewsets", + "wordform", + "Wordforms", + "Булеан", + "Бурбаки", + "Десинглетон", + "компаратив", + "конституент", + "Конституента", + "конституенту", + "конституенты", + "неинтерпретируемый", + "неитерируемого", + "пересинтез", + "Родоструктурная", + "Родоструктурное", + "Синглетон", + "твор", + "Терминологизация", + "Цермелло", + "ЦИВТ", + "Экстеор", + "Экстеора", + "Экстеоре" + ], + "cSpell.language": "en,ru", + "cSpell.ignorePaths": ["node_modules/**", "*.json"] +} diff --git a/rsconcept/frontend/.prettierrc.json b/rsconcept/frontend/.prettierrc.json new file mode 100644 index 00000000..d4dd284f --- /dev/null +++ b/rsconcept/frontend/.prettierrc.json @@ -0,0 +1,13 @@ +{ + "semi": true, + "useTabs": false, + "printWidth": 120, + "tabWidth": 2, + "trailingComma": "none", + "arrowParens": "avoid", + "singleQuote": true, + "jsxSingleQuote": true, + "quoteProps": "consistent", + "bracketSameLine": false, + "bracketSpacing": true +} \ No newline at end of file diff --git a/rsconcept/frontend/src/App.tsx b/rsconcept/frontend/src/App.tsx index 4da3370a..67888739 100644 --- a/rsconcept/frontend/src/App.tsx +++ b/rsconcept/frontend/src/App.tsx @@ -20,35 +20,33 @@ import { globalIDs } from './utils/constants'; function Root() { const { viewportHeight, mainHeight, showScroll } = useConceptTheme(); return ( - -
+ +
+ - - - + -
-
- -
-
-
-
-
); +
+
+ +
+
+
+
+ ); } const router = createBrowserRouter([ @@ -59,48 +57,46 @@ const router = createBrowserRouter([ children: [ { path: '', - element: , + element: }, { path: 'login', - element: , + element: }, { path: 'signup', - element: , + element: }, { path: 'restore-password', - element: , + element: }, { path: 'profile', - element: , + element: }, { path: 'manuals', - element: , + element: }, { path: 'library', - element: , + element: }, { path: 'library/create', - element: , + element: }, { path: 'rsforms/:id', - element: , - }, + element: + } ] - }, + } ]); -function App () { - return ( - - ); +function App() { + return ; } -export default App; \ No newline at end of file +export default App; diff --git a/rsconcept/frontend/src/GlobalProviders.tsx b/rsconcept/frontend/src/GlobalProviders.tsx index 05f1fd8f..60802d95 100644 --- a/rsconcept/frontend/src/GlobalProviders.tsx +++ b/rsconcept/frontend/src/GlobalProviders.tsx @@ -11,13 +11,10 @@ import { UsersState } from '@/context/UsersContext'; import ErrorFallback from './components/ErrorFallback'; -pdfjs.GlobalWorkerOptions.workerSrc = new URL( - 'pdfjs-dist/build/pdf.worker.min.js', - import.meta.url, -).toString(); +pdfjs.GlobalWorkerOptions.workerSrc = new URL('pdfjs-dist/build/pdf.worker.min.js', import.meta.url).toString(); const resetState = () => { - console.log('Resetting state after error fallback') + console.log('Resetting state after error fallback'); }; const logError = (error: Error, info: { componentStack?: string | null | undefined }) => { @@ -27,6 +24,7 @@ const logError = (error: Error, info: { componentStack?: string | null | undefin } }; +// prettier-ignore function GlobalProviders({ children }: { children: React.ReactNode }) { return ( ); } -export default GlobalProviders; \ No newline at end of file +export default GlobalProviders; diff --git a/rsconcept/frontend/src/components/Common/Button.tsx b/rsconcept/frontend/src/components/Common/Button.tsx index 4233a3c2..f58c0961 100644 --- a/rsconcept/frontend/src/components/Common/Button.tsx +++ b/rsconcept/frontend/src/components/Common/Button.tsx @@ -4,47 +4,54 @@ import { globalIDs } from '@/utils/constants'; import { CProps } from '../props'; -interface ButtonProps -extends CProps.Control, CProps.Colors, CProps.Button { - text?: string - icon?: React.ReactNode +interface ButtonProps extends CProps.Control, CProps.Colors, CProps.Button { + text?: string; + icon?: React.ReactNode; - dense?: boolean - loading?: boolean + dense?: boolean; + loading?: boolean; } function Button({ - text, icon, title, - loading, dense, disabled, noBorder, noOutline, + text, + icon, + title, + loading, + dense, + disabled, + noBorder, + noOutline, colors = 'clr-btn-default', className, ...restProps }: ButtonProps) { return ( - ); + + ); } -export default Button; \ No newline at end of file +export default Button; diff --git a/rsconcept/frontend/src/components/Common/Checkbox.tsx b/rsconcept/frontend/src/components/Common/Checkbox.tsx index 4afae034..b79b8273 100644 --- a/rsconcept/frontend/src/components/Common/Checkbox.tsx +++ b/rsconcept/frontend/src/components/Common/Checkbox.tsx @@ -7,21 +7,16 @@ import { CheckboxCheckedIcon } from '../Icons'; import { CProps } from '../props'; import Label from './Label'; -export interface CheckboxProps -extends Omit { - label?: string - disabled?: boolean +export interface CheckboxProps extends Omit { + label?: string; + disabled?: boolean; - value: boolean - setValue?: (newValue: boolean) => void + value: boolean; + setValue?: (newValue: boolean) => void; } -function Checkbox({ - id, disabled, label, title, - className, value, setValue, ...restProps -}: CheckboxProps) { - const cursor = useMemo( - () => { +function Checkbox({ id, disabled, label, title, className, value, setValue, ...restProps }: CheckboxProps) { + const cursor = useMemo(() => { if (disabled) { return 'cursor-not-allowed'; } else if (setValue) { @@ -40,32 +35,31 @@ function Checkbox({ } return ( - ); + + ); } -export default Checkbox; \ No newline at end of file +export default Checkbox; diff --git a/rsconcept/frontend/src/components/Common/ConceptLoader.tsx b/rsconcept/frontend/src/components/Common/ConceptLoader.tsx index 20c0337d..829790c8 100644 --- a/rsconcept/frontend/src/components/Common/ConceptLoader.tsx +++ b/rsconcept/frontend/src/components/Common/ConceptLoader.tsx @@ -5,18 +5,14 @@ import { ThreeDots } from 'react-loader-spinner'; import { useConceptTheme } from '@/context/ThemeContext'; interface ConceptLoaderProps { - size?: number + size?: number; } -export function ConceptLoader({size=10}: ConceptLoaderProps) { - const {colors} = useConceptTheme(); +export function ConceptLoader({ size = 10 }: ConceptLoaderProps) { + const { colors } = useConceptTheme(); return ( -
- -
); -} \ No newline at end of file +
+ +
+ ); +} diff --git a/rsconcept/frontend/src/components/Common/ConceptSearch.tsx b/rsconcept/frontend/src/components/Common/ConceptSearch.tsx index 640ec6f4..06efbfae 100644 --- a/rsconcept/frontend/src/components/Common/ConceptSearch.tsx +++ b/rsconcept/frontend/src/components/Common/ConceptSearch.tsx @@ -4,30 +4,28 @@ import { CProps } from '../props'; import Overlay from './Overlay'; import TextInput from './TextInput'; -interface ConceptSearchProps -extends CProps.Styling { - value: string - onChange?: (newValue: string) => void - noBorder?: boolean +interface ConceptSearchProps extends CProps.Styling { + value: string; + onChange?: (newValue: string) => void; + noBorder?: boolean; } function ConceptSearch({ value, onChange, noBorder, ...restProps }: ConceptSearchProps) { return ( -
- - - - (onChange ? onChange(event.target.value) : undefined)} - /> -
); +
+ + + + (onChange ? onChange(event.target.value) : undefined)} + /> +
+ ); } -export default ConceptSearch; \ No newline at end of file +export default ConceptSearch; diff --git a/rsconcept/frontend/src/components/Common/ConceptTab.tsx b/rsconcept/frontend/src/components/Common/ConceptTab.tsx index 383b01d9..c975e841 100644 --- a/rsconcept/frontend/src/components/Common/ConceptTab.tsx +++ b/rsconcept/frontend/src/components/Common/ConceptTab.tsx @@ -4,33 +4,30 @@ import { Tab } from 'react-tabs'; import { globalIDs } from '@/utils/constants'; -interface ConceptTabProps -extends Omit { - label?: string +interface ConceptTabProps extends Omit { + label?: string; } -function ConceptTab({ - label, title, className, - ...otherProps -}: ConceptTabProps) { +function ConceptTab({ label, title, className, ...otherProps }: ConceptTabProps) { return ( - - {label} - ); + + {label} + + ); } ConceptTab.tabsRole = 'Tab'; -export default ConceptTab; \ No newline at end of file +export default ConceptTab; diff --git a/rsconcept/frontend/src/components/Common/ConceptTooltip.tsx b/rsconcept/frontend/src/components/Common/ConceptTooltip.tsx index 8d44e18e..a07ab623 100644 --- a/rsconcept/frontend/src/components/Common/ConceptTooltip.tsx +++ b/rsconcept/frontend/src/components/Common/ConceptTooltip.tsx @@ -7,16 +7,16 @@ import { ITooltip, Tooltip } from 'react-tooltip'; import { useConceptTheme } from '@/context/ThemeContext'; -interface ConceptTooltipProps -extends Omit { - layer?: string - text?: string +interface ConceptTooltipProps extends Omit { + layer?: string; + text?: string; } function ConceptTooltip({ - text, children, - layer='z-tooltip', - place='bottom', + text, + children, + layer = 'z-tooltip', + place = 'bottom', className, style, ...restProps @@ -26,25 +26,22 @@ function ConceptTooltip({ return null; } return createPortal( - ( - {text ? text : null} - {children as ReactNode} - ), document.body); + + {text ? text : null} + {children as ReactNode} + , + document.body + ); } -export default ConceptTooltip; \ No newline at end of file +export default ConceptTooltip; diff --git a/rsconcept/frontend/src/components/Common/Divider.tsx b/rsconcept/frontend/src/components/Common/Divider.tsx index 5dc05648..f6f786e2 100644 --- a/rsconcept/frontend/src/components/Common/Divider.tsx +++ b/rsconcept/frontend/src/components/Common/Divider.tsx @@ -1,19 +1,19 @@ import clsx from 'clsx'; interface DividerProps { - vertical?: boolean - margins?: string + vertical?: boolean; + margins?: string; } function Divider({ vertical, margins = 'mx-2' }: DividerProps) { return ( -
); +
+ ); } -export default Divider; \ No newline at end of file +export default Divider; diff --git a/rsconcept/frontend/src/components/Common/Dropdown.tsx b/rsconcept/frontend/src/components/Common/Dropdown.tsx index 8e4ebf9c..258c3488 100644 --- a/rsconcept/frontend/src/components/Common/Dropdown.tsx +++ b/rsconcept/frontend/src/components/Common/Dropdown.tsx @@ -5,43 +5,38 @@ import { animateDropdown } from '@/utils/animations'; import { CProps } from '../props'; -interface DropdownProps -extends CProps.Styling { - stretchLeft?: boolean - isOpen: boolean - children: React.ReactNode +interface DropdownProps extends CProps.Styling { + stretchLeft?: boolean; + isOpen: boolean; + children: React.ReactNode; } -function Dropdown({ - isOpen, stretchLeft, - className, - children, - ...restProps -}: DropdownProps) { +function Dropdown({ isOpen, stretchLeft, className, children, ...restProps }: DropdownProps) { return ( -
- - {children} - -
); +
+ + {children} + +
+ ); } -export default Dropdown; \ No newline at end of file +export default Dropdown; diff --git a/rsconcept/frontend/src/components/Common/DropdownButton.tsx b/rsconcept/frontend/src/components/Common/DropdownButton.tsx index 0adeb5c2..fa5dc6dd 100644 --- a/rsconcept/frontend/src/components/Common/DropdownButton.tsx +++ b/rsconcept/frontend/src/components/Common/DropdownButton.tsx @@ -6,44 +6,39 @@ import { globalIDs } from '@/utils/constants'; import { CProps } from '../props'; -interface DropdownButtonProps -extends CProps.AnimatedButton { - text?: string - icon?: React.ReactNode +interface DropdownButtonProps extends CProps.AnimatedButton { + text?: string; + icon?: React.ReactNode; - children?: React.ReactNode + children?: React.ReactNode; } -function DropdownButton({ - text, icon, - className, title, - onClick, - children, - ...restProps -}: DropdownButtonProps) { +function DropdownButton({ text, icon, className, title, onClick, children, ...restProps }: DropdownButtonProps) { return ( - - {children ? children : null} - {!children && icon ? icon : null} - {!children && text ? {text} : null} - ); + + {children ? children : null} + {!children && icon ? icon : null} + {!children && text ? {text} : null} + + ); } -export default DropdownButton; \ No newline at end of file +export default DropdownButton; diff --git a/rsconcept/frontend/src/components/Common/DropdownCheckbox.tsx b/rsconcept/frontend/src/components/Common/DropdownCheckbox.tsx index a87e3598..1bd59e6d 100644 --- a/rsconcept/frontend/src/components/Common/DropdownCheckbox.tsx +++ b/rsconcept/frontend/src/components/Common/DropdownCheckbox.tsx @@ -6,31 +6,28 @@ import { animateDropdownItem } from '@/utils/animations'; import Checkbox from './Checkbox'; interface DropdownCheckboxProps { - value: boolean - label?: string - title?: string - disabled?: boolean - setValue?: (newValue: boolean) => void + value: boolean; + label?: string; + title?: string; + disabled?: boolean; + setValue?: (newValue: boolean) => void; } function DropdownCheckbox({ title, setValue, disabled, ...restProps }: DropdownCheckboxProps) { return ( - - - ); + + + + ); } -export default DropdownCheckbox; \ No newline at end of file +export default DropdownCheckbox; diff --git a/rsconcept/frontend/src/components/Common/EmbedYoutube.tsx b/rsconcept/frontend/src/components/Common/EmbedYoutube.tsx index db3734ce..edca95bf 100644 --- a/rsconcept/frontend/src/components/Common/EmbedYoutube.tsx +++ b/rsconcept/frontend/src/components/Common/EmbedYoutube.tsx @@ -1,35 +1,37 @@ interface EmbedYoutubeProps { - videoID: string - pxHeight: number - pxWidth?: number + videoID: string; + pxHeight: number; + pxWidth?: number; } function EmbedYoutube({ videoID, pxHeight, pxWidth }: EmbedYoutubeProps) { if (!pxWidth) { - pxWidth = pxHeight * 16 / 9; + pxWidth = (pxHeight * 16) / 9; } return ( -
-