Remade the title block to be multi-purpose and added the facebook widget

This commit was merged in pull request #15.
This commit is contained in:
2023-09-19 17:13:02 +02:00
parent d1b2073717
commit 6be84ae480
15 changed files with 783 additions and 160 deletions

View File

@@ -0,0 +1,48 @@
import React from "react";
import { Container } from "../util/container";
import { Section } from "../util/section";
import type { Template } from "tinacms";
import { PageBlockFunction } from "../blocks-renderer";
import { PageBlocksFacebookPageTimeline } from "../../tina/__generated__/types";
export const FacebookPageTimeline: PageBlockFunction<PageBlocksFacebookPageTimeline> = ({ data }) => {
return (
<Section>
<Container
className={ "mt-2 flex justify-center" }
size="custom"
width="large"
>
{ data.page &&
<iframe
src={ `https://www.facebook.com/plugins/page.php?href=${
encodeURIComponent(data.page)
}&tabs=timeline&width=500&height=500&small_header=false&adapt_container_width=true&hide_cover=false&show_facepile=true&appId` }
width="500"
height="500"
style={ { border: "none", overflow: "hidden" } }
scrolling="no"
frameBorder="0"
allowFullScreen={ true }
allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"/> }
</Container>
</Section>
);
};
export const facebookPageTimelineBlockSchema: Template = {
name: "facebookPageTimeline",
label: "Plugin page facebook",
ui: {
defaultItem: {
page: ""
}
},
fields: [
{
type: "string",
label: "URL Page",
name: "page"
}
]
};