import classNames from 'classnames' import React from 'react' import { types, RichText, Text, Link, Repeater } from 'react-bricks/rsc' import blockNames from '../blockNames' import { pricingColors, PricingColorValue, textColors } from '../colors' import { pricingColorsEditProps } from '../LayoutSideProps' interface PricingPlanProps { pricingColor: PricingColorValue withPopularTag: boolean buttonLinkPath: string popularTagText: types.TextValue planName: types.TextValue planDescription: types.TextValue planPrice: types.TextValue planConditions: types.TextValue buttonText: types.TextValue featuresTitle: types.TextValue features: types.RepeaterItems } const PricingPlan: types.Brick = ({ pricingColor = pricingColors.CYAN.value, withPopularTag, buttonLinkPath, popularTagText, planName, planDescription, planPrice, planConditions, buttonText, featuresTitle, features, }) => { return (
{withPopularTag ? ( (
{props.children}
)} placeholder="Tag" /> ) : null}
(

{props.children}

)} placeholder="Plan name..." /> (

{props.children}

)} placeholder="Description..." />
( {props.children} )} placeholder="Price" /> (

{props.children}

)} placeholder="per user / per month..." />
{props.children}
} placeholder="Action" />
(

{props.children}

)} placeholder="type a text" />
    (
  • {item}
  • )} />
) } PricingPlan.schema = { name: blockNames.PricingPlan, label: 'Plan', category: 'pricing', hideFromAddMenu: true, playgroundLinkLabel: 'View source code on Github', playgroundLinkUrl: 'https://github.com/ReactBricks/reactbricks-starters/blob/main/packages/reactbricks-ui/nextjs-app/src/pricing/PricingPlan.tsx', getDefaultProps: () => ({ popularTagText: 'Most popular', withPopularTag: false, pricingColor: pricingColors.CYAN.value, planName: 'Entry', planDescription: 'For startups and teams starting using React Bricks.', planPrice: '$ 99', planConditions: 'per app / month', buttonText: 'Get started', buttonLinkPath: '/', featuresTitle: 'Everything in Community, plus:', features: [ { featureText: '5 users included', }, { featureText: 'Up to 100 pages', }, { featureText: 'Media library', withTag: true, tag: 'Soon', }, ], }), repeaterItems: [ { name: 'features', itemType: blockNames.PlanFeature, itemLabel: 'feature', min: 0, max: 15, }, ], sideEditProps: [ pricingColorsEditProps, { name: 'withPopularTag', label: 'Popular tag', type: types.SideEditPropType.Boolean, }, { name: 'buttonLinkPath', label: 'Button link', type: types.SideEditPropType.Text, }, ], } export default PricingPlan