From fc3a44c5e4da7e4439d7c0221b03b2879fd92478 Mon Sep 17 00:00:00 2001 From: matushl Date: Sun, 10 Dec 2023 11:44:25 +0100 Subject: [PATCH] Some code cleaning --- .../Admin/resources/cms/post/PostList.tsx | 2 +- .../LoginFormWrapper/LoginFormWrapper.tsx | 24 +++--- .../PasswordReset/PasswordReset.tsx | 86 +++++++++---------- src/components/Posts/Post.tsx | 2 +- src/pages/malynar/reset-sent/index.tsx | 3 +- .../malynar/verifikacia/[[...params]].tsx | 3 +- src/pages/matik/reset-sent/index.tsx | 3 +- src/pages/matik/verifikacia/[[...params]].tsx | 3 +- src/pages/strom/archiv/[[...params]].tsx | 3 +- src/pages/strom/reset-sent/index.tsx | 3 +- src/pages/strom/verifikacia/[[...params]].tsx | 3 +- 11 files changed, 65 insertions(+), 70 deletions(-) diff --git a/src/components/Admin/resources/cms/post/PostList.tsx b/src/components/Admin/resources/cms/post/PostList.tsx index 909746c5..1b043821 100644 --- a/src/components/Admin/resources/cms/post/PostList.tsx +++ b/src/components/Admin/resources/cms/post/PostList.tsx @@ -1,5 +1,5 @@ import {FC} from 'react' -import {Datagrid, DateField, FunctionField, List, NumberField, RaRecord, TextField} from 'react-admin' +import {Datagrid, DateField, FunctionField, List, RaRecord, TextField} from 'react-admin' import {SitesArrayField} from '@/components/Admin/custom/SitesArrayField' import {TruncatedTextField} from '@/components/Admin/custom/TruncatedTextField' diff --git a/src/components/PageLayout/LoginFormWrapper/LoginFormWrapper.tsx b/src/components/PageLayout/LoginFormWrapper/LoginFormWrapper.tsx index 12a667f8..d2e4cb56 100644 --- a/src/components/PageLayout/LoginFormWrapper/LoginFormWrapper.tsx +++ b/src/components/PageLayout/LoginFormWrapper/LoginFormWrapper.tsx @@ -20,20 +20,18 @@ export const LoginFormWrapper: FC = ({closeOverlay}) => { if (form === 'login') return ( - <> - - - - - + + + + - + ) return ( diff --git a/src/components/PasswordReset/PasswordReset.tsx b/src/components/PasswordReset/PasswordReset.tsx index 7d623b09..ffba07a7 100644 --- a/src/components/PasswordReset/PasswordReset.tsx +++ b/src/components/PasswordReset/PasswordReset.tsx @@ -54,54 +54,50 @@ export const PasswordResetForm: FC = ({uid, token}) => { if (isReset) return ( - <> - - Heslo úspešne zmenené, môžeš sa prihlásiť - { - router.push('/') - }} - /> - - + + Heslo úspešne zmenené, môžeš sa prihlásiť + { + router.push('/') + }} + /> + ) return ( - <> -
- - - { - if (val !== getValues().password1) return '* Zadané heslá sa nezhodujú.' - }, - }} - /> - - - + + + + { + if (val !== getValues().password1) return '* Zadané heslá sa nezhodujú.' + }, + }} + /> + + - - + + ) } diff --git a/src/components/Posts/Post.tsx b/src/components/Posts/Post.tsx index 952a3b5b..9c9ae050 100644 --- a/src/components/Posts/Post.tsx +++ b/src/components/Posts/Post.tsx @@ -18,7 +18,7 @@ export interface IPost { sites: number[] } -export const Post: FC = ({id, caption, short_text, links, sites, added_at}) => { +export const Post: FC = ({caption, short_text, links, sites, added_at}) => { const {seminarId} = useSeminarInfo() if (!sites.includes(seminarId)) return null diff --git a/src/pages/malynar/reset-sent/index.tsx b/src/pages/malynar/reset-sent/index.tsx index 1256e1d5..6790a4fe 100644 --- a/src/pages/malynar/reset-sent/index.tsx +++ b/src/pages/malynar/reset-sent/index.tsx @@ -1,9 +1,8 @@ import {NextPage} from 'next' +import {PageLayout} from '@/components/PageLayout/PageLayout' import {PasswordResetSent} from '@/components/PasswordResetSent/PasswordResetSent' -import {PageLayout} from '../../../components/PageLayout/PageLayout' - const Verifikacia: NextPage = () => { return ( diff --git a/src/pages/malynar/verifikacia/[[...params]].tsx b/src/pages/malynar/verifikacia/[[...params]].tsx index 7727865e..3a39698d 100644 --- a/src/pages/malynar/verifikacia/[[...params]].tsx +++ b/src/pages/malynar/verifikacia/[[...params]].tsx @@ -1,6 +1,7 @@ import {NextPage} from 'next' -import {PageLayout} from '../../../components/PageLayout/PageLayout' +import {PageLayout} from '@/components/PageLayout/PageLayout' + import {Verification} from '../../../components/Verification/Verification' const Verifikacia: NextPage = () => { diff --git a/src/pages/matik/reset-sent/index.tsx b/src/pages/matik/reset-sent/index.tsx index 1256e1d5..6790a4fe 100644 --- a/src/pages/matik/reset-sent/index.tsx +++ b/src/pages/matik/reset-sent/index.tsx @@ -1,9 +1,8 @@ import {NextPage} from 'next' +import {PageLayout} from '@/components/PageLayout/PageLayout' import {PasswordResetSent} from '@/components/PasswordResetSent/PasswordResetSent' -import {PageLayout} from '../../../components/PageLayout/PageLayout' - const Verifikacia: NextPage = () => { return ( diff --git a/src/pages/matik/verifikacia/[[...params]].tsx b/src/pages/matik/verifikacia/[[...params]].tsx index 7727865e..3a39698d 100644 --- a/src/pages/matik/verifikacia/[[...params]].tsx +++ b/src/pages/matik/verifikacia/[[...params]].tsx @@ -1,6 +1,7 @@ import {NextPage} from 'next' -import {PageLayout} from '../../../components/PageLayout/PageLayout' +import {PageLayout} from '@/components/PageLayout/PageLayout' + import {Verification} from '../../../components/Verification/Verification' const Verifikacia: NextPage = () => { diff --git a/src/pages/strom/archiv/[[...params]].tsx b/src/pages/strom/archiv/[[...params]].tsx index 7bb94415..43f26130 100644 --- a/src/pages/strom/archiv/[[...params]].tsx +++ b/src/pages/strom/archiv/[[...params]].tsx @@ -1,7 +1,8 @@ import {NextPage} from 'next' +import {PageLayout} from '@/components/PageLayout/PageLayout' + import {Archive} from '../../../components/Archive/Archive' -import {PageLayout} from '../../../components/PageLayout/PageLayout' const Archiv: NextPage = () => { return ( diff --git a/src/pages/strom/reset-sent/index.tsx b/src/pages/strom/reset-sent/index.tsx index 1256e1d5..6790a4fe 100644 --- a/src/pages/strom/reset-sent/index.tsx +++ b/src/pages/strom/reset-sent/index.tsx @@ -1,9 +1,8 @@ import {NextPage} from 'next' +import {PageLayout} from '@/components/PageLayout/PageLayout' import {PasswordResetSent} from '@/components/PasswordResetSent/PasswordResetSent' -import {PageLayout} from '../../../components/PageLayout/PageLayout' - const Verifikacia: NextPage = () => { return ( diff --git a/src/pages/strom/verifikacia/[[...params]].tsx b/src/pages/strom/verifikacia/[[...params]].tsx index 7727865e..3a39698d 100644 --- a/src/pages/strom/verifikacia/[[...params]].tsx +++ b/src/pages/strom/verifikacia/[[...params]].tsx @@ -1,6 +1,7 @@ import {NextPage} from 'next' -import {PageLayout} from '../../../components/PageLayout/PageLayout' +import {PageLayout} from '@/components/PageLayout/PageLayout' + import {Verification} from '../../../components/Verification/Verification' const Verifikacia: NextPage = () => {