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
|
<path
|
||||||
fill={
|
fill={
|
||||||
isdark
|
stringToBool(isdark)
|
||||||
? "url(#paint0_linear_102_21_dark)"
|
? "url(#paint0_linear_102_21_dark)"
|
||||||
: "url(#paint0_linear_102_21)"
|
: "url(#paint0_linear_102_21)"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { useDarkStore } from "@/stores/darkStore";
|
||||||
import React, { forwardRef } from "react";
|
import React, { forwardRef } from "react";
|
||||||
import JigsawStackIconSVG from "./JigsawStackIcon";
|
import JigsawStackIconSVG from "./JigsawStackIcon";
|
||||||
|
|
||||||
|
|
@ -5,5 +6,6 @@ export const JigsawStackIcon = forwardRef<
|
||||||
SVGSVGElement,
|
SVGSVGElement,
|
||||||
React.PropsWithChildren<{}>
|
React.PropsWithChildren<{}>
|
||||||
>((props, ref) => {
|
>((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