Skip to content

Commit

Permalink
fix: add option for svgs with fill (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cahllagerfeld authored Oct 23, 2023
1 parent f35cee0 commit 9b0176b
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/components/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,28 @@ type SidebarItemContentProps = {
icon: ReactNode;
label: string;
isActive?: boolean;
svgStroke?: boolean;
};

export function SidebarItemContent({ icon, label, isActive }: SidebarItemContentProps) {
export function SidebarItemContent({
icon,
label,
isActive,
svgStroke = false
}: SidebarItemContentProps) {
const existingIconClasses = isValidElement(icon) ? icon.props.className || "" : "";

const iconClasses = cn(
existingIconClasses,
`w-5 h-5 shrink-0 ${isActive ? "stroke-primary-400" : "stroke-theme-text-tertiary"} `
`w-5 h-5 shrink-0 ${
svgStroke
? isActive
? "stroke-primary-400"
: "stroke-theme-text-tertiary"
: isActive
? "fill-primary-400"
: "fill-theme-text-tertiary"
} `
);
return (
<>
Expand Down

0 comments on commit 9b0176b

Please sign in to comment.