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
added new preferences to props everywhere
cozylittle.house
2 months ago
74ba8bf0
f1e6c961
+35
-5
4 changed files
expand all
collapse all
unified
split
app
lish
[did]
[publication]
[rkey]
CanvasPage.tsx
PostPages.tsx
createPub
CreatePubForm.tsx
UpdatePubForm.tsx
+5
-1
app/lish/[did]/[publication]/[rkey]/CanvasPage.tsx
···
202
202
isSubpage: boolean | undefined;
203
203
data: PostPageData;
204
204
profile: ProfileViewDetailed;
205
205
-
preferences: { showComments?: boolean };
205
205
+
preferences: {
206
206
+
showComments?: boolean;
207
207
+
showMentions?: boolean;
208
208
+
showPrevNext?: boolean;
209
209
+
};
206
210
quotesCount: number | undefined;
207
211
commentsCount: number | undefined;
208
212
}) => {
+10
-2
app/lish/[did]/[publication]/[rkey]/PostPages.tsx
···
147
147
document: PostPageData;
148
148
did: string;
149
149
profile: ProfileViewDetailed;
150
150
-
preferences: { showComments?: boolean };
150
150
+
preferences: {
151
151
+
showComments?: boolean;
152
152
+
showMentions?: boolean;
153
153
+
showPrevNext?: boolean;
154
154
+
};
151
155
pubRecord?: PubLeafletPublication.Record;
152
156
theme?: PubLeafletPublication.Theme | null;
153
157
prerenderedCodeBlocks?: Map<string, string>;
···
206
210
did: string;
207
211
prerenderedCodeBlocks?: Map<string, string>;
208
212
bskyPostData: AppBskyFeedDefs.PostView[];
209
209
-
preferences: { showComments?: boolean };
213
213
+
preferences: {
214
214
+
showComments?: boolean;
215
215
+
showMentions?: boolean;
216
216
+
showPrevNext?: boolean;
217
217
+
};
210
218
pollData: PollData[];
211
219
}) {
212
220
let drawer = useDrawerOpen(document_uri);
+9
-2
app/lish/createPub/CreatePubForm.tsx
···
53
53
description: descriptionValue,
54
54
iconFile: logoFile,
55
55
subdomain: domainValue,
56
56
-
preferences: { showInDiscover, showComments: true },
56
56
+
preferences: {
57
57
+
showInDiscover,
58
58
+
showComments: true,
59
59
+
showMentions: true,
60
60
+
showPrevNext: false,
61
61
+
},
57
62
});
58
63
59
64
if (!result.success) {
···
68
73
setTimeout(() => {
69
74
setFormState("normal");
70
75
if (result.publication)
71
71
-
router.push(`${getBasePublicationURL(result.publication)}/dashboard`);
76
76
+
router.push(
77
77
+
`${getBasePublicationURL(result.publication)}/dashboard`,
78
78
+
);
72
79
}, 500);
73
80
}}
74
81
>
+11
app/lish/createPub/UpdatePubForm.tsx
···
43
43
? true
44
44
: record.preferences.showComments,
45
45
);
46
46
+
let showMentions =
47
47
+
record?.preferences?.showMentions === undefined
48
48
+
? true
49
49
+
: record.preferences.showMentions;
50
50
+
let showPrevNext =
51
51
+
record?.preferences?.showPrevNext === undefined
52
52
+
? true
53
53
+
: record.preferences.showPrevNext;
54
54
+
46
55
let [descriptionValue, setDescriptionValue] = useState(
47
56
record?.description || "",
48
57
);
···
74
83
preferences: {
75
84
showInDiscover: showInDiscover,
76
85
showComments: showComments,
86
86
+
showMentions: showMentions,
87
87
+
showPrevNext: showPrevNext,
77
88
},
78
89
});
79
90
toast({ type: "success", content: "Updated!" });