From f6107de73507fe892b02ce621a137e7e0ca4d2cc Mon Sep 17 00:00:00 2001 From: Skydust Date: Mon, 18 Sep 2023 16:58:06 +0200 Subject: [PATCH] Finalized footer --- components/layout/footer/footer.tsx | 153 ++++++++++++++++++++++++---- components/layout/header.tsx | 19 ++-- content/global/index.json | 21 +++- styles/header.scss | 6 ++ tina/tina-lock.json | 2 +- 5 files changed, 165 insertions(+), 36 deletions(-) diff --git a/components/layout/footer/footer.tsx b/components/layout/footer/footer.tsx index ef76553..c15939b 100644 --- a/components/layout/footer/footer.tsx +++ b/components/layout/footer/footer.tsx @@ -3,6 +3,8 @@ import { Container } from "../../util/container"; import { ObjectField } from "@tinacms/schema-tools/dist/types"; import facebookImage from "../../../assets/img/facebook.svg"; import instagramImage from "../../../assets/img/instagram.svg"; +import { tinaField } from "tinacms/dist/react"; +import { TinaMarkdown } from "tinacms/dist/rich-text"; export const Footer = ({ data, rawData }) => { return ( @@ -10,25 +12,58 @@ export const Footer = ({ data, rawData }) => {
-

Contact :
- { /* window.dataLayer.push({ event: "mail-click" });*/ } }> - psychartherapie@gmail.com +

+ + { data?.contact?.label } + +
+
{ /* window.dataLayer.push({ event: "mail-click" });*/ } } + data-tina-field={ tinaField(data?.contact, "mail") }> + { data?.contact?.mail }
- 06 49 23 02 90 + + { data?.contact?.phone } +

-

SIRET 911 883 338 00012
Mentions légales

-
-

© 2023 – Fait avec amour par Nolwenn Meyer

+

+ © { data?.copyright?.year } + { data?.copyright?.subtext?.children?.length > 0 && + <> –

+ +
+ } +

@@ -41,6 +76,90 @@ export const footerSchema: ObjectField = { label: "Footer", name: "footer", fields: [ + { + type: "object", + label: "Contact", + name: "contact", + defaultItem: { + label: "Contact :", + mail: "mail@example.com", + phone: "00 00 00 00 00" + }, + fields: [ + { + type: "string", + label: "Label Contact", + name: "label" + }, + { + type: "string", + label: "Mail", + name: "mail" + }, + { + type: "string", + label: "Téléphone", + name: "phone" + } + ] + }, + { + type: "object", + label: "Legal", + name: "legals", + defaultItem: { + siret: "000 000 000 00000", + link: { + label: "Mentions légales", + url: "/" + } + }, + fields: [ + { + type: "string", + label: "SIRET", + name: "siret" + }, + { + type: "object", + label: "Lien Mentions Légales", + name: "link", + fields: [ + { + type: "string", + label: "Texte", + name: "label" + }, + { + type: "string", + label: "Url", + name: "url" + } + ] + } + ] + }, + { + type: "object", + label: "Copyright", + name: "copyright", + defaultItem: { + year: "0000", + subtext: "El text" + }, + fields: [ + { + type: "string", + label: "Année", + name: "year" + }, + { + type: "rich-text", + label: "Sous-texte", + name: "subtext" + } + ] + }, { type: "object", label: "Social Links", @@ -51,20 +170,10 @@ export const footerSchema: ObjectField = { label: "Facebook", name: "facebook" }, - { - type: "string", - label: "Twitter", - name: "twitter" - }, { type: "string", label: "Instagram", name: "instagram" - }, - { - type: "string", - label: "Github", - name: "github" } ] }] diff --git a/components/layout/header.tsx b/components/layout/header.tsx index d850554..5296d75 100644 --- a/components/layout/header.tsx +++ b/components/layout/header.tsx @@ -6,6 +6,13 @@ import { GlobalHeader } from "../../tina/__generated__/types"; import { ObjectField } from "@tinacms/schema-tools/dist/types"; export const Header = ({ data }: { data: GlobalHeader }) => { + const navbarToggler: JSX.Element = ( + + ); return (
- -