diff --git a/src/common/components/organisms/Navigation.tsx b/src/common/components/organisms/Navigation.tsx index 93e31de4..be7facc8 100644 --- a/src/common/components/organisms/Navigation.tsx +++ b/src/common/components/organisms/Navigation.tsx @@ -1,4 +1,10 @@ -import React, { useCallback, useEffect, useMemo, useState } from "react"; +import React, { + useCallback, + useEffect, + useMemo, + useState, + useRef, +} from "react"; import { mergeClasses } from "@/common/lib/utils/mergeClasses"; import BrandHeader from "../molecules/BrandHeader"; import Player from "@/common/components/organisms/Player"; @@ -19,12 +25,13 @@ import { AnalyticsEvent, analytics, } from "@/common/providers/AnalyticsProvider"; +import SearchModal from "@/common/components/organisms/SearchModal"; type NavItemProps = { label: string; active?: boolean; Icon: React.FC; - href: string; + href?: string; disable?: boolean; openInNewTab?: boolean; onClick?: () => void; @@ -41,6 +48,7 @@ const Navigation: React.FC = ({ enterEditMode, theme: userTheme, }) => { + const searchRef = useRef(null); const { setModalOpen, getIsLoggedIn, getIsInitializing } = useAppStore( (state) => ({ setModalOpen: state.setup.setModalOpen, @@ -113,6 +121,34 @@ const Navigation: React.FC = ({ ); }; + const NavButton: React.FC = ({ + label, + Icon, + href, + onClick, + disable = false, + openInNewTab = false, + }) => { + return ( +
  • + +
  • + ); + }; + + const openSearchModal = useCallback(() => { + if (!searchRef?.current) return; + searchRef.current.focus(); + }, [searchRef]); + return (