refactor: update labels and placeholders in login form inputs
All checks were successful
container-scan / Container Scan (pull_request) Successful in 2m1s
docker-build / docker (pull_request) Successful in 3m35s

This commit is contained in:
Maximilian Liebmann 2025-05-13 14:08:19 +02:00
parent dd6b82515e
commit 798467552e
2 changed files with 10 additions and 7 deletions

View file

@ -6,23 +6,24 @@ export default function LabeledInput({
label,
placeholder,
value,
name,
}: {
type: 'text' | 'email' | 'password';
label: string;
placeholder?: string;
value?: string;
name?: string;
}) {
const elementId = Math.random().toString(36).substring(2, 15);
return (
<div className='flex flex-col gap-1'>
<Label htmlFor={elementId}>{label}</Label>
<Label htmlFor={name}>{label}</Label>
<Input
type={type}
placeholder={placeholder}
defaultValue={value}
id={elementId}
id={name}
name={name}
/>
</div>
);

View file

@ -6,13 +6,15 @@ export default function LoginForm() {
<form className='flex flex-col gap-5 w-full'>
<LabeledInput
type='email'
label='E-Mail'
placeholder='Enter your E-Mail'
label='E-Mail or Username'
placeholder='What you are known as.'
name='email'
/>
<LabeledInput
type='password'
label='Password'
placeholder='Enter your Password'
placeholder="Let's hope you remember it."
name='password'
/>
<Button
className='hover:bg-blue-600 hover:text-white'