From e3486f45d070a86c35dfb14cf9e8d2ce53ac6673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Sz=C3=BCcs?= Date: Thu, 13 Nov 2025 09:22:03 +0100 Subject: [PATCH] feat(ui): replace native inputs with Mantine components in forms and settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated front-ends to use maintine component - Update input such ass PasswordInput etc to use mantine Signed-off-by: Balázs Szücs --- .../tools/compress/CompressSettings.tsx | 61 +++++-------------- .../routes/login/EmailPasswordForm.tsx | 28 ++++----- .../routes/login/NavigationLink.tsx | 7 ++- .../proprietary/routes/login/OAuthButtons.tsx | 18 +++--- .../proprietary/routes/signup/SignupForm.tsx | 57 ++++++++--------- 5 files changed, 67 insertions(+), 104 deletions(-) diff --git a/frontend/src/core/components/tools/compress/CompressSettings.tsx b/frontend/src/core/components/tools/compress/CompressSettings.tsx index 398e0b7b4..c736564ef 100644 --- a/frontend/src/core/components/tools/compress/CompressSettings.tsx +++ b/frontend/src/core/components/tools/compress/CompressSettings.tsx @@ -1,5 +1,4 @@ -import { useState } from "react"; -import { Stack, Text, NumberInput, Select, Divider, Checkbox } from "@mantine/core"; +import { Stack, Text, NumberInput, Select, Divider, Checkbox, Slider } from "@mantine/core"; import { useTranslation } from "react-i18next"; import { CompressParameters } from "@app/hooks/tools/compress/useCompressParameters"; import ButtonSelector from "@app/components/shared/ButtonSelector"; @@ -12,7 +11,6 @@ interface CompressSettingsProps { const CompressSettings = ({ parameters, onParameterChange, disabled = false }: CompressSettingsProps) => { const { t } = useTranslation(); - const [isSliding, setIsSliding] = useState(false); return ( @@ -35,50 +33,19 @@ const CompressSettings = ({ parameters, onParameterChange, disabled = false }: C Compression Level -
- onParameterChange('compressionLevel', parseInt(e.target.value))} - onMouseDown={() => setIsSliding(true)} - onMouseUp={() => setIsSliding(false)} - onTouchStart={() => setIsSliding(true)} - onTouchEnd={() => setIsSliding(false)} - disabled={disabled} - style={{ - width: '100%', - height: '6px', - borderRadius: '3px', - background: `linear-gradient(to right, #228be6 0%, #228be6 ${(parameters.compressionLevel - 1) / 8 * 100}%, #e9ecef ${(parameters.compressionLevel - 1) / 8 * 100}%, #e9ecef 100%)`, - outline: 'none', - WebkitAppearance: 'none' - }} - /> - {isSliding && ( -
- {parameters.compressionLevel} -
- )} -
-
- Min 1 - Max 9 -
+ onParameterChange('compressionLevel', value)} + disabled={disabled} + marks={[ + { value: 1, label: 'Min 1' }, + { value: 9, label: 'Max 9' }, + ]} + label={(value) => `${value}`} + /> {parameters.compressionLevel <= 3 && "1-3 PDF compression"} {parameters.compressionLevel >= 4 && parameters.compressionLevel <= 6 && "4-6 lite image compression"} diff --git a/frontend/src/proprietary/routes/login/EmailPasswordForm.tsx b/frontend/src/proprietary/routes/login/EmailPasswordForm.tsx index 65dd6c588..12777d1c6 100644 --- a/frontend/src/proprietary/routes/login/EmailPasswordForm.tsx +++ b/frontend/src/proprietary/routes/login/EmailPasswordForm.tsx @@ -1,5 +1,6 @@ import { useTranslation } from 'react-i18next'; import '@app/routes/authShared/auth.css'; +import { TextInput, PasswordInput, Button } from '@mantine/core'; interface EmailPasswordFormProps { email: string @@ -38,49 +39,46 @@ export default function EmailPasswordForm({
- - setEmail(e.target.value)} - className={`auth-input ${fieldErrors.email ? 'auth-input-error' : ''}`} + error={fieldErrors.email} + classNames={{ label: 'auth-label' }} /> - {fieldErrors.email && ( -
{fieldErrors.email}
- )}
{showPasswordField && (
- - setPassword(e.target.value)} - className={`auth-input ${fieldErrors.password ? 'auth-input-error' : ''}`} + error={fieldErrors.password} + classNames={{ label: 'auth-label' }} /> - {fieldErrors.password && ( -
{fieldErrors.password}
- )}
)}
- +
); } diff --git a/frontend/src/proprietary/routes/login/NavigationLink.tsx b/frontend/src/proprietary/routes/login/NavigationLink.tsx index 935654381..af08094ce 100644 --- a/frontend/src/proprietary/routes/login/NavigationLink.tsx +++ b/frontend/src/proprietary/routes/login/NavigationLink.tsx @@ -1,3 +1,5 @@ +import { Button } from '@mantine/core'; + interface NavigationLinkProps { onClick: () => void text: string @@ -7,13 +9,14 @@ interface NavigationLinkProps { export default function NavigationLink({ onClick, text, isDisabled = false }: NavigationLinkProps) { return (
- +
); } diff --git a/frontend/src/proprietary/routes/login/OAuthButtons.tsx b/frontend/src/proprietary/routes/login/OAuthButtons.tsx index e7fcb1b06..a71667311 100644 --- a/frontend/src/proprietary/routes/login/OAuthButtons.tsx +++ b/frontend/src/proprietary/routes/login/OAuthButtons.tsx @@ -1,5 +1,6 @@ import { useTranslation } from 'react-i18next'; import { BASE_PATH } from '@app/constants/app'; +import { Button } from '@mantine/core'; // OAuth provider configuration const oauthProviders = [ @@ -26,14 +27,15 @@ export default function OAuthButtons({ onProviderClick, isSubmitting, layout = '
{enabledProviders.map((p) => (
- +
))}
@@ -45,14 +47,15 @@ export default function OAuthButtons({ onProviderClick, isSubmitting, layout = '
{enabledProviders.map((p) => (
- +
))}
@@ -62,16 +65,17 @@ export default function OAuthButtons({ onProviderClick, isSubmitting, layout = ' return (
{enabledProviders.map((p) => ( - + ))}
); diff --git a/frontend/src/proprietary/routes/signup/SignupForm.tsx b/frontend/src/proprietary/routes/signup/SignupForm.tsx index 9e6ac9dc0..92c06c319 100644 --- a/frontend/src/proprietary/routes/signup/SignupForm.tsx +++ b/frontend/src/proprietary/routes/signup/SignupForm.tsx @@ -1,7 +1,7 @@ import { useEffect } from 'react'; import '@app/routes/authShared/auth.css'; import { useTranslation } from 'react-i18next'; -import { Checkbox } from '@mantine/core'; +import { Checkbox, TextInput, PasswordInput, Button } from '@mantine/core'; import { SignupFieldErrors } from '@app/routes/signup/SignupFormValidation'; interface SignupFormProps { @@ -53,57 +53,49 @@ export default function SignupForm({
{showName && (
- - setName?.(e.target.value)} - className={`auth-input ${fieldErrors.name ? 'auth-input-error' : ''}`} + error={fieldErrors.name} + classNames={{ label: 'auth-label' }} /> - {fieldErrors.name && ( -
{fieldErrors.name}
- )}
)}
- - setEmail(e.target.value)} - onKeyPress={(e) => e.key === 'Enter' && !isSubmitting && onSubmit()} - className={`auth-input ${fieldErrors.email ? 'auth-input-error' : ''}`} + onKeyDown={(e) => e.key === 'Enter' && !isSubmitting && onSubmit()} + error={fieldErrors.email} + classNames={{ label: 'auth-label' }} /> - {fieldErrors.email && ( -
{fieldErrors.email}
- )}
- - setPassword(e.target.value)} - onKeyPress={(e) => e.key === 'Enter' && !isSubmitting && onSubmit()} - className={`auth-input ${fieldErrors.password ? 'auth-input-error' : ''}`} + onKeyDown={(e) => e.key === 'Enter' && !isSubmitting && onSubmit()} + error={fieldErrors.password} + classNames={{ label: 'auth-label' }} /> - {fieldErrors.password && ( -
{fieldErrors.password}
- )}
- - setConfirmPassword(e.target.value)} - onKeyPress={(e) => e.key === 'Enter' && !isSubmitting && onSubmit()} - className={`auth-input ${fieldErrors.confirmPassword ? 'auth-input-error' : ''}`} + onKeyDown={(e) => e.key === 'Enter' && !isSubmitting && onSubmit()} + error={fieldErrors.confirmPassword} + classNames={{ label: 'auth-label' }} /> - {fieldErrors.confirmPassword && ( -
{fieldErrors.confirmPassword}
- )}
@@ -152,13 +141,15 @@ export default function SignupForm({ )} {/* Sign Up Button */} - + ); }