diff --git a/src/MainNavigation/MegaMenu.tsx b/src/MainNavigation/MegaMenu.tsx index e82353151..5ccd80d8c 100644 --- a/src/MainNavigation/MegaMenu.tsx +++ b/src/MainNavigation/MegaMenu.tsx @@ -26,16 +26,24 @@ export namespace MegaMenuProps { }; export type Category = { - categoryMainLink: { - text: ReactNode; - linkProps: RegisteredLinkProps; - }; links: { text: ReactNode; linkProps: RegisteredLinkProps; isActive?: boolean; }[]; - }; + } & ( + | { + categoryMainLink: { + text: ReactNode; + linkProps: RegisteredLinkProps; + }; + categoryMainText?: never; + } + | { + categoryMainText: ReactNode; + categoryMainLink?: never; + } + ); } export const MegaMenu = memo( @@ -101,30 +109,42 @@ export const MegaMenu = memo( )} - {categories.map(({ categoryMainLink, links }, i) => ( + {categories.map(({ categoryMainLink, categoryMainText, links }, i) => (
-
- - {categoryMainLink.text} - -
+ + {categoryMainLink.text} + + + )} + {categoryMainText !== undefined && ( +
+ {categoryMainText} +
+ )}