Skip to content

Commit

Permalink
fix guild icons having odd border from bg
Browse files Browse the repository at this point in the history
  • Loading branch information
Puyodead1 committed Aug 9, 2023
1 parent d016c5b commit f91b940
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/components/GuildItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,26 @@ import GuildSidebarListItem from "./GuildSidebarListItem";
import SidebarPill, { PillType } from "./SidebarPill";
import Tooltip from "./Tooltip";

const Wrapper = styled(Container)<{ active?: boolean }>`
const Wrapper = styled(Container)<{ active?: boolean; hasImage?: boolean }>`
display: flex;
align-items: center;
justify-content: center;
width: 48px;
height: 48px;
border-radius: ${(props) => (props.active ? "30%" : "50%")};
background-color: ${(props) =>
props.active ? "var(--primary)" : "var(--background-secondary)"};
props.hasImage
? "transparent"
: props.active
? "var(--primary)"
: "var(--background-secondary)"};
transition: border-radius 0.2s ease, background-color 0.2s ease;
cursor: pointer;
&:hover {
border-radius: 30%;
background-color: var(--primary);
background-color: ${(props) =>
props.hasImage ? "transparent" : "var(--primary)"};
}
`;

Expand Down Expand Up @@ -71,6 +76,7 @@ function GuildItem(props: Props) {
<Wrapper
onClick={doNavigate}
active={props.active}
hasImage={!!guild?.icon}
onMouseEnter={() => setHovered(true)}
onMouseLeave={() => setHovered(false)}
>
Expand All @@ -87,7 +93,13 @@ function GuildItem(props: Props) {
height={48}
/>
) : (
<span style={{ fontSize: "18px", fontWeight: "bold", cursor: "pointer" }}>
<span
style={{
fontSize: "18px",
fontWeight: "bold",
cursor: "pointer",
}}
>
{guild?.acronym}
</span>
)}
Expand Down

0 comments on commit f91b940

Please sign in to comment.