Amount
2 years ago
Consent
2 years ago
Checkbox.tsx
2 years ago
Date.tsx
2 years ago
Email.tsx
2 years ago
File.tsx
2 years ago
Gateways.tsx
2 years ago
Hidden.tsx
2 years ago
MultiSelect.tsx
2 years ago
Password.tsx
2 years ago
Phone.tsx
2 years ago
Radio.tsx
2 years ago
Select.tsx
2 years ago
Text.tsx
2 years ago
TextArea.tsx
2 years ago
Url.tsx
2 years ago
Text.tsx
23 lines
| 1 | import {FieldHasDescriptionProps} from '@givewp/forms/propTypes'; |
| 2 | |
| 3 | export default function Text({ |
| 4 | Label, |
| 5 | ErrorMessage, |
| 6 | fieldError, |
| 7 | description, |
| 8 | placeholder, |
| 9 | inputProps, |
| 10 | }: FieldHasDescriptionProps) { |
| 11 | const FieldDescription = window.givewp.form.templates.layouts.fieldDescription; |
| 12 | |
| 13 | return ( |
| 14 | <label className={fieldError && 'givewp-field-error-label'}> |
| 15 | <Label /> |
| 16 | {description && <FieldDescription description={description} />} |
| 17 | <input type="text" aria-invalid={fieldError ? 'true' : 'false'} placeholder={placeholder} {...inputProps} /> |
| 18 | |
| 19 | <ErrorMessage /> |
| 20 | </label> |
| 21 | ); |
| 22 | } |
| 23 |