Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
chore: use discrim
Browse files Browse the repository at this point in the history
  • Loading branch information
insertish committed Jun 11, 2023
1 parent 32f73ac commit 4be0243
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/components/design/atoms/indicators/UserTooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import { User } from "revolt.js";
import styled from "styled-components";

import { Tooltip, TooltipProps } from "./Tooltip";

const Base = styled.div`
Expand All @@ -12,6 +13,12 @@ const Base = styled.div`
font-weight: 600;
}
.username-new {
font-size: 11px;
font-weight: 600;
color: var(--secondary-foreground);
}
.status {
font-size: 11px;
overflow: hidden;
Expand All @@ -36,7 +43,18 @@ export function UserTooltip({ user, ...props }: Props) {
{...props}
content={
<Base>
<span className="username">{user.username}</span>
<span className="username">
{(user as unknown as { display_name: string })
.display_name ?? user.username}
</span>
<span className="username-new">
{user.username}
{"#"}
{
(user as unknown as { discriminator: string })
.discriminator
}
</span>
<span className="status">{user.status?.presence}</span>
</Base>
}
Expand Down

0 comments on commit 4be0243

Please sign in to comment.