import classNames from 'classnames' import React from 'react' import { Repeater, types, Text, Link, Plain } from 'react-bricks/frontend' import { FcDepartment, FcPhone, FcVoicePresentation } from 'react-icons/fc' import blockNames from '../../blockNames' import { buttonColors, textColors } from '../../colors' import { backgroundSideGroup, LayoutProps, paddingBordersSideGroup, sectionDefaults, } from '../../LayoutSideProps' import Container from '../../shared/components/Container' import Section from '../../shared/components/Section' import TitleSubtitle from '../../shared/components/TitleSubtitle' import { GoogleReCaptchaProvider } from 'react-google-recaptcha-v3' export interface ContactsFormProps extends LayoutProps { address: types.TextValue phoneNumber: types.TextValue email: types.TextValue formFields: types.RepeaterItems title: types.TextValue subtitle: types.TextValue } const ContactsForm: types.Brick = ({ backgroundColor, borderTop, borderBottom, paddingTop, paddingBottom, address, phoneNumber, email, formFields, title, subtitle, }) => { const reCaptchaKey = process.env.NEXT_PUBLIC_RECAPTCHA_KEY || '' return (
  • ( {props.children} )} />
  • {children}} />
  • {children}} />
) } ContactsForm.schema = { name: 'ContactsForm', label: 'Contacts with Form', category: 'contact', previewImageUrl: `/bricks-preview-images/contacts-with-form.png`, playgroundLinkLabel: 'View source code on Github', playgroundLinkUrl: 'https://github.com/ReactBricks/reactbricks-starters/blob/main/packages/reactbricks-ui/nextjs-pages/src/contacts/ContactsForm/ContactsForm.tsx', getDefaultProps: () => ({ ...sectionDefaults, address: '4556 Brendan Ferry\nLos Angeles, CA 90210', phoneNumber: '+1 (555) 423-5786', email: 'hello@example.com', title: 'Contact us', subtitle: 'Do you have a project in mind? We are happy to talk with you to understand your needs, prepare a quote for you and make it happen!', form: [ { buttonPosition: 'justify-end', paddingTop: '0', paddingBottom: '0', width: 'full', 'form-elements': [ { type: blockNames.FormInput, props: { fieldName: 'firstname', isRequired: true, inputType: 'text', columns: '1', label: 'First name', requiredError: 'Please, fill in your first name', pattern: '', patternError: '', }, }, { type: blockNames.FormInput, props: { fieldName: 'lastname', isRequired: true, inputType: 'text', columns: '1', label: 'Last name', requiredError: 'Please, fill in your last name', pattern: '', patternError: '', }, }, { type: blockNames.FormInput, props: { fieldName: 'email', isRequired: true, inputType: 'email', columns: '2', label: 'Email', requiredError: 'Please, fill in your email address', pattern: '', patternError: '', }, }, { type: blockNames.FormInput, props: { fieldName: 'company', isRequired: false, inputType: 'text', columns: '2', label: 'Company', requiredError: '', pattern: '', patternError: '', }, }, { type: blockNames.FormTextArea, props: { fieldName: 'message', isRequired: false, columns: '2', label: 'Message', requiredError: '', pattern: '', patternError: '', }, }, { type: blockNames.FormCheckbox, props: { fieldName: 'privacy', isRequired: true, columns: '2', label: 'I accept the processing of my data', requiredError: 'Please, accept our privacy terms', pattern: '', patternError: '', }, }, ], 'form-buttons': [ { type: 'button', buttonType: 'submit', buttonColor: buttonColors.SKY.value, text: 'Send', variant: 'solid', }, ], }, ], }), sideEditProps: [backgroundSideGroup, paddingBordersSideGroup], repeaterItems: [ { name: 'form', itemType: blockNames.FormBuilder, itemLabel: 'form', min: 1, max: 1, }, ], } export default ContactsForm