diff --git a/apps/web/src/app/arrangementer/components/AttendanceCard/AttendanceCard.tsx b/apps/web/src/app/arrangementer/components/AttendanceCard/AttendanceCard.tsx index d4ba049792..7c0352a214 100644 --- a/apps/web/src/app/arrangementer/components/AttendanceCard/AttendanceCard.tsx +++ b/apps/web/src/app/arrangementer/components/AttendanceCard/AttendanceCard.tsx @@ -56,7 +56,7 @@ export const AttendanceCard = ({ const { setTRPCSSERegisterChangeConnectionState } = useTRPCSSERegisterChangeConnectionState() const fullPathname = useFullPathname() - const authorizeUrl = createAuthorizeUrl({ connection: "FEIDE", redirectAfter: fullPathname }) + const authorizeUrl = createAuthorizeUrl({ redirectAfter: fullPathname }) const [closeToEvent, setCloseToEvent] = useState(false) const [attendanceStatus, setAttendanceStatus] = useState(getAttendanceStatus(initialAttendance)) diff --git a/apps/web/src/components/Navbar/MobileNavigation.tsx b/apps/web/src/components/Navbar/MobileNavigation.tsx index 3a35677307..bea56a5749 100644 --- a/apps/web/src/components/Navbar/MobileNavigation.tsx +++ b/apps/web/src/components/Navbar/MobileNavigation.tsx @@ -1,9 +1,6 @@ "use client" -import { useFullPathname } from "@/utils/use-full-pathname" -import { useSession } from "@dotkomonline/oauth2/react" import { - Button, Collapsible, CollapsibleContent, CollapsibleTrigger, @@ -15,13 +12,12 @@ import { cn, } from "@dotkomonline/ui" import * as ScrollArea from "@radix-ui/react-scroll-area" -import { IconArrowUpRight, IconChevronDown, IconHome, IconLogin2 } from "@tabler/icons-react" +import { IconArrowUpRight, IconChevronDown, IconHome } from "@tabler/icons-react" import Link from "next/link" import { type FC, useEffect, useRef, useState } from "react" import type { MenuItem, MenuLink } from "@/components/Navbar/Navbar" import { env } from "@/env" -import { createAuthorizeUrl } from "@dotkomonline/utils" import { isExternal } from "../../utils/is-link-external" import { Hamburger } from "./Hamburger" import { MobileMenuCard } from "./MobileMenuCard" @@ -29,8 +25,6 @@ import { MobileMenuCard } from "./MobileMenuCard" export const MobileNavigation: FC<{ links: MenuLink[] }> = ({ links }) => { const [open, setOpen] = useState(false) const navRef = useRef(null) - const session = useSession() - const fullPathname = useFullPathname() const homeLink: MenuLink = { title: "Hjem", @@ -181,35 +175,6 @@ export const MobileNavigation: FC<{ links: MenuLink[] }> = ({ links }) => { ) )} - - {session === null && ( -
- - - - -
- )} diff --git a/apps/web/src/components/Navbar/Navbar.tsx b/apps/web/src/components/Navbar/Navbar.tsx index 9878c7dfee..2dd9e347fa 100644 --- a/apps/web/src/components/Navbar/Navbar.tsx +++ b/apps/web/src/components/Navbar/Navbar.tsx @@ -2,7 +2,7 @@ import { OnlineIcon } from "@/components/atoms/OnlineIcon" import { env } from "@/env" -import { type Icon, IconBuildingBank, IconCrown } from "@tabler/icons-react" +import { type Icon, IconBuildingBank, IconCrown, IconLogin2 } from "@tabler/icons-react" import { IconArticle, IconBolt, @@ -20,6 +20,10 @@ import type { FC } from "react" import { MainNavigation } from "./MainNavigation" import { MobileNavigation } from "./MobileNavigation" import { ProfileMenu } from "./ProfileMenu" +import { useSession } from "@dotkomonline/oauth2/react" +import { useFullPathname } from "@/utils/use-full-pathname" +import { Button, cn } from "@dotkomonline/ui" +import { createAuthorizeUrl } from "@dotkomonline/utils" export type MenuItem = { title: string @@ -141,18 +145,48 @@ const links: MenuLink[] = [ ] export const Navbar: FC = () => { + const fullPathname = useFullPathname() + const session = useSession() + + const isLoggedIn = session !== null + return ( -
- - - +
+
+ + + - + -
- - +
+ + +
+ + {!isLoggedIn && ( +
+ +
+ )}
) } diff --git a/apps/web/src/components/Navbar/ProfileMenu.tsx b/apps/web/src/components/Navbar/ProfileMenu.tsx index b01acc9ba3..1b282b9a41 100644 --- a/apps/web/src/components/Navbar/ProfileMenu.tsx +++ b/apps/web/src/components/Navbar/ProfileMenu.tsx @@ -19,15 +19,13 @@ import { Text, Title, } from "@dotkomonline/ui" -import { createAuthorizeUrl, createLogoutUrl } from "@dotkomonline/utils" +import { createLogoutUrl } from "@dotkomonline/utils" import type { Icon } from "@tabler/icons-react" import { IconAdjustments, IconArrowUpRight, IconBug, - IconDotsVertical, IconLock, - IconLogin2, IconLogout2, IconMailForward, IconMessageReport, @@ -131,51 +129,9 @@ const ContactDebugDropdown: FC = () => ( ) -const LoginAlternativesDropdown: FC = () => { - const fullPathname = useFullPathname() - - return ( - - - - - - - Logg inn uten Feide - - - - ) -} - const UnauthenticatedActions: FC = () => { - const fullPathname = useFullPathname() return (
-
- -
- -
-