refactor: update labels and placeholders in login form inputs
This commit is contained in:
parent
dd6b82515e
commit
798467552e
2 changed files with 10 additions and 7 deletions
|
@ -6,23 +6,24 @@ export default function LabeledInput({
|
||||||
label,
|
label,
|
||||||
placeholder,
|
placeholder,
|
||||||
value,
|
value,
|
||||||
|
name,
|
||||||
}: {
|
}: {
|
||||||
type: 'text' | 'email' | 'password';
|
type: 'text' | 'email' | 'password';
|
||||||
label: string;
|
label: string;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
value?: string;
|
value?: string;
|
||||||
|
name?: string;
|
||||||
}) {
|
}) {
|
||||||
const elementId = Math.random().toString(36).substring(2, 15);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex flex-col gap-1'>
|
<div className='flex flex-col gap-1'>
|
||||||
<Label htmlFor={elementId}>{label}</Label>
|
<Label htmlFor={name}>{label}</Label>
|
||||||
|
|
||||||
<Input
|
<Input
|
||||||
type={type}
|
type={type}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
defaultValue={value}
|
defaultValue={value}
|
||||||
id={elementId}
|
id={name}
|
||||||
|
name={name}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -6,13 +6,15 @@ export default function LoginForm() {
|
||||||
<form className='flex flex-col gap-5 w-full'>
|
<form className='flex flex-col gap-5 w-full'>
|
||||||
<LabeledInput
|
<LabeledInput
|
||||||
type='email'
|
type='email'
|
||||||
label='E-Mail'
|
label='E-Mail or Username'
|
||||||
placeholder='Enter your E-Mail'
|
placeholder='What you are known as.'
|
||||||
|
name='email'
|
||||||
/>
|
/>
|
||||||
<LabeledInput
|
<LabeledInput
|
||||||
type='password'
|
type='password'
|
||||||
label='Password'
|
label='Password'
|
||||||
placeholder='Enter your Password'
|
placeholder="Let's hope you remember it."
|
||||||
|
name='password'
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
className='hover:bg-blue-600 hover:text-white'
|
className='hover:bg-blue-600 hover:text-white'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue