From 6d08dcfb68c44bb51f23a53a946b8cf25809dca5 Mon Sep 17 00:00:00 2001 From: Guilherme Baufaker Date: Wed, 27 Mar 2024 19:35:27 -0300 Subject: [PATCH] styled footer --- components/footer/Footer.tsx | 361 ++--------------------------------- 1 file changed, 18 insertions(+), 343 deletions(-) diff --git a/components/footer/Footer.tsx b/components/footer/Footer.tsx index 5b8e13f..6fdbd48 100644 --- a/components/footer/Footer.tsx +++ b/components/footer/Footer.tsx @@ -1,359 +1,34 @@ -import BackToTop from "../../components/footer/BackToTop.tsx"; -import Divider from "../../components/footer/Divider.tsx"; -import ExtraLinks from "../../components/footer/ExtraLinks.tsx"; -import FooterItems from "../../components/footer/FooterItems.tsx"; -import Logo from "../../components/footer/Logo.tsx"; -import MobileApps from "../../components/footer/MobileApps.tsx"; -import PaymentMethods from "../../components/footer/PaymentMethods.tsx"; -import RegionSelector from "../../components/footer/RegionSelector.tsx"; -import Social from "../../components/footer/Social.tsx"; -import Newsletter from "../../islands/Newsletter.tsx"; -import { clx } from "../../sdk/clx.ts"; import type { ImageWidget } from "apps/admin/widgets.ts"; -import PoweredByDeco from "apps/website/components/PoweredByDeco.tsx"; - -export type Item = { - label: string; - href: string; -}; - -export type Section = { - label: string; - items: Item[]; -}; - -export interface SocialItem { - label: - | "Discord" - | "Facebook" - | "Instagram" - | "Linkedin" - | "Tiktok" - | "Twitter"; - link: string; -} - -export interface PaymentItem { - label: "Diners" | "Elo" | "Mastercard" | "Pix" | "Visa"; -} - -export interface MobileApps { - /** @description Link to the app */ - apple?: string; - /** @description Link to the app */ - android?: string; -} - -export interface RegionOptions { - currency?: Item[]; - language?: Item[]; -} - -export interface NewsletterForm { - placeholder?: string; - buttonText?: string; - /** @format html */ - helpText?: string; -} - -export interface Layout { - backgroundColor?: - | "Primary" - | "Secondary" - | "Accent" - | "Base 100" - | "Base 100 inverted"; - variation?: - | "Variation 1" - | "Variation 2" - | "Variation 3" - | "Variation 4" - | "Variation 5"; - hide?: { - logo?: boolean; - newsletter?: boolean; - sectionLinks?: boolean; - socialLinks?: boolean; - paymentMethods?: boolean; - mobileApps?: boolean; - regionOptions?: boolean; - extraLinks?: boolean; - backToTheTop?: boolean; - }; -} +import Image from "apps/website/components/Image.tsx"; export interface Props { logo?: { image: ImageWidget; - description?: string; - }; - newsletter?: { - title?: string; - /** @format textarea */ - description?: string; - form?: NewsletterForm; - }; - sections?: Section[]; - social?: { - title?: string; - items: SocialItem[]; - }; - payments?: { - title?: string; - items: PaymentItem[]; + alt: string; + height: number; + width: number; }; - mobileApps?: MobileApps; - regionOptions?: RegionOptions; - extraLinks?: Item[]; - backToTheTop?: { - text?: string; - }; - layout?: Layout; + text: string; } -const LAYOUT = { - "Primary": "bg-primary text-primary-content", - "Secondary": "bg-secondary text-secondary-content", - "Accent": "bg-accent text-accent-content", - "Base 100": "bg-base-100 text-base-content", - "Base 100 inverted": "bg-base-content text-base-100", -}; - function Footer({ logo, - newsletter = { - title: "Newsletter", - description: "", - form: { placeholder: "", buttonText: "", helpText: "" }, - }, - sections = [{ - "label": "Sobre", - "items": [ - { - "href": "/quem-somos", - "label": "Quem somos", - }, - { - "href": "/termos-de-uso", - "label": "Termos de uso", - }, - { - "href": "/trabalhe-conosco", - "label": "Trabalhe conosco", - }, - ], - }, { - "label": "Atendimento", - "items": [ - { - "href": "/centraldeatendimento", - "label": "Central de atendimento", - }, - { - "href": "/whatsapp", - "label": "Fale conosco pelo WhatsApp", - }, - { - "href": "/trocaedevolucao", - "label": "Troca e devolução", - }, - ], - }], - social = { - title: "Redes sociais", - items: [{ label: "Instagram", link: "/" }, { label: "Tiktok", link: "/" }], - }, - payments = { - title: "Formas de pagamento", - items: [{ label: "Mastercard" }, { label: "Visa" }, { label: "Pix" }], - }, - mobileApps = { apple: "/", android: "/" }, - regionOptions = { currency: [], language: [] }, - extraLinks = [], - backToTheTop, - layout = { - backgroundColor: "Primary", - variation: "Variation 1", - hide: { - logo: false, - newsletter: false, - sectionLinks: false, - socialLinks: false, - paymentMethods: false, - mobileApps: false, - regionOptions: false, - extraLinks: false, - backToTheTop: false, - }, - }, + text, }: Props) { - const _logo = layout?.hide?.logo ? <> : ; - const _newsletter = layout?.hide?.newsletter ? <> : ( - - ); - const _sectionLinks = layout?.hide?.sectionLinks ? <> : ( - - ); - const _social = layout?.hide?.socialLinks - ? <> - : ; - const _payments = layout?.hide?.paymentMethods - ? <> - : ; - const _apps = layout?.hide?.mobileApps - ? <> - : ; - const _region = layout?.hide?.regionOptions - ? <> - : ; - const _links = layout?.hide?.extraLinks - ? <> - : ; - return ( -