From 0a30c03b5eba80e85e1db2ea345967f98d8fccac Mon Sep 17 00:00:00 2001 From: Ben Life Date: Fri, 20 Dec 2024 16:51:04 -0500 Subject: [PATCH 1/4] move header to ve lib --- src/components/Header.tsx | 55 --------------------------------------- src/ve.config.tsx | 15 ++++++----- theme.config.ts | 24 +++++++++++++++++ 3 files changed, 33 insertions(+), 61 deletions(-) delete mode 100644 src/components/Header.tsx diff --git a/src/components/Header.tsx b/src/components/Header.tsx deleted file mode 100644 index 0ae251d6..00000000 --- a/src/components/Header.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import { Link, CTA } from "@yext/pages-components"; -import logo from "../assets/logo.png"; -import "./index.css"; - -const navigation: CTA[] = [ - { link: "#", label: "Restaurants" }, - { link: "#", label: "Blog" }, - { link: "#", label: "Support" }, -]; - -type HeaderProps = { - isEditing: boolean; -}; - -const Header = (props: HeaderProps) => { - const { isEditing } = props; - return ; -}; - -type HeaderLayoutProps = { - isEditing: boolean; - links: CTA[]; - logo?: string; - logoLink?: string; -}; - -const HeaderLayout = (props: HeaderLayoutProps) => { - const { logo, isEditing } = props; - - return ( -
-
- {logo && } -
-
    - {props.links.map((item: CTA, idx) => ( -
  • - -
  • - ))} -
-
-
-
- ); -}; - -export { Header }; diff --git a/src/ve.config.tsx b/src/ve.config.tsx index 68549127..09d8f68f 100644 --- a/src/ve.config.tsx +++ b/src/ve.config.tsx @@ -1,4 +1,4 @@ -import type { Config } from "@measured/puck"; +import { DropZone, type Config } from "@measured/puck"; import "@yext/visual-editor/style.css"; import { Address, @@ -27,6 +27,8 @@ import { PhoneProps, TextList, TextListProps, + Header, + HeaderProps, } from "@yext/visual-editor"; import { BannerComponent as Banner, BannerProps } from "./components/Banner"; import { CardComponent as Card, CardProps } from "./components/Card"; @@ -35,7 +37,6 @@ import { FeaturedItemsComponent as FeaturedItems, FeaturedItemsProps, } from "./components/FeaturedItems"; -import { Header } from "./components/Header.js"; import { Footer } from "./components/Footer.js"; type LocationProps = { @@ -56,11 +57,13 @@ type LocationProps = { Card: CardProps; FAQ: FAQProps; FeaturedItems: FeaturedItemsProps; + Header: HeaderProps; }; // All the available components for locations export const locationConfig: Config = { components: { + Header, Address, BodyText, CTA, @@ -80,16 +83,16 @@ export const locationConfig: Config = { FeaturedItems, }, root: { - render: ({ children, puck: { isEditing } }) => { + render: ({ puck: { isEditing } }) => { return ( <> -
- {children} + + + {/* */}