import { Check } from "@styled-icons/boxicons-regular"; import { Cog } from "@styled-icons/boxicons-solid"; import { observer } from "mobx-react-lite"; import { Link } from "react-router-dom"; import { ServerPermission } from "revolt.js/dist/api/permissions"; import { Server } from "revolt.js/dist/maps/Servers"; import styled, { css } from "styled-components"; import { Text } from "preact-i18n"; import { isTouchscreenDevice } from "../../lib/isTouchscreenDevice"; import IconButton from "../ui/IconButton"; import Tooltip from "./Tooltip"; interface Props { server: Server; background?: boolean; } const ServerBanner = styled.div>` flex-shrink: 0; display: flex; flex-direction: column; justify-content: end; background-size: cover; background-repeat: norepeat; background-position: center center; ${(props) => props.background ? css` height: 120px; .container { background: linear-gradient( 0deg, var(--secondary-background), transparent ); } ` : css` background-color: var(--secondary-header); `} .container { height: var(--header-height); display: flex; align-items: center; padding: 0 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; gap: 8px; .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-grow: 1; } } `; export default observer(({ server }: Props) => { const bannerURL = server.generateBannerURL({ width: 480 }); return (
{server.flags && server.flags & 1 ? ( } placement={"bottom-start"}> ) : undefined} {server.flags && server.flags & 2 ? ( } placement={"bottom-start"}> ) : undefined}
{server.name}
{(server.permission & ServerPermission.ManageServer) > 0 && ( )} ); });