diff --git a/front/app/orgs/[orgslug]/(withmenu)/layout.tsx b/front/app/orgs/[orgslug]/(withmenu)/layout.tsx index a74dcc9c..9a850760 100644 --- a/front/app/orgs/[orgslug]/(withmenu)/layout.tsx +++ b/front/app/orgs/[orgslug]/(withmenu)/layout.tsx @@ -1,5 +1,5 @@ import "@styles/globals.css"; -import { Menu } from "@components/UI/Elements/Menu"; +import { Menu } from "@components/UI/Elements/Menu/Menu"; import AuthProvider from "@components/Security/AuthProvider"; export default function RootLayout({ children, params }: { children: React.ReactNode , params:any}) { diff --git a/front/components/Security/HeaderProfileBox.tsx b/front/components/Security/HeaderProfileBox.tsx index b5fbd628..43015d9e 100644 --- a/front/components/Security/HeaderProfileBox.tsx +++ b/front/components/Security/HeaderProfileBox.tsx @@ -1,3 +1,4 @@ +'use client'; import React from "react"; import styled from "styled-components"; import Link from "next/link"; diff --git a/front/components/UI/Elements/Menu.tsx b/front/components/UI/Elements/Menu.tsx deleted file mode 100644 index e7222930..00000000 --- a/front/components/UI/Elements/Menu.tsx +++ /dev/null @@ -1,129 +0,0 @@ -"use client"; -import React from "react"; -import styled from "styled-components"; -import { HeaderProfileBox } from "../../Security/HeaderProfileBox"; -import learnhouseIcon from "public/learnhouse_icon.png"; -import learnhouseLogo from "public/learnhouse_logo.png"; -import Link from "next/link"; -import Image from "next/image"; -import { getUriWithOrg } from "@services/config/config"; -import ToolTip from "../Tooltip/Tooltip"; - -export const Menu = (props : any ) => { - const orgslug = props.orgslug; - - - return ( - <> -
- - - - - - - - -
-
- - - -

{process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA}

- }>pre-alpha
-
-
- - - - -
- ); -}; - -const GlobalHeader = styled.div` - display: flex; - height: 60px; - background: #ffffff; - box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.03); -`; - -const LogoArea = styled.div` - display: flex; - place-items: stretch; -`; - -const PreAlphaLabel = styled.div` - display: flex; - place-items: center; - border-radius: 6px; - height: 50%; - border: none; - margin-top: 20px; - margin-bottom: 20px; - padding-left: 10px; - padding-right: 10px; - font-size: 12px; - font-weight: bolder; - text-transform: uppercase; -`; - - -const Logo = styled.div` - display: flex; - place-items: center; - padding-left: 20px; - a { - margin: 0; - padding-left: 10px; - padding-top: 2px; - } -`; - -const SearchArea = styled.div` - display: flex; - place-items: stretch; - flex-grow: 2; -`; - -const Search = styled.div` - display: flex; - place-items: center; - padding-left: 20px; - width: auto; -`; - - - -const MenuArea = styled.div` - display: flex; - place-items: stretch; - flex-grow: 1; - - ul { - display: flex; - place-items: center; - list-style: none; - padding-left: 20px; - - li { - padding-right: 20px; - font-size: 16px; - font-weight: 500; - color: #525252; - } - } -`; diff --git a/front/components/UI/Elements/Menu/Menu.tsx b/front/components/UI/Elements/Menu/Menu.tsx new file mode 100644 index 00000000..9d80d1a5 --- /dev/null +++ b/front/components/UI/Elements/Menu/Menu.tsx @@ -0,0 +1,96 @@ + +import React from "react"; +import learnhouseLogo from "public/learnhouse_logo.png"; +import Link from "next/link"; +import Image from "next/image"; +import { getUriWithOrg } from "@services/config/config"; +import { getOrganizationContextInfo } from "@services/organizations/orgs"; +import ClientComponentSkeleton from "@components/UI/Utils/ClientComp"; +import { HeaderProfileBox } from "@components/Security/HeaderProfileBox"; + +export const Menu = async (props: any) => { + const orgslug = props.orgslug; + const org = await getOrganizationContextInfo(orgslug, { revalidate: 1800, tags: ['organizations'] }); + console.log(org); + + return ( + <> +
+
+
+ +
+ + +
+ +
+
+ +
+
+ + + +
+
+ + ); +}; + +const LinkItem = (props: any, orgslug: any) => { + const link = props.link; + return ( + +
  • + {props.type == 'courses' && + <> + + + + Courses + } + + {props.type == 'collections' && + <> + + + + Collections + } + + {props.type == 'trail' && + <> + + + + Trail + } +
  • + + ) +} + + +const LearnHouseLogo = () => { + return ( + + + + + + + + + + + + + + ) + +} \ No newline at end of file diff --git a/front/components/UI/Utils/ClientComp.tsx b/front/components/UI/Utils/ClientComp.tsx new file mode 100644 index 00000000..1b1f74ab --- /dev/null +++ b/front/components/UI/Utils/ClientComp.tsx @@ -0,0 +1,13 @@ +"use client"; + +function ClientComponentSkeleton({ + children, +}: { + children: React.ReactNode +}) { + return ( +
    {children}
    + ) +} + +export default ClientComponentSkeleton \ No newline at end of file