diff --git a/front/components/Objects/Menu/Menu.tsx b/front/components/Objects/Menu/Menu.tsx index 78478a8d..98a7b41f 100644 --- a/front/components/Objects/Menu/Menu.tsx +++ b/front/components/Objects/Menu/Menu.tsx @@ -1,16 +1,18 @@ - +'use client'; import React from "react"; +import useSWR from "swr"; import Link from "next/link"; -import { getBackendUrl, getUriWithOrg } from "@services/config/config"; +import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config/config"; import { getOrganizationContextInfo } from "@services/organizations/orgs"; import ClientComponentSkeleton from "@components/Utils/ClientComp"; import { HeaderProfileBox } from "@components/Security/HeaderProfileBox"; +import { swrFetcher } from "@services/utils/ts/requests"; +import MenuLinks from "./MenuLinks"; export const Menu = async (props: any) => { const orgslug = props.orgslug; const org = await getOrganizationContextInfo(orgslug, { revalidate: 1800, tags: ['organizations'] }); - return ( <>
@@ -32,11 +34,10 @@ export const Menu = async (props: any) => {
- + + + +
@@ -48,39 +49,7 @@ export const Menu = async (props: any) => { ); }; -const LinkItem = (props: any) => { - const link = props.link; - const orgslug = props.orgslug; - return ( - -
  • - {props.type == 'courses' && - <> - - - - Courses - } - {props.type == 'collections' && - <> - - - - Collections - } - - {props.type == 'trail' && - <> - - - - Trail - } -
  • - - ) -} const LearnHouseLogo = () => { diff --git a/front/components/Objects/Menu/MenuLinks.tsx b/front/components/Objects/Menu/MenuLinks.tsx new file mode 100644 index 00000000..c5576d96 --- /dev/null +++ b/front/components/Objects/Menu/MenuLinks.tsx @@ -0,0 +1,52 @@ +import AuthenticatedClientElement from '@components/Security/AuthenticatedClientElement'; +import { getUriWithOrg } from '@services/config/config'; +import Link from 'next/link'; +import React from 'react' + +function MenuLinks(props: { orgslug: string }) { + return ( +
    +
      + + + + + +
    +
    + ) +} +const LinkItem = (props: any) => { + const link = props.link; + const orgslug = props.orgslug; + return ( + +
  • + {props.type == 'courses' && + <> + + + + Courses + } + + {props.type == 'collections' && + <> + + + + Collections + } + + {props.type == 'trail' && + <> + + + + Trail + } +
  • + + ) +} +export default MenuLinks \ No newline at end of file