diff --git a/assets/img/logo.png b/assets/img/logo.png deleted file mode 100644 index 8a3f756..0000000 Binary files a/assets/img/logo.png and /dev/null differ diff --git a/components/blocks-renderer.tsx b/components/blocks-renderer.tsx index fa52f9d..ac26ec2 100644 --- a/components/blocks-renderer.tsx +++ b/components/blocks-renderer.tsx @@ -4,6 +4,7 @@ import { Features } from "./blocks/features"; import { Hero } from "./blocks/hero"; import { Testimonial } from "./blocks/testimonial"; import { tinaField } from "tinacms/dist/react"; +import {Carousel} from "./blocks/carousel"; export const Blocks = (props: Omit) => { return ( @@ -31,6 +32,8 @@ const Block = (block: PageBlocks) => { return ; case "PageBlocksTestimonial": return ; + case "PageBlocksCarousel": + return ; default: return null; } diff --git a/components/blocks/anchoring.tsx b/components/blocks/anchoring.tsx deleted file mode 100644 index bd18732..0000000 --- a/components/blocks/anchoring.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import * as React from "react"; -import {useEffect, useRef, useState} from "react"; - -interface AnchoringProps { - text: string, // Default: Découvrez-en plus ! - linkTo: string // Default: #main-page -} - -export const Anchoring = ({ data }: { data: AnchoringProps }) => { - const [opacity, setOpacity] = useState(1); - const anchoringRef = useRef(null); - - const handleScroll = () => { - const scrollTop = window.scrollY || window.pageYOffset; - const elementHeight = anchoringRef.current.clientHeight; - const newOpacity = (elementHeight - scrollTop) / elementHeight; - setOpacity(newOpacity); - }; - - useEffect(() => { - handleScroll(); // Initialize opacity on mount - - window.addEventListener('scroll', handleScroll); - - return () => { - window.removeEventListener('scroll', handleScroll); - }; - }, []); - - const anchoringStyle = { - opacity: opacity, - transition: 'opacity 0.3s', // You can add a transition for a smooth effect - }; - - return ( -
- -
- ); -}; diff --git a/components/blocks/carousel.tsx b/components/blocks/carousel.tsx new file mode 100644 index 0000000..1c5249f --- /dev/null +++ b/components/blocks/carousel.tsx @@ -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 ( +
+
+ { data?.link?.enabled && } +
+
); +}; + +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 + } + ], +}; diff --git a/components/blocks/content.tsx b/components/blocks/content.tsx index e0ccdf4..c52e8f8 100644 --- a/components/blocks/content.tsx +++ b/components/blocks/content.tsx @@ -2,7 +2,7 @@ import React from "react"; import { Container } from "../util/container"; import { Section } from "../util/section"; import { TinaMarkdown } from "tinacms/dist/rich-text"; -import type { TinaTemplate } from "tinacms"; +import type {Template, TinaTemplate} from "tinacms"; import { PageBlocksContent } from "../../tina/__generated__/types"; import { tinaField } from "tinacms/dist/react"; @@ -23,7 +23,7 @@ export const Content = ({ data }: { data: PageBlocksContent }) => { ); }; -export const contentBlockSchema: TinaTemplate = { +export const contentBlockSchema: Template = { name: "content", label: "Content", ui: { diff --git a/components/blocks/features.tsx b/components/blocks/features.tsx index 70c59fa..11a2c01 100644 --- a/components/blocks/features.tsx +++ b/components/blocks/features.tsx @@ -7,6 +7,7 @@ import { PageBlocksFeaturesItems, } from "../../tina/__generated__/types"; import { tinaField } from "tinacms/dist/react"; +import {Template} from "tinacms"; export const Feature = ({ featuresColor, @@ -74,7 +75,7 @@ const defaultFeature = { }, }; -export const featureBlockSchema = { +export const featureBlockSchema: Template = { name: "features", label: "Features", ui: { diff --git a/components/blocks/hero.tsx b/components/blocks/hero.tsx index c99b027..048eaef 100644 --- a/components/blocks/hero.tsx +++ b/components/blocks/hero.tsx @@ -3,7 +3,7 @@ import { Actions } from "../util/actions"; import { Container } from "../util/container"; import { Section } from "../util/section"; import { TinaMarkdown } from "tinacms/dist/rich-text"; -import type { TinaTemplate } from "tinacms"; +import type {Template, TinaTemplate} from "tinacms"; import { PageBlocksHero } from "../../tina/__generated__/types"; import { tinaField } from "tinacms/dist/react"; @@ -85,7 +85,7 @@ export const Hero = ({ data }: { data: PageBlocksHero }) => { ); }; -export const heroBlockSchema: TinaTemplate = { +export const heroBlockSchema: Template = { name: "hero", label: "Hero", ui: { diff --git a/components/blocks/testimonial.tsx b/components/blocks/testimonial.tsx index 4a572c8..5e90aea 100644 --- a/components/blocks/testimonial.tsx +++ b/components/blocks/testimonial.tsx @@ -1,7 +1,7 @@ import React from "react"; import { Container } from "../util/container"; import { Section } from "../util/section"; -import type { TinaTemplate } from "tinacms"; +import type {Template, TinaTemplate} from "tinacms"; import { PageBlocksTestimonial } from "../../tina/__generated__/types"; import { tinaField } from "tinacms/dist/react"; @@ -61,7 +61,7 @@ export const Testimonial = ({ data }: { data: PageBlocksTestimonial }) => { ); }; -export const testimonialBlockSchema: TinaTemplate = { +export const testimonialBlockSchema: Template = { name: "testimonial", label: "Testimonial", ui: { diff --git a/components/layout/footer/footer.tsx b/components/layout/footer/footer.tsx index 480a3a5..7372d09 100644 --- a/components/layout/footer/footer.tsx +++ b/components/layout/footer/footer.tsx @@ -4,9 +4,8 @@ import { FaFacebookF, FaGithub, FaTwitter } from "react-icons/fa"; import { AiFillInstagram } from "react-icons/ai"; import { Container } from "../../util/container"; import { RawRenderer } from "./rawRenderer"; -import { Icon } from "../../util/icon"; -export const Footer = ({ data, icon, rawData }) => { +export const Footer = ({ data, rawData }) => { const socialIconClasses = "h-7 w-auto"; const socialIconColorClasses = { blue: "text-blue-500 dark:text-blue-400 hover:text-blue-300", diff --git a/components/layout/header.tsx b/components/layout/header.tsx index 7e70f6d..fbd4acc 100644 --- a/components/layout/header.tsx +++ b/components/layout/header.tsx @@ -1,20 +1,20 @@ import React from "react"; import Link from "next/link"; import { tinaField } from "tinacms/dist/react"; -import defaultLogo from "../../assets/img/logo.png"; +import defaultLogo from "../../public/logo.png"; import {GlobalHeader} from "../../tina/__generated__/types"; export const Header = ({ data }: { data: GlobalHeader }) => { return (