import * as React from "react"; import { Actions } from "../util/actions"; import { Container } from "../util/container"; import { Section } from "../util/section"; import { TinaMarkdown } from "tinacms/dist/rich-text"; import type {Template, TinaTemplate} from "tinacms"; import { PageBlocksHero } from "../../tina/__generated__/types"; import { tinaField } from "tinacms/dist/react"; export const Hero = ({ data }: { data: PageBlocksHero }) => { const headlineColorClasses = { blue: "from-blue-400 to-blue-600", teal: "from-teal-400 to-teal-600", green: "from-green-400 to-green-600", red: "from-red-400 to-red-600", pink: "from-pink-400 to-pink-600", purple: "from-purple-400 to-purple-600", orange: "from-orange-300 to-orange-600", yellow: "from-yellow-400 to-yellow-600", }; return (
{data.tagline && (

{data.tagline}

)} {data.headline && (

{data.headline}

)} {data.text && (
)} {data.actions && ( )}
{data.image && (
{data.image.alt}
)}
); }; export const heroBlockSchema: Template = { name: "hero", label: "Hero", ui: { previewSrc: "/blocks/hero.png", defaultItem: { tagline: "Here's some text above the other text", headline: "This Big Text is Totally Awesome", text: "Phasellus scelerisque, libero eu finibus rutrum, risus risus accumsan libero, nec molestie urna dui a leo.", }, }, fields: [ { type: "string", label: "Tagline", name: "tagline", }, { type: "string", label: "Headline", name: "headline", }, { label: "Text", name: "text", type: "rich-text", }, { label: "Actions", name: "actions", type: "object", list: true, ui: { defaultItem: { label: "Action Label", type: "button", icon: true, link: "/", }, itemProps: (item) => ({ label: item.label }), }, fields: [ { label: "Label", name: "label", type: "string", }, { label: "Type", name: "type", type: "string", options: [ { label: "Button", value: "button" }, { label: "Link", value: "link" }, ], }, { label: "Icon", name: "icon", type: "boolean", }, { label: "Link", name: "link", type: "string", }, ], }, { type: "object", label: "Image", name: "image", fields: [ { name: "src", label: "Image Source", type: "image", }, { name: "alt", label: "Alt Text", type: "string", }, ], }, { type: "string", label: "Color", name: "color", options: [ { label: "Default", value: "default" }, { label: "Tint", value: "tint" }, { label: "Primary", value: "primary" }, ], }, ], };