v3: linter and formatter pass
This commit is contained in:
@@ -97,7 +97,9 @@ function notificationLink(n: Notification): string {
|
||||
return `/dumps/${(data as DumpUpvotedData).dumpId}`;
|
||||
case "user_mentioned": {
|
||||
const d = data as UserMentionedData;
|
||||
if (d.contextType === "comment") return `/dumps/${d.dumpId}#comment-${d.contextId}`;
|
||||
if (d.contextType === "comment") {
|
||||
return `/dumps/${d.dumpId}#comment-${d.contextId}`;
|
||||
}
|
||||
if (d.contextType === "dump") return `/dumps/${d.contextId}`;
|
||||
return `/playlists/${d.contextId}`;
|
||||
}
|
||||
@@ -109,28 +111,64 @@ function notificationContent(n: Notification): React.ReactNode {
|
||||
switch (n.type) {
|
||||
case "user_followed": {
|
||||
const d = data as UserFollowedData;
|
||||
return <><strong>{d.followerUsername}</strong>{" started following you"}</>;
|
||||
return (
|
||||
<>
|
||||
<strong>{d.followerUsername}</strong>
|
||||
{" started following you"}
|
||||
</>
|
||||
);
|
||||
}
|
||||
case "playlist_followed": {
|
||||
const d = data as PlaylistFollowedData;
|
||||
return <><strong>{d.followerUsername}</strong>{" followed your playlist "}<strong>{d.playlistTitle}</strong></>;
|
||||
return (
|
||||
<>
|
||||
<strong>{d.followerUsername}</strong>
|
||||
{" followed your playlist "}
|
||||
<strong>{d.playlistTitle}</strong>
|
||||
</>
|
||||
);
|
||||
}
|
||||
case "user_dump_posted": {
|
||||
const d = data as UserDumpPostedData;
|
||||
return <><strong>{d.dumperUsername}</strong>{" posted "}<strong>{d.dumpTitle}</strong></>;
|
||||
return (
|
||||
<>
|
||||
<strong>{d.dumperUsername}</strong>
|
||||
{" posted "}
|
||||
<strong>{d.dumpTitle}</strong>
|
||||
</>
|
||||
);
|
||||
}
|
||||
case "playlist_dump_added": {
|
||||
const d = data as PlaylistDumpAddedData;
|
||||
return <><strong>{d.dumpTitle}</strong>{" was added to "}<strong>{d.playlistTitle}</strong></>;
|
||||
return (
|
||||
<>
|
||||
<strong>{d.dumpTitle}</strong>
|
||||
{" was added to "}
|
||||
<strong>{d.playlistTitle}</strong>
|
||||
</>
|
||||
);
|
||||
}
|
||||
case "dump_upvoted": {
|
||||
const d = data as DumpUpvotedData;
|
||||
return <><strong>{d.voterUsername}</strong>{" upvoted "}<strong>{d.dumpTitle}</strong></>;
|
||||
return (
|
||||
<>
|
||||
<strong>{d.voterUsername}</strong>
|
||||
{" upvoted "}
|
||||
<strong>{d.dumpTitle}</strong>
|
||||
</>
|
||||
);
|
||||
}
|
||||
case "user_mentioned": {
|
||||
const d = data as UserMentionedData;
|
||||
const where = d.contextTitle || (d.contextType === "comment" ? "a comment" : "a post");
|
||||
return <><strong>{d.mentionerUsername}</strong>{" mentioned you in "}<strong>{where}</strong></>;
|
||||
const where = d.contextTitle ||
|
||||
(d.contextType === "comment" ? "a comment" : "a post");
|
||||
return (
|
||||
<>
|
||||
<strong>{d.mentionerUsername}</strong>
|
||||
{" mentioned you in "}
|
||||
<strong>{where}</strong>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user