mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-29 10:20:59 -05:00
Update ServerListSidebar.tsx
This commit is contained in:
parent
c99c3ffc35
commit
8124119e73
1 changed files with 8 additions and 3 deletions
|
@ -33,10 +33,12 @@ import { Children } from "../../../types/Preact";
|
||||||
function Icon({
|
function Icon({
|
||||||
children,
|
children,
|
||||||
unread,
|
unread,
|
||||||
|
count,
|
||||||
size,
|
size,
|
||||||
}: {
|
}: {
|
||||||
children: Children;
|
children: Children;
|
||||||
unread?: "mention" | "unread";
|
unread?: "mention" | "unread";
|
||||||
|
count: number | 0;
|
||||||
size: number;
|
size: number;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
|
@ -54,7 +56,10 @@ function Icon({
|
||||||
<circle cx="27" cy="5" r="5" fill={"white"} />
|
<circle cx="27" cy="5" r="5" fill={"white"} />
|
||||||
)}
|
)}
|
||||||
{unread === "mention" && (
|
{unread === "mention" && (
|
||||||
<circle cx="27" cy="5" r="5" fill={"var(--error)"} />
|
<>
|
||||||
|
<circle cx="27" cy="5" r="5" fill={"var(--error)"} />
|
||||||
|
<text x="27" y="5" r="5" fill={"white"} text-anchor="middle" fontSize={"7.5"} alignmentBaseline={"middle"}>{count<10?count:"9+"}</text>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
|
@ -263,7 +268,7 @@ export const ServerListSidebar = observer(({ unreads, lastOpened }: Props) => {
|
||||||
homeActive && history.push("/settings")
|
homeActive && history.push("/settings")
|
||||||
}>
|
}>
|
||||||
<UserHover user={client.user}>
|
<UserHover user={client.user}>
|
||||||
<Icon size={42} unread={homeUnread}>
|
<Icon size={42} unread={homeUnread} count={0}>
|
||||||
<UserIcon
|
<UserIcon
|
||||||
target={client.user}
|
target={client.user}
|
||||||
size={32}
|
size={32}
|
||||||
|
@ -297,7 +302,7 @@ export const ServerListSidebar = observer(({ unreads, lastOpened }: Props) => {
|
||||||
<Tooltip
|
<Tooltip
|
||||||
content={entry.server.name}
|
content={entry.server.name}
|
||||||
placement="right">
|
placement="right">
|
||||||
<Icon size={42} unread={entry.unread}>
|
<Icon size={42} unread={entry.unread} count={entry.alertCount}>
|
||||||
<ServerIcon
|
<ServerIcon
|
||||||
size={32}
|
size={32}
|
||||||
target={entry.server}
|
target={entry.server}
|
||||||
|
|
Loading…
Reference in a new issue