import React from "react"; import { Container } from "../util/container"; import { Section } from "../util/section"; import type { Template } from "tinacms"; import { PageBlocksTitle } from "../../tina/__generated__/types"; import { tinaField } from "tinacms/dist/react"; import { PageBlockFunction } from "../blocks-renderer"; enum titleSize { h1 = "h1", h2 = "h2", h3 = "h3", h4 = "h4" } export const Title: PageBlockFunction = ({ data }) => { return (
{ data.title }
); }; export const titleBlockSchema: Template = { name: "title", label: "Titre", ui: { previewSrc: "/blocks/content.png", defaultItem: { size: Object.values(titleSize)[0], title: "Lorem ipsum" } }, fields: [ { type: "string", label: "Taille", name: "size", options: Object.values(titleSize) }, { type: "string", label: "Texte", name: "title" } ] };