Skip to content

Commit

Permalink
feat: adjust form spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
martapanc committed Feb 18, 2024
1 parent 7060584 commit 04db826
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/components/molecules/ContactForm/ContactForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ const ContactForm = () => {
id='message'
label={t('contacts.fields.message.label')}
placeholder={t('contacts.fields.message.placeholder')}
rows={6}
/>

<div className='mt-6 flex justify-end'>
<div className='mt-2 flex justify-end'>
<ReCAPTCHA
sitekey={reCaptchaSiteKey}
ref={recaptchaRef}
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/ContactForm/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const Input = ({
const [_, meta] = useField(fieldProps);

return (
<label htmlFor='firstName' className='mb-2 mt-6 flex flex-col font-bold'>
<label htmlFor={id} className='mb-2 mt-4 flex flex-col font-bold'>
{label}
<Field
placeholder={placeholder}
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/ContactForm/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const Select = ({ id, label, options }: SelectProps) => {
const { t } = useTranslation();

return (
<label htmlFor={id} className='mb-2 mt-6 flex flex-col font-bold'>
<label htmlFor={id} className='mb-2 mt-4 flex flex-col font-bold'>
{label}
<Field
as='select'
Expand Down
7 changes: 4 additions & 3 deletions src/components/molecules/ContactForm/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ export interface TextAreaProps {
id: string;
label: string;
placeholder?: string;
rows?: number;
}

export const TextArea = ({ id, label, placeholder }: TextAreaProps) => {
export const TextArea = ({ id, label, placeholder, rows }: TextAreaProps) => {
const fieldProps = { id, name: id, label, placeholder };
const [_, meta] = useField(fieldProps);

return (
<label htmlFor='firstName' className='mb-2 mt-6 flex flex-col font-bold'>
<label htmlFor={id} className='mb-2 mt-4 flex flex-col font-bold'>
{label}
<Field
as='textarea'
Expand All @@ -27,7 +28,7 @@ export const TextArea = ({ id, label, placeholder }: TextAreaProps) => {
'ring-grey-400 dark:ring-slate-500': !meta.touched || !meta.error,
},
)}
rows={7}
rows={rows}
/>
<div className='font-sm font-normal text-red-600'>
{meta.touched && meta.error}
Expand Down

0 comments on commit 04db826

Please sign in to comment.