Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI fixes buttons in the sidebar go blank #21439

Merged
Prev Previous commit
Next Next commit
AI: AI fixes buttons in the sidebar go blank after opening and closin…
…g the metabox

#1621
Use unique gradient id for each image.
  • Loading branch information
mykola committed Jun 14, 2024
commit 9e2f18eaa08ac8a4d87587b29cc7452674fe3770
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ import "./sparkles-icon.css";
* @returns {JSX.Element} The AI Assessment Fixes button icon.
*/
export const SparklesIcon = ({ pressed = false }) => {
const gradientStroke = `url( "#paint0_linear_1208_188" )`;
const gradientId = `gradient-${Math.random().toString(36).substr(2, 9)}`;

return (
<>
<svg xmlns="http:https://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none" >
<path
d="M3.33284 2V4.66667M1.99951 3.33333H4.66618M3.99951 11.3333V14M2.66618 12.6667H5.33284M8.66618 2L10.19 6.57143L13.9995 8L10.19 9.42857L8.66618 14L7.14237 9.42857L3.33284 8L7.14237 6.57143L8.66618 2Z"
strokeLinecap="round"
strokeLinejoin="round"
stroke={ pressed ? "white" : gradientStroke }
stroke={ pressed ? "white" : `url(#${gradientId})` }
strokeWidth="1.33333"
/>
<defs>
<linearGradient
id="paint0_linear_1208_188" x1="0" y1="0" x2="16" y2="16"
id={gradientId} x1="0" y1="0" x2="16" y2="16"
gradientUnits="userSpaceOnUse"
>
<stop offset="0%" stopColor="#A61E69" />
Expand Down
Loading