From 06e234040cb72ffe6eff39f1fc86f5c5919107bd Mon Sep 17 00:00:00 2001 From: matushl Date: Sat, 23 Nov 2024 23:42:44 +0100 Subject: [PATCH 01/12] Change design of login, etc buttons --- .../PageLayout/MenuMain/BottomButtons.tsx | 14 +++++--------- src/components/PageLayout/MenuMain/MenuMain.tsx | 4 ---- src/theme.ts | 1 - 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/components/PageLayout/MenuMain/BottomButtons.tsx b/src/components/PageLayout/MenuMain/BottomButtons.tsx index 06be8045..e14705f8 100644 --- a/src/components/PageLayout/MenuMain/BottomButtons.tsx +++ b/src/components/PageLayout/MenuMain/BottomButtons.tsx @@ -29,27 +29,23 @@ export const BottomButtons: FC = () => { } } - const separator = - return ( - + {!isAuthed ? ( <> - + Registrovať - {separator} - ) : ( <> - + Profil - {separator} - diff --git a/src/components/PageLayout/MenuMain/MenuMain.tsx b/src/components/PageLayout/MenuMain/MenuMain.tsx index df0b0b72..92cc339b 100644 --- a/src/components/PageLayout/MenuMain/MenuMain.tsx +++ b/src/components/PageLayout/MenuMain/MenuMain.tsx @@ -166,10 +166,6 @@ const MenuMainItem: FC<{caption: string; url: string}> = ({caption, url}) => { py: '4px', px: '8px', }} - textSx={{ - fontStyle: 'normal', - textAlign: 'center', - }} > {caption} diff --git a/src/theme.ts b/src/theme.ts index 81575bff..a8b810f5 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -131,7 +131,6 @@ const _theme = createTheme({ ...font.style, textTransform: 'uppercase', fontWeight: 800, - fontStyle: 'italic', }, button2: { ...font.style, From 20dfe229db8700963e1dec459a8d3ed41123dccb Mon Sep 17 00:00:00 2001 From: matushl Date: Sat, 23 Nov 2024 23:52:51 +0100 Subject: [PATCH 02/12] Fix size and position dialog buttons --- src/components/Alert/AlertBox.tsx | 6 ++--- .../PageLayout/LoginForm/LoginForm.tsx | 26 +++++++++---------- .../PasswordResetRequest.tsx | 2 +- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/components/Alert/AlertBox.tsx b/src/components/Alert/AlertBox.tsx index fa617aff..de80221d 100644 --- a/src/components/Alert/AlertBox.tsx +++ b/src/components/Alert/AlertBox.tsx @@ -25,9 +25,9 @@ export const AlertBox: FC = () => { contentText={container.alertBox?.message} close={closeContainer} > - - diff --git a/src/components/PageLayout/LoginForm/LoginForm.tsx b/src/components/PageLayout/LoginForm/LoginForm.tsx index 41366b72..065a73a5 100644 --- a/src/components/PageLayout/LoginForm/LoginForm.tsx +++ b/src/components/PageLayout/LoginForm/LoginForm.tsx @@ -1,4 +1,4 @@ -import {Stack} from '@mui/material' +import {Box, Stack} from '@mui/material' import {useRouter} from 'next/router' import {FC, useState} from 'react' import {SubmitHandler, useForm} from 'react-hook-form' @@ -80,21 +80,19 @@ export const LoginForm: FC = ({closeDialog}) => { }} /> - - - + - - Chcem sa registrovať - - - - - + + + + + Registrovať sa + + diff --git a/src/components/PageLayout/PasswordResetRequest/PasswordResetRequest.tsx b/src/components/PageLayout/PasswordResetRequest/PasswordResetRequest.tsx index bf1cb5b4..7040aa9a 100644 --- a/src/components/PageLayout/PasswordResetRequest/PasswordResetRequest.tsx +++ b/src/components/PageLayout/PasswordResetRequest/PasswordResetRequest.tsx @@ -54,7 +54,7 @@ export const PasswordResetRequestForm: FC = ({cl }, }} /> - + From f6646361e3dd2717d6db2eb37dc30cdf93f72940 Mon Sep 17 00:00:00 2001 From: matushl Date: Sun, 24 Nov 2024 00:00:42 +0100 Subject: [PATCH 03/12] Remove banner when empty --- src/components/PageLayout/Banner/Banner.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/PageLayout/Banner/Banner.tsx b/src/components/PageLayout/Banner/Banner.tsx index fe93778b..6c1dc63f 100644 --- a/src/components/PageLayout/Banner/Banner.tsx +++ b/src/components/PageLayout/Banner/Banner.tsx @@ -10,6 +10,11 @@ export const Banner: FC = () => { const bannerTextFormatted = bannerMessages.length > 0 ? Array(10).fill(bannerMessages).flat().join(divider) + divider : undefined + + if (!bannerTextFormatted) { + return null + } + return ( { > - {bannerTextFormatted || '\u00A0'} + {bannerTextFormatted} From 5ca935023c1c0beafd554eff8028ed90b4d8b10f Mon Sep 17 00:00:00 2001 From: matushl Date: Sun, 24 Nov 2024 00:01:31 +0100 Subject: [PATCH 04/12] =?UTF-8?q?Rename=20Novinky=20to=20Pr=C3=ADspevky?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/strom/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/strom/index.tsx b/src/pages/strom/index.tsx index 6fbf0eeb..48484003 100644 --- a/src/pages/strom/index.tsx +++ b/src/pages/strom/index.tsx @@ -4,7 +4,7 @@ import {PageLayout} from '@/components/PageLayout/PageLayout' import {Posts} from '@/components/Posts/Posts' const Strom: NextPage = () => ( - + ) From 29ba48e19f17c528b6dfa01337d8e3b15692a86d Mon Sep 17 00:00:00 2001 From: matushl Date: Sun, 24 Nov 2024 00:22:52 +0100 Subject: [PATCH 05/12] Implement show password buttons --- .../FormItems/FormInput/FormInput.tsx | 2 ++ .../PageLayout/LoginForm/LoginForm.tsx | 20 +++++++++-- src/components/Profile/PasswordChangeForm.tsx | 36 ++++++++++++++++--- src/components/RegisterForm/RegisterForm.tsx | 24 +++++++++++-- src/theme.ts | 7 ++++ 5 files changed, 79 insertions(+), 10 deletions(-) diff --git a/src/components/FormItems/FormInput/FormInput.tsx b/src/components/FormItems/FormInput/FormInput.tsx index c0854ee9..3da0c239 100644 --- a/src/components/FormItems/FormInput/FormInput.tsx +++ b/src/components/FormItems/FormInput/FormInput.tsx @@ -12,6 +12,7 @@ export const FormInput = < label, type, rules, + ...props }: TextFieldProps & Pick, 'name' | 'control' | 'rules'> & { label: string @@ -31,6 +32,7 @@ export const FormInput = < helperText={error?.message} focused={false} sx={formItemStyle} + {...props} /> )} /> diff --git a/src/components/PageLayout/LoginForm/LoginForm.tsx b/src/components/PageLayout/LoginForm/LoginForm.tsx index 065a73a5..2d8464fa 100644 --- a/src/components/PageLayout/LoginForm/LoginForm.tsx +++ b/src/components/PageLayout/LoginForm/LoginForm.tsx @@ -1,4 +1,5 @@ -import {Box, Stack} from '@mui/material' +import {Visibility, VisibilityOff} from '@mui/icons-material' +import {Box, IconButton, Stack} from '@mui/material' import {useRouter} from 'next/router' import {FC, useState} from 'react' import {SubmitHandler, useForm} from 'react-hook-form' @@ -53,6 +54,8 @@ export const LoginForm: FC = ({closeDialog}) => { setDisplayForgottenDialog((prev) => !prev) } + const [showPassword, setShowPassword] = useState(false) + return ( <> @@ -79,7 +82,20 @@ export const LoginForm: FC = ({closeDialog}) => { }, }} /> - + setShowPassword(!showPassword)}> + {showPassword ? : } + + ), + }} + /> From 3cac2dec50ab274c4aa425f6050d3a073f23e9e9 Mon Sep 17 00:00:00 2001 From: Michal Masrna Date: Sun, 24 Nov 2024 12:52:15 +0100 Subject: [PATCH 11/12] LoginForm consistent button names consistent with menu items and button text on register form --- src/components/PageLayout/LoginForm/LoginForm.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/PageLayout/LoginForm/LoginForm.tsx b/src/components/PageLayout/LoginForm/LoginForm.tsx index b83ae29d..2c07ac90 100644 --- a/src/components/PageLayout/LoginForm/LoginForm.tsx +++ b/src/components/PageLayout/LoginForm/LoginForm.tsx @@ -111,10 +111,10 @@ export const LoginForm: FC = ({closeDialog}) => { router.push(`/${seminar}/registracia`) }} > - Registrovať sa + Registrovať From 54512a36a4a3a1f6d77559bb48ec955ddbf7d12a Mon Sep 17 00:00:00 2001 From: Michal Masrna Date: Sun, 24 Nov 2024 13:41:37 +0100 Subject: [PATCH 12/12] lint --- src/components/PageLayout/LoginForm/LoginForm.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/PageLayout/LoginForm/LoginForm.tsx b/src/components/PageLayout/LoginForm/LoginForm.tsx index 2c07ac90..01bf178a 100644 --- a/src/components/PageLayout/LoginForm/LoginForm.tsx +++ b/src/components/PageLayout/LoginForm/LoginForm.tsx @@ -5,7 +5,6 @@ import {FC, useState} from 'react' import {SubmitHandler, useForm} from 'react-hook-form' import {Button} from '@/components/Clickable/Button' -import {Link} from '@/components/Clickable/Link' import {Dialog} from '@/components/Dialog/Dialog' import {FormInput} from '@/components/FormItems/FormInput/FormInput' import {AuthContainer} from '@/utils/AuthContainer'