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
29
pulls
pipelines
wired up post options to update record
cozylittle.house
2 months ago
f1e6c961
a02b9930
+34
-22
2 changed files
expand all
collapse all
unified
split
app
lish
[did]
[publication]
dashboard
settings
PostOptions.tsx
lexicons
src
publication.ts
+33
-21
app/lish/[did]/[publication]/dashboard/settings/PostOptions.tsx
···
22
22
? true
23
23
: record.preferences.showComments,
24
24
);
25
25
-
let [showMentions, setShowMentions] = useState(true);
26
26
-
let [showPrevNext, setShowPrevNext] = useState(true);
25
25
+
let [showMentions, setShowMentions] = useState(
26
26
+
record?.preferences?.showMentions === undefined
27
27
+
? true
28
28
+
: record.preferences.showMentions,
29
29
+
);
30
30
+
let [showPrevNext, setShowPrevNext] = useState(
31
31
+
record?.preferences?.showPrevNext === undefined
32
32
+
? true
33
33
+
: record.preferences.showPrevNext,
34
34
+
);
27
35
28
36
let toast = useToaster();
29
37
return (
30
38
<form
31
39
onSubmit={async (e) => {
32
32
-
// if (!pubData) return;
33
33
-
// e.preventDefault();
34
34
-
// props.setLoading(true);
35
35
-
// let data = await updatePublication({
36
36
-
// name: record.name,
37
37
-
// uri: pubData.uri,
38
38
-
// preferences: {
39
39
-
// showInDiscover:
40
40
-
// record?.preferences?.showInDiscover === undefined
41
41
-
// ? true
42
42
-
// : record.preferences.showInDiscover,
43
43
-
// showComments: showComments,
44
44
-
// },
45
45
-
// });
46
46
-
// toast({ type: "success", content: "Posts Updated!" });
47
47
-
// props.setLoading(false);
48
48
-
// mutate("publication-data");
40
40
+
if (!pubData) return;
41
41
+
e.preventDefault();
42
42
+
props.setLoading(true);
43
43
+
let data = await updatePublication({
44
44
+
name: record.name,
45
45
+
uri: pubData.uri,
46
46
+
preferences: {
47
47
+
showInDiscover:
48
48
+
record?.preferences?.showInDiscover === undefined
49
49
+
? true
50
50
+
: record.preferences.showInDiscover,
51
51
+
showComments: showComments,
52
52
+
showMentions: showMentions,
53
53
+
showPrevNext: showPrevNext,
54
54
+
},
55
55
+
});
56
56
+
toast({ type: "success", content: "Posts Updated!" });
57
57
+
props.setLoading(false);
58
58
+
mutate("publication-data");
49
59
}}
50
60
className="text-primary flex flex-col"
51
61
>
···
67
77
<div className="flex flex-col justify-start">
68
78
<div className="font-bold">Show Prev/Next Buttons</div>
69
79
<div className="text-tertiary text-sm leading-tight">
70
70
-
Show buttons that navigate to the previous and next posts
80
80
+
Buttons at the bottom of each post navigate to the previous and next
81
81
+
posts
71
82
</div>
72
83
</div>
73
84
</Toggle>
···
92
103
<div className="flex flex-col justify-start">
93
104
<div className="font-bold">Show Mentions</div>
94
105
<div className="text-tertiary text-sm leading-tight">
95
95
-
Display a list of posts on Bluesky that mention your post
106
106
+
Display a list of posts on Bluesky and Leaflet that mention your
107
107
+
post
96
108
</div>
97
109
</div>
98
110
</Toggle>
+1
-1
lexicons/src/publication.ts
···
28
28
showInDiscover: { type: "boolean", default: true },
29
29
showComments: { type: "boolean", default: true },
30
30
showMentions: { type: "boolean", default: true },
31
31
-
showPrevNext: { type: "boolean", default: true },
31
31
+
showPrevNext: { type: "boolean", default: false },
32
32
},
33
33
},
34
34
theme: {