Skip to content

Conversation

@juliawegmayr
Copy link
Contributor

@juliawegmayr juliawegmayr commented Dec 16, 2025

Description

  • Add basic form fields (Input, Checkbox and Select)
  • Add fields to ContactFormBlock

(Styling and functionality will be added in upcoming PRs

Acceptance criteria

Screenshots/screencasts

Screenshot 2025-12-16 at 09 48 11

Open TODOs/questions

Further information

@juliawegmayr juliawegmayr self-assigned this Dec 16, 2025
@juliawegmayr juliawegmayr changed the base branch from main to feature/contact-form December 16, 2025 08:49
@juliawegmayr juliawegmayr mentioned this pull request Dec 16, 2025
6 tasks
@juliawegmayr juliawegmayr marked this pull request as ready for review December 18, 2025 08:11
@auto-assign auto-assign bot requested a review from johnnyomair December 18, 2025 08:11
Copy link
Collaborator

@johnnyomair johnnyomair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The form will be implemented using https://react-hook-form.com/ later, does it make sense to implement components with local state now?

@@ -0,0 +1,15 @@
interface CheckboxFieldProps {
label: React.ReactNode;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace all namespace imports (React.*) with real imports.

@@ -0,0 +1,15 @@
interface CheckboxFieldProps {
label: React.ReactNode;
helperText?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use ReactNode for this for better i18n. This allows using <FormattedMessage> instead of intl.formatMessage().

required?: boolean;
placeholder?: string;
helperText?: string;
textArea?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we instead create a TextField and a TextareaField?

label: React.ReactNode;
required?: boolean;
helperText?: string;
options: Array<{ value: string; label: string }>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use ReactNode for the label.

required = false,
helperText,
options,
placeholder = "Select an option",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value should be a react-intl message.

required?: boolean;
}

export function CheckboxField({ label, helperText }: CheckboxFieldProps): React.ReactElement {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove the explicit return type definitions here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants