refactor: restyle login page with UI components
All checks were successful
container-scan / Container Scan (pull_request) Successful in 8m27s
docker-build / docker (pull_request) Successful in 9m5s

Improves the login page's visual appearance by using Card and Input components.
This commit is contained in:
Maximilian Liebmann 2025-05-09 17:38:07 +02:00
parent a56b6829a2
commit 8ab50b2c5e
6 changed files with 142 additions and 45 deletions

View file

@ -1,48 +1,28 @@
import { Input } from '@/components/ui/input';
export default function LabeledInput({
type,
width,
label,
placeholder,
value,
}: {
type: 'text' | 'email' | 'password';
width?: number;
label?: string;
label: string;
placeholder?: string;
value?: string;
}) {
const randomId = Math.random().toString(36).substring(2, 15);
if (!label) {
return (
<div className='flex flex-col gap-2'>
<input
className='border border-gray-300 rounded-md p-2 focus:outline-none focus:ring-2 focus:ring-blue-500'
type={type}
placeholder={placeholder}
defaultValue={value}
style={{
width: width ? `${width}px` : '100%',
}}
/>
</div>
);
} else {
return (
<div className='flex flex-col gap-2'>
<label htmlFor={randomId}>{label}</label>
return (
<div className='flex flex-col gap-2'>
<label htmlFor={randomId}>{label}</label>
<input
className='border border-gray-300 rounded-md p-2 focus:outline-none focus:ring-2 focus:ring-blue-500'
id={randomId}
type={type}
placeholder={placeholder}
defaultValue={value}
style={{
width: width ? `${width}px` : '100%',
}}
/>
</div>
);
}
<Input
type={type}
placeholder={placeholder}
defaultValue={value}
id={randomId}
/>
</div>
);
}