Updated the website
This commit is contained in:
36
components/blocks/carousel.tsx
Normal file
36
components/blocks/carousel.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import * as React from "react";
|
||||
import { Section } from "../util/section";
|
||||
import {PageBlocksCarousel} from "../../tina/__generated__/types";
|
||||
import {Anchoring, anchoringSchema} from "../util/anchoring";
|
||||
import {Template} from "tinacms";
|
||||
|
||||
export const Carousel = ({ data }: { data: PageBlocksCarousel }) => {
|
||||
return (
|
||||
<Section>
|
||||
<div className="carousel flex w-[100%] items-end justify-center" style={ { backgroundImage: `url(${ data?.images?.[0] })` } }>
|
||||
{ data?.link?.enabled && <Anchoring { ...data.link }/> }
|
||||
</div>
|
||||
</Section>);
|
||||
};
|
||||
|
||||
const defaultCarousel = "Here's Another Feature";
|
||||
|
||||
export const carouselBlockSchema: Template = {
|
||||
name: "carousel",
|
||||
label: "Carousel",
|
||||
ui: {
|
||||
previewSrc: "/blocks/features.png",
|
||||
defaultItem: [defaultCarousel, defaultCarousel, defaultCarousel],
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
type: "image",
|
||||
label: "Images du carousel",
|
||||
name: "images",
|
||||
list: true,
|
||||
},
|
||||
{
|
||||
...anchoringSchema
|
||||
}
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user