Skip to content

Commit

Permalink
Fixed typescript in the menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Mar 6, 2024
1 parent 2dbfb7d commit d32eb9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/components/menu/fallback-main-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Link from "@/components/patterns/elements/drupal-link";
import SearchModal from "@/components/search/search-modal";
import {MenuItem} from "@/lib/gql/__generated__/drupal.d";
import {MenuItem as MenuItemType} from "@/lib/gql/__generated__/drupal.d";

const FallbackMainMenu = ({menuItems}: { menuItems: MenuItem[] }) => {
const FallbackMainMenu = ({menuItems}: { menuItems: MenuItemType[] }) => {
return (
<nav className="centered">
<ul className="m-0 p-0 list-unstyled lg:flex lg:justify-end">
Expand All @@ -18,7 +18,7 @@ const FallbackMainMenu = ({menuItems}: { menuItems: MenuItem[] }) => {
)
}

const MenuItem = ({url, title}: MenuItem) => {
const MenuItem = ({url, title}: MenuItemType) => {
const linkUrl = (url && url.length >= 1) ? url : '#';

return (
Expand Down
6 changes: 3 additions & 3 deletions src/components/menu/main-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import useNavigationEvent from "@/lib/hooks/useNavigationEvent";
import useOutsideClick from "@/lib/hooks/useOutsideClick";
import {usePathname} from "next/navigation";
import {useBoolean} from "usehooks-ts";
import {MenuItem} from "@/lib/gql/__generated__/drupal.d";
import {MenuItem as MenuItemType} from "@/lib/gql/__generated__/drupal.d";

const MainMenu = ({menuItems}: { menuItems: MenuItem[] }) => {
const MainMenu = ({menuItems}: { menuItems: MenuItemType[] }) => {
const {value: menuOpen, setFalse: closeMenu, toggle: toggleMenu} = useBoolean(false);
const {value: addCloseAnimation, setValue: setAddCloseAnimation} = useBoolean(false);

Expand Down Expand Up @@ -107,7 +107,7 @@ const MainMenu = ({menuItems}: { menuItems: MenuItem[] }) => {
}


type MenuItemProps = MenuItem & {
type MenuItemProps = MenuItemType & {
expanded: boolean
tabIndex?: number
activeTrail: string[]
Expand Down

0 comments on commit d32eb9f

Please sign in to comment.