import { HomeSmall } from "components/Icons/HomeSmall"; import { ActionButton } from "./ActionButton"; import { Sidebar } from "./Sidebar"; import { useIdentityData } from "components/IdentityProvider"; import Link from "next/link"; import { DiscoverSmall } from "components/Icons/DiscoverSmall"; import { PublicationButtons } from "./Publications"; import { Popover } from "components/Popover"; import { MenuSmall } from "components/Icons/MenuSmall"; import { ReaderReadSmall, ReaderUnreadSmall, } from "components/Icons/ReaderSmall"; import { NotificationsReadSmall, NotificationsUnreadSmall, } from "components/Icons/NotificationSmall"; import { SpeedyLink } from "components/SpeedyLink"; import { Separator } from "components/Layout"; export type navPages = | "home" | "reader" | "pub" | "discover" | "notifications" | "looseleafs"; export const DesktopNavigation = (props: { currentPage: navPages; publication?: string; }) => { let { identity } = useIdentityData(); return (
{identity?.atp_did && ( )}
); }; export const MobileNavigation = (props: { currentPage: navPages; publication?: string; }) => { let { identity } = useIdentityData(); return (
e.preventDefault()} asChild className="px-2! !max-w-[256px]" trigger={
} >
{identity?.atp_did && ( <> )}
); }; const NavigationOptions = (props: { currentPage: navPages; publication?: string; isMobile?: boolean; }) => { let { identity } = useIdentityData(); let thisPublication = identity?.publications?.find( (pub) => pub.uri === props.publication, ); return ( <>
); }; const HomeButton = (props: { current?: boolean }) => { return ( } label="Home" className={props.current ? "bg-bg-page! border-border-light!" : ""} /> ); }; const ReaderButton = (props: { current?: boolean; subs: boolean }) => { let readerUnreads = false; if (!props.subs) return; return ( : } label="Reader" className={` ${readerUnreads && "text-accent-contrast!"} ${props.current && "border-accent-contrast!"} `} /> ); }; const DiscoverButton = (props: { current?: boolean }) => { return ( } label="Discover" subtext="" className={props.current ? "bg-bg-page! border-border-light!" : ""} /> ); }; export function NotificationButton(props: { current?: boolean }) { let { identity } = useIdentityData(); let unreads = identity?.notifications[0]?.count; return ( ) : ( ) } label="Notifications" className={`${props.current ? "bg-bg-page! border-border-light!" : ""} ${unreads ? "text-accent-contrast!" : ""}`} /> ); }