feat(servers): added new icons to server sidebar

This commit is contained in:
trashtemp 2021-12-26 20:28:48 +01:00
parent 5797eb3686
commit 716edb3318
No known key found for this signature in database
GPG key ID: D1F0DB65081B0FC6
3 changed files with 76 additions and 14 deletions

View file

@ -13,12 +13,13 @@ interface Props extends IconBaseProps<Server> {
} }
const ServerText = styled.div` const ServerText = styled.div`
display: grid; display: flex;
align-items: center;
justify-content: center;
padding: 0.2em; padding: 0.2em;
font-size: 0.75rem; font-size: 0.75rem;
font-weight: 600; font-weight: 600;
overflow: hidden; overflow: hidden;
place-items: center;
color: var(--foreground); color: var(--foreground);
background: var(--primary-background); background: var(--primary-background);
border-radius: var(--border-radius-half); border-radius: var(--border-radius-half);

View file

@ -1,5 +1,5 @@
import { Plus } from "@styled-icons/boxicons-regular"; import { Plus, LinkExternal } from "@styled-icons/boxicons-regular";
import { Cog } from "@styled-icons/boxicons-solid"; import { Cog, Compass } from "@styled-icons/boxicons-solid";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import { Link, useHistory, useLocation, useParams } from "react-router-dom"; import { Link, useHistory, useLocation, useParams } from "react-router-dom";
import { RelationshipStatus } from "revolt-api/types/Users"; import { RelationshipStatus } from "revolt-api/types/Users";
@ -162,6 +162,33 @@ const ServerEntry = styled.div<{ active: boolean; home?: boolean }>`
`} `}
`; `;
const ServerCircle = styled.div`
width: 54px;
height: 58px;
display: flex;
align-items: center;
justify-content: center;
.circle {
display: flex;
align-items: center;
justify-content: center;
background-color: var(--primary-background);
border-radius: 50%;
height: 42px;
width: 42px;
transition: background-color 0.1s ease-in;
> div svg {
color: var(--accent);
}
&:active {
transform: translateY(1px);
}
}
`;
const SettingsButton = styled.div` const SettingsButton = styled.div`
width: 50px; width: 50px;
height: 56px; height: 56px;
@ -341,6 +368,10 @@ export default observer(() => {
</ConditionalLink> </ConditionalLink>
); );
})} })}
{/*<LineDivider />*/}
<ServerCircle>
<Tooltip content="Add a Server" placement="right">
<div className="circle">
<IconButton <IconButton
onClick={() => onClick={() =>
openScreen({ openScreen({
@ -348,10 +379,39 @@ export default observer(() => {
type: "create_server", type: "create_server",
}) })
}> }>
<Plus size={36} /> <Plus size={32} />
</IconButton> </IconButton>
<PaintCounter small /> </div>
</Tooltip>
</ServerCircle>
<ServerCircle>
<Tooltip
content={
<div
style={{
display: "flex",
alignItems: "center",
gap: "4px",
}}>
<div>Discover Public Servers</div>
<LinkExternal size={12} />
</div>
}
placement="right">
<div className="circle">
<IconButton>
<a
href="https://revolt.social"
target="_blank"
rel="noreferrer">
<Compass size={32} />
</a>
</IconButton>
</div>
</Tooltip>
</ServerCircle>
</ServerList> </ServerList>
<PaintCounter small />
{!isTouchscreenDevice && ( {!isTouchscreenDevice && (
<SettingsButton> <SettingsButton>
<Link to="/settings"> <Link to="/settings">

View file

@ -227,6 +227,7 @@
font-size: 0.8125rem; font-size: 0.8125rem;
text-transform: uppercase; text-transform: uppercase;
color: var(--secondary-foreground); color: var(--secondary-foreground);
/*margin-bottom: 10px;*/
&:first-child { &:first-child {
margin-top: 0; margin-top: 0;