From 246ed2c606fdccd86598dfbe3069c7c21c821708 Mon Sep 17 00:00:00 2001 From: r41ph Date: Tue, 1 Oct 2024 09:45:55 +0100 Subject: [PATCH] refactor: update CogIcon and ShoppingBagIcon to use random Id --- .../src/components/icons/CogIcon.tsx | 140 ++++++++++-------- .../src/components/icons/ShoppingBagIcon.tsx | 4 +- 2 files changed, 77 insertions(+), 67 deletions(-) diff --git a/web-components/src/components/icons/CogIcon.tsx b/web-components/src/components/icons/CogIcon.tsx index c111f0a6d2..51246967bc 100644 --- a/web-components/src/components/icons/CogIcon.tsx +++ b/web-components/src/components/icons/CogIcon.tsx @@ -5,67 +5,79 @@ type Props = { disabled?: boolean; } & React.SVGProps; -export const CogIcon = ({ linearGradient, ...props }: Props) => ( - - - - - - - - - - - - - - -); +export const CogIcon = ({ linearGradient, ...props }: Props) => { + const randomId = Math.random().toString(36).substring(7); + const gradientId1 = `linear1_cog_icon-${randomId}`; + const gradientId2 = `linear2_cog_icon-${randomId}`; + + return ( + + + + + + + + + + + + + + + ); +}; diff --git a/web-components/src/components/icons/ShoppingBagIcon.tsx b/web-components/src/components/icons/ShoppingBagIcon.tsx index 953b38976f..c58e4111a8 100644 --- a/web-components/src/components/icons/ShoppingBagIcon.tsx +++ b/web-components/src/components/icons/ShoppingBagIcon.tsx @@ -7,9 +7,7 @@ type Props = { export const ShoppingBagIcon = (props: Props) => { const randomId = Math.random().toString(36).substring(7); - const gradientId = props.disabled - ? `shopping_bag_gradient-${randomId}` - : 'shopping_bag_gradient'; + const gradientId = `shopping_bag_gradient-${randomId}`; return (