a tool for shared writing and social publishing

moved discover from reader header to nav sidebar

+23 -17
+1 -1
actions/getIdentityData.ts
··· 16 16 identities( 17 17 *, 18 18 bsky_profiles(*), 19 - subscribers_to_publications(*), 19 + publication_subscriptions(*), 20 20 custom_domains!custom_domains_identity_id_fkey(publication_domains(*), *), 21 21 home_leaflet:permission_tokens!identities_home_page_fkey(*, permission_token_rights(*)), 22 22 permission_token_on_homepage(
+22 -16
components/ActionBar/Navigation.tsx
··· 18 18 currentPage: navPages; 19 19 publication?: string; 20 20 }) => { 21 - let unreadNotifications = true; 22 - 23 21 return ( 24 22 <div className="flex flex-col gap-4"> 25 23 <Sidebar alwaysOpen> ··· 90 88 let thisPublication = identity?.publications?.find( 91 89 (pub) => pub.uri === props.publication, 92 90 ); 91 + console.log(identity); 93 92 return ( 94 93 <> 95 94 <HomeButton current={props.currentPage === "home"} /> 96 - <ReaderButton current={props.currentPage === "discover"} /> 95 + <ReaderButton 96 + current={props.currentPage === "reader"} 97 + subs={identity?.publication_subscriptions?.length !== 0} 98 + /> 99 + <DiscoverButton current={props.currentPage === "discover"} /> 100 + 97 101 <hr className="border-border-light my-1" /> 98 102 <PublicationButtons currentPubUri={thisPublication?.uri} /> 99 103 </> ··· 113 117 ); 114 118 }; 115 119 116 - const ReaderButton = (props: { current?: boolean }) => { 120 + const ReaderButton = (props: { current?: boolean; subs: boolean }) => { 117 121 let readerUnreads = true; 118 - let subs = true; 119 122 120 - if (subs) 121 - return ( 122 - <Link href={"/reader"} className="hover:no-underline!"> 123 - <ActionButton 124 - nav 125 - icon={readerUnreads ? <ReaderUnreadSmall /> : <ReaderReadSmall />} 126 - label="Reader" 127 - className={` 123 + if (!props.subs) return; 124 + return ( 125 + <Link href={"/reader"} className="hover:no-underline!"> 126 + <ActionButton 127 + nav 128 + icon={readerUnreads ? <ReaderUnreadSmall /> : <ReaderReadSmall />} 129 + label="Reader" 130 + className={` 128 131 ${readerUnreads ? "text-accent-contrast! border-accent-contrast" : props.current ? "bg-border-light! border-border" : ""} 129 132 `} 130 - /> 131 - </Link> 132 - ); 133 + /> 134 + </Link> 135 + ); 136 + }; 137 + 138 + const DiscoverButton = (props: { current?: boolean }) => { 133 139 return ( 134 140 <Link href={"/discover"} className="hover:no-underline!"> 135 141 <ActionButton