Skip to content

Commit 9b0176b

Browse files
fix: add option for svgs with fill (#32)
1 parent f35cee0 commit 9b0176b

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/components/Sidebar/Sidebar.tsx

+16-2
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,28 @@ type SidebarItemContentProps = {
128128
icon: ReactNode;
129129
label: string;
130130
isActive?: boolean;
131+
svgStroke?: boolean;
131132
};
132133

133-
export function SidebarItemContent({ icon, label, isActive }: SidebarItemContentProps) {
134+
export function SidebarItemContent({
135+
icon,
136+
label,
137+
isActive,
138+
svgStroke = false
139+
}: SidebarItemContentProps) {
134140
const existingIconClasses = isValidElement(icon) ? icon.props.className || "" : "";
135141

136142
const iconClasses = cn(
137143
existingIconClasses,
138-
`w-5 h-5 shrink-0 ${isActive ? "stroke-primary-400" : "stroke-theme-text-tertiary"} `
144+
`w-5 h-5 shrink-0 ${
145+
svgStroke
146+
? isActive
147+
? "stroke-primary-400"
148+
: "stroke-theme-text-tertiary"
149+
: isActive
150+
? "fill-primary-400"
151+
: "fill-theme-text-tertiary"
152+
} `
139153
);
140154
return (
141155
<>

0 commit comments

Comments
 (0)