diff --git a/app/components/navigation/ConditionalHeader/ConditionalHeader.view.tsx b/app/components/navigation/ConditionalHeader/ConditionalHeader.view.tsx index ff36612..80c808e 100644 --- a/app/components/navigation/ConditionalHeader/ConditionalHeader.view.tsx +++ b/app/components/navigation/ConditionalHeader/ConditionalHeader.view.tsx @@ -1,12 +1,8 @@ -import HomeHeader from "../HomeHeader"; -import Header from "../Header"; +import TopNav from "../TopNav"; import type { ConditionalHeaderViewProps } from "./ConditionalHeader.types"; export function ConditionalHeaderView({ isHomePage, }: ConditionalHeaderViewProps) { - if (isHomePage) { - return ; - } - return
; + return ; } diff --git a/app/components/navigation/Header/Header.container.tsx b/app/components/navigation/Header/Header.container.tsx deleted file mode 100644 index 2c99512..0000000 --- a/app/components/navigation/Header/Header.container.tsx +++ /dev/null @@ -1,155 +0,0 @@ -"use client"; - -import { memo } from "react"; -import { usePathname } from "next/navigation"; -import { useTranslation } from "../../../contexts/MessagesContext"; -import MenuBarItem from "../MenuBarItem"; -import Button from "../../buttons/Button"; -import AvatarContainer from "../../utility/AvatarContainer"; -import Avatar from "../../icons/Avatar"; -import Logo from "../../icons/Logo"; -import { getAssetPath, ASSETS } from "../../../../lib/assetUtils"; -import { HeaderView } from "./Header.view"; -import type { HeaderProps, NavSize } from "./Header.types"; - -export const avatarImages = [ - { src: getAssetPath(ASSETS.AVATAR_1), alt: "Avatar 1" }, - { src: getAssetPath(ASSETS.AVATAR_2), alt: "Avatar 2" }, - { src: getAssetPath(ASSETS.AVATAR_3), alt: "Avatar 3" }, -]; - -export const logoConfig = [ - { breakpoint: "block sm:hidden", size: "header" as const, showText: false }, - { - breakpoint: "hidden sm:block md:hidden", - size: "header" as const, - showText: true, - }, - { - breakpoint: "hidden md:block lg:hidden", - size: "headerMd" as const, - showText: true, - }, - { - breakpoint: "hidden lg:block xl:hidden", - size: "headerLg" as const, - showText: true, - }, - { breakpoint: "hidden xl:block", size: "headerXl" as const, showText: true }, -]; - -const HeaderContainer = memo(() => { - const pathname = usePathname(); - const t = useTranslation("header"); - - // Schema markup for site navigation - const schemaData = { - "@context": "https://schema.org", - "@type": "WebSite", - name: "CommunityRule", - url: "https://communityrule.com", - potentialAction: { - "@type": "SearchAction", - target: "https://communityrule.com/search?q={search_term_string}", - "query-input": "required name=search_term_string", - }, - }; - - // Navigation items with translations - const navigationItems = [ - { href: "#", text: t("navigation.useCases"), extraPadding: true }, - { href: "/learn", text: t("navigation.learn") }, - { href: "#", text: t("navigation.about") }, - ]; - - const renderNavigationItems = (size: NavSize) => { - return navigationItems.map((item, index) => ( - - {item.text} - - )); - }; - - const renderAvatarGroup = ( - containerSize: "small" | "medium" | "large" | "xlarge", - avatarSize: "small" | "medium" | "large" | "xlarge", - ) => { - return ( - - {avatarImages.map((avatar, index) => ( - - ))} - - ); - }; - - const renderLoginButton = (size: NavSize) => { - return ( - - {t("buttons.logIn")} - - ); - }; - - const renderCreateRuleButton = ( - buttonSize: "xsmall" | "small" | "medium" | "large" | "xlarge", - containerSize: "small" | "medium" | "large" | "xlarge", - avatarSize: "small" | "medium" | "large" | "xlarge", - ) => { - return ( - - ); - }; - - const renderLogo = ( - size: - | "default" - | "homeHeaderXsmall" - | "homeHeaderSm" - | "homeHeaderMd" - | "homeHeaderLg" - | "homeHeaderXl" - | "header" - | "headerMd" - | "headerLg" - | "headerXl" - | "footer" - | "footerLg", - showText: boolean, - ) => { - return ; - }; - - return ( - - ); -}); - -HeaderContainer.displayName = "Header"; - -export default HeaderContainer; diff --git a/app/components/navigation/Header/Header.view.tsx b/app/components/navigation/Header/Header.view.tsx deleted file mode 100644 index 51d49cb..0000000 --- a/app/components/navigation/Header/Header.view.tsx +++ /dev/null @@ -1,124 +0,0 @@ -"use client"; - -import { useTranslation } from "../../../contexts/MessagesContext"; -import MenuBar from "../MenuBar"; -import type { HeaderViewProps } from "./Header.types"; - -export function HeaderView({ - schemaData, - logoConfig, - renderNavigationItems, - renderLoginButton, - renderCreateRuleButton, - renderLogo, -}: HeaderViewProps) { - const t = useTranslation("header"); - - return ( - <> -