Server Sidebar: Add home icon hover.

Home Sidebar: Remove top bar.
This commit is contained in:
Paul
2021-07-09 22:15:36 +01:00
parent f403875ae6
commit 54185b5839
9 changed files with 79 additions and 37 deletions

View File

@@ -0,0 +1,41 @@
import { Children } from "../../../types/Preact";
import { Username } from "./UserShort";
import styled from "styled-components";
import UserStatus from "./UserStatus";
import Tooltip from "../Tooltip";
import { User } from "revolt.js";
interface Props {
user?: User,
children: Children
}
const Base = styled.div`
display: flex;
flex-direction: column;
.username {
font-weight: 600;
}
.status {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
`;
export default function UserHover({ user, children }: Props) {
return (
<Tooltip placement="right-end" content={
<Base>
<Username className="username" user={user} />
<span className="status">
<UserStatus user={user} />
</span>
</Base>
}>
{ children }
</Tooltip>
)
}

View File

@@ -5,12 +5,12 @@ import { Text } from "preact-i18n";
import Tooltip from "../Tooltip";
interface Props {
user: User;
user?: User;
tooltip?: boolean;
}
export default function UserStatus({ user, tooltip }: Props) {
if (user.online) {
if (user?.online) {
if (user.status?.text) {
if (tooltip) {
return (