feat: Add dark mode support to JigsawStackIcon (#9013)
* ✨ (JigsawStack/index.tsx): introduce useDarkStore hook to handle dark mode state in JigsawStackIcon component * 🐛 (JigsawStackIcon.jsx): fix issue where isdark prop was not being converted to a boolean before being used in the fill color logic
This commit is contained in:
parent
f8b7be604d
commit
f860d94123
2 changed files with 4 additions and 2 deletions
|
|
@ -9,7 +9,7 @@ const JigsawStackIconSVG = ({ isdark, ...props }) => (
|
|||
>
|
||||
<path
|
||||
fill={
|
||||
isdark
|
||||
stringToBool(isdark)
|
||||
? "url(#paint0_linear_102_21_dark)"
|
||||
: "url(#paint0_linear_102_21)"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { useDarkStore } from "@/stores/darkStore";
|
||||
import React, { forwardRef } from "react";
|
||||
import JigsawStackIconSVG from "./JigsawStackIcon";
|
||||
|
||||
|
|
@ -5,5 +6,6 @@ export const JigsawStackIcon = forwardRef<
|
|||
SVGSVGElement,
|
||||
React.PropsWithChildren<{}>
|
||||
>((props, ref) => {
|
||||
return <JigsawStackIconSVG ref={ref} {...props} />;
|
||||
const isdark = useDarkStore((state) => state.dark).toString();
|
||||
return <JigsawStackIconSVG ref={ref} {...props} isdark={isdark} />;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue