feat: add @ mention indicator on unread badge and bump version to v0.9.76
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vocechat-web",
|
"name": "vocechat-web",
|
||||||
"version": "0.9.75",
|
"version": "0.9.76",
|
||||||
"homepage": "https://voce.chat",
|
"homepage": "https://voce.chat",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@metamask/onboarding": "^1.0.1",
|
"@metamask/onboarding": "^1.0.1",
|
||||||
|
|||||||
@@ -105,12 +105,13 @@ const Session: FC<IProps> = ({
|
|||||||
if (!data) return null;
|
if (!data) return null;
|
||||||
const previewMsg = messageData[mid] || {};
|
const previewMsg = messageData[mid] || {};
|
||||||
const { name, icon, is_public } = data;
|
const { name, icon, is_public } = data;
|
||||||
const { unreads = 0 } = getUnreadCount({
|
const { unreads = 0, mentions = [] } = getUnreadCount({
|
||||||
mids,
|
mids,
|
||||||
readIndex,
|
readIndex,
|
||||||
messageData,
|
messageData,
|
||||||
loginUid,
|
loginUid,
|
||||||
});
|
});
|
||||||
|
const hasMention = mentions.length > 0;
|
||||||
const isVoicing =
|
const isVoicing =
|
||||||
type == "channel"
|
type == "channel"
|
||||||
? voiceList.some((item) => {
|
? voiceList.some((item) => {
|
||||||
@@ -181,6 +182,17 @@ const Session: FC<IProps> = ({
|
|||||||
{renderPreviewMessage(previewMsg)}
|
{renderPreviewMessage(previewMsg)}
|
||||||
</span>
|
</span>
|
||||||
{unreads > 0 && !isCurrentPath ? (
|
{unreads > 0 && !isCurrentPath ? (
|
||||||
|
<span className="flex items-center gap-0.5">
|
||||||
|
{hasMention && (
|
||||||
|
<strong
|
||||||
|
className={clsx(
|
||||||
|
`text-white px-1 py-[3px] font-bold text-[10px] leading-[10px] rounded-[10px]`,
|
||||||
|
muted ? "bg-black/10 dark:bg-gray-500" : "bg-primary-400"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
@
|
||||||
|
</strong>
|
||||||
|
)}
|
||||||
<strong
|
<strong
|
||||||
className={clsx(
|
className={clsx(
|
||||||
`text-white px-1.5 py-[3px] font-bold text-[10px] leading-[10px] rounded-[10px]`,
|
`text-white px-1.5 py-[3px] font-bold text-[10px] leading-[10px] rounded-[10px]`,
|
||||||
@@ -189,6 +201,7 @@ const Session: FC<IProps> = ({
|
|||||||
>
|
>
|
||||||
{unreads > 99 ? "99+" : unreads}
|
{unreads > 99 ? "99+" : unreads}
|
||||||
</strong>
|
</strong>
|
||||||
|
</span>
|
||||||
) : (
|
) : (
|
||||||
muted && <IconMute className="w-3 h-3 fill-black/10 dark:fill-gray-500" />
|
muted && <IconMute className="w-3 h-3 fill-black/10 dark:fill-gray-500" />
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user