feat: Add dynamic theming support to WatsonxAI icon (#8935)
* ✨ (WatsonxAI.jsx): Add support for dynamic fill color based on isdark prop value 📝 (index.tsx): Import useDarkStore hook and pass isdark prop to SvgWatsonxAI component * ✨ (WatsonxAI.jsx): Remove unnecessary console.log statement ♻️ (index.tsx): Remove unnecessary console.log statement
This commit is contained in:
parent
24db0cdc73
commit
fc729cd7b5
2 changed files with 14 additions and 2 deletions
|
|
@ -1,5 +1,15 @@
|
|||
import { stringToBool } from "@/utils/utils";
|
||||
|
||||
const SvgWatsonxAI = (props) => (
|
||||
<svg viewBox="0 0 32 32" width="1em" height="1em" {...props}>
|
||||
<svg
|
||||
fill={stringToBool(props.isdark) ? "#ffffff" : "#0A0A0A"}
|
||||
fillRule="evenodd"
|
||||
style={{ flex: "none", lineHeight: 1 }}
|
||||
viewBox="0 0 32 32"
|
||||
width="1em"
|
||||
height="1em"
|
||||
{...props}
|
||||
>
|
||||
<path d="m26,24c-1.1046,0-2,.8954-2,2,0,.0764.0142.1488.0225.2229-2.2808,1.7963-5.0792,2.7771-8.0225,2.7771-4.2617,0-8-3.9722-8-8.5,0-4.687,3.813-8.5,8.5-8.5h.5v-2h-.5c-5.7896,0-10.5,4.7104-10.5,10.5,0,1.8839.5304,3.6896,1.4371,5.2565-2.7133-2.3843-4.4371-5.869-4.4371-9.7565,0-2.1152.4917-4.1328,1.4619-5.9956l-1.7744-.9238c-1.104,2.1211-1.6875,4.5137-1.6875,6.9194,0,8.271,6.729,15,15,15,3.3744,0,6.5818-1.1193,9.2048-3.1662.244.106.5123.1662.7952.1662,1.1046,0,2-.8954,2-2s-.8954-2-2-2Z" />
|
||||
<rect
|
||||
x="11"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { useDarkStore } from "@/stores/darkStore";
|
||||
import React, { forwardRef } from "react";
|
||||
import SvgWatsonxAI from "./WatsonxAI";
|
||||
|
||||
|
|
@ -5,5 +6,6 @@ export const WatsonxAiIcon = forwardRef<
|
|||
SVGSVGElement,
|
||||
React.PropsWithChildren<{}>
|
||||
>((props, ref) => {
|
||||
return <SvgWatsonxAI ref={ref} {...props} />;
|
||||
const isdark = useDarkStore((state) => state.dark).toString();
|
||||
return <SvgWatsonxAI ref={ref} isdark={isdark} {...props} />;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue