tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
28
pulls
pipelines
moved discover from reader header to nav sidebar
cozylittle.house
5 months ago
9c9192e2
1e3927ae
+23
-17
2 changed files
expand all
collapse all
unified
split
actions
getIdentityData.ts
components
ActionBar
Navigation.tsx
+1
-1
actions/getIdentityData.ts
···
16
16
identities(
17
17
*,
18
18
bsky_profiles(*),
19
19
-
subscribers_to_publications(*),
19
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
21
-
let unreadNotifications = true;
22
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
91
+
console.log(identity);
93
92
return (
94
93
<>
95
94
<HomeButton current={props.currentPage === "home"} />
96
96
-
<ReaderButton current={props.currentPage === "discover"} />
95
95
+
<ReaderButton
96
96
+
current={props.currentPage === "reader"}
97
97
+
subs={identity?.publication_subscriptions?.length !== 0}
98
98
+
/>
99
99
+
<DiscoverButton current={props.currentPage === "discover"} />
100
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
116
-
const ReaderButton = (props: { current?: boolean }) => {
120
120
+
const ReaderButton = (props: { current?: boolean; subs: boolean }) => {
117
121
let readerUnreads = true;
118
118
-
let subs = true;
119
122
120
120
-
if (subs)
121
121
-
return (
122
122
-
<Link href={"/reader"} className="hover:no-underline!">
123
123
-
<ActionButton
124
124
-
nav
125
125
-
icon={readerUnreads ? <ReaderUnreadSmall /> : <ReaderReadSmall />}
126
126
-
label="Reader"
127
127
-
className={`
123
123
+
if (!props.subs) return;
124
124
+
return (
125
125
+
<Link href={"/reader"} className="hover:no-underline!">
126
126
+
<ActionButton
127
127
+
nav
128
128
+
icon={readerUnreads ? <ReaderUnreadSmall /> : <ReaderReadSmall />}
129
129
+
label="Reader"
130
130
+
className={`
128
131
${readerUnreads ? "text-accent-contrast! border-accent-contrast" : props.current ? "bg-border-light! border-border" : ""}
129
132
`}
130
130
-
/>
131
131
-
</Link>
132
132
-
);
133
133
+
/>
134
134
+
</Link>
135
135
+
);
136
136
+
};
137
137
+
138
138
+
const DiscoverButton = (props: { current?: boolean }) => {
133
139
return (
134
140
<Link href={"/discover"} className="hover:no-underline!">
135
141
<ActionButton