Add labels to some & truncate notifications

This commit is contained in:
Freeplay 2023-05-22 21:11:35 -04:00
parent 1a076a5956
commit d85067fad5
2 changed files with 19 additions and 5 deletions

View File

@ -1959,6 +1959,9 @@ _notification:
youWereInvitedToGroup: "{userName} invited you to a group" youWereInvitedToGroup: "{userName} invited you to a group"
pollEnded: "Poll results have become available" pollEnded: "Poll results have become available"
emptyPushNotificationMessage: "Push notifications have been updated" emptyPushNotificationMessage: "Push notifications have been updated"
reacted: "reacted to your post"
renoted: "boosted your post"
voted: "voted on your poll"
_types: _types:
all: "All" all: "All"
follow: "New followers" follow: "New followers"

View File

@ -2,7 +2,7 @@
<div <div
ref="elRef" ref="elRef"
v-size="{ max: [500, 600] }" v-size="{ max: [500, 600] }"
class="qglefbjs" class="qglefbjs notification"
:class="notification.type" :class="notification.type"
> >
<div class="head"> <div class="head">
@ -114,6 +114,7 @@
:to="notePage(notification.note)" :to="notePage(notification.note)"
:title="getNoteSummary(notification.note)" :title="getNoteSummary(notification.note)"
> >
<span>{{ i18n.ts._notification.reacted }}</span>
<i class="ph-quotes ph-fill ph-lg"></i> <i class="ph-quotes ph-fill ph-lg"></i>
<Mfm <Mfm
:text="getNoteSummary(notification.note)" :text="getNoteSummary(notification.note)"
@ -129,6 +130,7 @@
:to="notePage(notification.note)" :to="notePage(notification.note)"
:title="getNoteSummary(notification.note.renote)" :title="getNoteSummary(notification.note.renote)"
> >
<span>{{ i18n.ts._notification.renoted }}</span>
<i class="ph-quotes ph-fill ph-lg"></i> <i class="ph-quotes ph-fill ph-lg"></i>
<Mfm <Mfm
:text="getNoteSummary(notification.note.renote)" :text="getNoteSummary(notification.note.renote)"
@ -183,6 +185,7 @@
:to="notePage(notification.note)" :to="notePage(notification.note)"
:title="getNoteSummary(notification.note)" :title="getNoteSummary(notification.note)"
> >
<span>{{ i18n.ts._notification.voted }}</span>
<i class="ph-quotes ph-fill ph-lg"></i> <i class="ph-quotes ph-fill ph-lg"></i>
<Mfm <Mfm
:text="getNoteSummary(notification.note)" :text="getNoteSummary(notification.note)"
@ -210,7 +213,7 @@
<span <span
v-if="notification.type === 'follow'" v-if="notification.type === 'follow'"
class="text" class="text"
style="opacity: 0.6" style="opacity: 0.7"
>{{ i18n.ts.youGotNewFollower }} >{{ i18n.ts.youGotNewFollower }}
<div v-if="full"> <div v-if="full">
<MkFollowButton <MkFollowButton
@ -221,13 +224,13 @@
<span <span
v-if="notification.type === 'followRequestAccepted'" v-if="notification.type === 'followRequestAccepted'"
class="text" class="text"
style="opacity: 0.6" style="opacity: 0.7"
>{{ i18n.ts.followRequestAccepted }}</span >{{ i18n.ts.followRequestAccepted }}</span
> >
<span <span
v-if="notification.type === 'receiveFollowRequest'" v-if="notification.type === 'receiveFollowRequest'"
class="text" class="text"
style="opacity: 0.6" style="opacity: 0.7"
>{{ i18n.ts.receiveFollowRequest }} >{{ i18n.ts.receiveFollowRequest }}
<div v-if="full && !followRequestDone"> <div v-if="full && !followRequestDone">
<button class="_textButton" @click="acceptFollowRequest()"> <button class="_textButton" @click="acceptFollowRequest()">
@ -242,7 +245,7 @@
<span <span
v-if="notification.type === 'groupInvited'" v-if="notification.type === 'groupInvited'"
class="text" class="text"
style="opacity: 0.6" style="opacity: 0.7"
>{{ i18n.ts.groupInvited }}: >{{ i18n.ts.groupInvited }}:
<b>{{ notification.invitation.group.name }}</b> <b>{{ notification.invitation.group.name }}</b>
<div v-if="full && !groupInviteDone"> <div v-if="full && !groupInviteDone">
@ -509,9 +512,17 @@ useTooltip(reactionRef, (showing) => {
> .text { > .text {
white-space: nowrap; white-space: nowrap;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
> span:first-child {
opacity: .7;
&::after { content: ": " }
}
> i { > i {
vertical-align: super; vertical-align: super;
font-size: 50%; font-size: 50%;