Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added text overrides on GuestForm #457

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions package/src/components/GuestForm/v1/GuestForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ class GuestForm extends Component {
*/
TextInput: CustomPropTypes.component.isRequired
}).isRequired,
/**
* The text for the "Email address" label text.
*/
emailLabelText: PropTypes.string,
/**
* The text for the "Email address" placeholder text.
*/
emailPlaceholderText: PropTypes.string,
/**
* Errors array
*/
Expand Down Expand Up @@ -112,7 +120,9 @@ class GuestForm extends Component {
validator: getRequiredValidator("email"),
value: {
email: ""
}
},
emailLabelText: "Email address",
emailPlaceholderText: "Email address"
};

_form = null;
Expand All @@ -132,6 +142,8 @@ class GuestForm extends Component {
buttonText,
className,
components: { Button, ErrorsBlock, Field, TextInput },
emailLabelText,
emailPlaceholderText,
errors,
helpText,
isSaving,
Expand All @@ -153,8 +165,8 @@ class GuestForm extends Component {
validator={validator}
value={value}
>
<Field name="email" label="Email Address" isRequired helpText={helpText}>
<TextInput id={emailInputId} isReadOnly={isSaving} name="email" placeholder="Email address"
<Field name="email" label={emailLabelText} isRequired helpText={helpText}>
<TextInput id={emailInputId} isReadOnly={isSaving} name="email" placeholder={emailPlaceholderText}
type="email"
/>
<ErrorsBlock names={["email"]} />
Expand Down