Something went wrong. Try again.
a tool for shared writing and social publishing
Something went wrong. Try again.
2.1 kB · 74 lines
TSX
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475import { useIdentityData } from "components/IdentityProvider";import { Separator } from "components/Layout";import { navPages, NotificationButton, ReaderButton, WriterButton,} from "./NavigationButtons";import { PublicationNavigation } from "./PublicationNavigation";import { LoginModal } from "components/LoginButton";import { ProfileButton } from "./ProfileButton";import { ActionButton } from "./ActionButton";import { AccountSmall } from "components/Icons/AccountSmall";
export const MobileNavigation = (props: { currentPage: navPages; currentPublicationUri?: string; currentProfileDid?: string;}) => { let { identity } = useIdentityData();
let compactOnMobile = props.currentPage === "home" || props.currentPage === "looseleafs" || props.currentPage === "pub";
return ( <div className={`mobileFooter w-full flex gap-4 px-1 text-secondary grow items-center justify-between`} > <div className="mobileNav flex gap-2 items-center justify-start min-w-0"> <ReaderButton compactOnMobile={compactOnMobile} current={props.currentPage === "reader"} subs={ identity?.publication_subscriptions?.length !== 0 && identity?.publication_subscriptions?.length !== undefined } /> <WriterButton compactOnMobile={compactOnMobile} currentPage={props.currentPage} currentPubUri={props.currentPublicationUri} />
{compactOnMobile && ( <> <PublicationNavigation currentPage={props.currentPage} currentPubUri={props.currentPublicationUri} /> </> )} </div> {identity ? ( <div className="flex gap-2"> {identity.atp_did && <NotificationButton />} <ProfileButton /> </div> ) : ( <LoginModal asChild trigger={ <ActionButton secondary icon={<AccountSmall />} label="Log In/Sign Up" /> } /> )} </div> );};