a tool for shared writing and social publishing
at update/reader 61 lines 1.7 kB view raw
1import { useIdentityData } from "components/IdentityProvider"; 2import { Separator } from "components/Layout"; 3import { 4 navPages, 5 NotificationButton, 6 ReaderButton, 7 WriterButton, 8} from "./NavigationButtons"; 9import { PublicationNavigation } from "./PublicationNavigation"; 10import { LoginActionButton } from "components/LoginButton"; 11 12export const MobileNavigation = (props: { 13 currentPage: navPages; 14 currentPublicationUri?: string; 15 currentProfileDid?: string; 16}) => { 17 let { identity } = useIdentityData(); 18 19 let compactOnMobile = 20 props.currentPage === "home" || 21 props.currentPage === "looseleafs" || 22 props.currentPage === "pub"; 23 24 return ( 25 <div 26 className={`mobileFooter w-full flex gap-4 px-1 text-secondary grow items-center justify-between`} 27 > 28 <div className="mobileNav flex gap-2 items-center justify-start min-w-0"> 29 <ReaderButton 30 compactOnMobile={compactOnMobile} 31 current={props.currentPage === "reader"} 32 subs={ 33 identity?.publication_subscriptions?.length !== 0 && 34 identity?.publication_subscriptions?.length !== undefined 35 } 36 /> 37 <WriterButton 38 compactOnMobile={compactOnMobile} 39 currentPage={props.currentPage} 40 currentPubUri={props.currentPublicationUri} 41 /> 42 43 {compactOnMobile && ( 44 <> 45 <PublicationNavigation 46 currentPage={props.currentPage} 47 currentPubUri={props.currentPublicationUri} 48 /> 49 </> 50 )} 51 </div> 52 {identity?.atp_did ? ( 53 <> 54 <NotificationButton /> 55 </> 56 ) : ( 57 <LoginActionButton /> 58 )} 59 </div> 60 ); 61};