PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.15.0
GiveWP – Donation Plugin and Fundraising Platform v4.15.0
4.18.0.1 4.18.0 4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 All 258 releases
give / src / DonationForms / resources / registrars / templates / fields / Email.tsx

Email.tsx in GiveWP – Donation Plugin and Fundraising Platform 4.15.0, at src/DonationForms/resources/registrars/templates/fields/Email.tsx

34 lines 995 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import {FieldHasDescriptionProps} from '@givewp/forms/propTypes';
2 import autoCompleteAttr from '@givewp/forms/registrars/templates/fields/utils/autoCompleteAttr';
3
4 /**
5 * @since 4.3.0 Add autoComplete support
6 */
7 export default function Email({
8 Label,
9 ErrorMessage,
10 description,
11 placeholder,
12 fieldError,
13 inputProps,
14 }: FieldHasDescriptionProps) {
15 const autoComplete = autoCompleteAttr(inputProps?.name);
16 const FieldDescription = window.givewp.form.templates.layouts.fieldDescription;
17
18 return (
19 <label className={fieldError && 'givewp-field-error-label'}>
20 <Label />
21 {description && <FieldDescription description={description} />}
22 <input
23 type="email"
24 aria-invalid={fieldError ? 'true' : 'false'}
25 placeholder={placeholder}
26 {...inputProps}
27 autoComplete={autoComplete}
28 />
29
30 <ErrorMessage />
31 </label>
32 );
33 }
34