import classNames from 'classnames' import * as React from 'react' import { Repeater, Text, types } from 'react-bricks/rsc' import { backgroundSideGroup, LayoutProps, paddingBordersSideGroup, sectionDefaults, } from '../../LayoutSideProps' import blockNames from '../../blockNames' import { buttonColors, textColors } from '../../colors' import Container from '../../shared/components/Container' import Section from '../../shared/components/Section' export interface CallToActionProps extends LayoutProps { text: types.TextValue buttons: types.RepeaterItems } const CallToAction: types.Brick = ({ backgroundColor, borderTop, borderBottom, paddingTop, paddingBottom, text, buttons, }) => { return (
( {props.children} )} placeholder="Call to action text" />
) } CallToAction.schema = { name: blockNames.CallToAction, label: 'Call to action', category: 'call to action', tags: ['cta', 'call to action'], previewImageUrl: `/bricks-preview-images/${blockNames.CallToAction}.png`, playgroundLinkLabel: 'View source code on Github', playgroundLinkUrl: 'https://github.com/ReactBricks/reactbricks-starters/blob/main/packages/reactbricks-ui/nextjs-app/src/cta/CallToAction/CallToAction.tsx', getDefaultProps: () => ({ ...sectionDefaults, borderTop: 'boxed', paddingTop: '12', paddingBottom: '20', text: 'React Bricks is great for developers and marketing teams.', buttons: [ { text: 'Discover more', type: 'solid', buttonColor: buttonColors.SKY.value, href: 'https://reactbricks.com', isTargetBlank: true, padding: 'normal', }, ], }), repeaterItems: [ { name: 'buttons', itemType: blockNames.Button, itemLabel: 'Button', min: 0, max: 1, }, ], sideEditProps: [backgroundSideGroup, paddingBordersSideGroup], } export default CallToAction