Skip to content

Commit eb4a172

Browse files
waleedlatif1claude
andcommitted
fix(icons): use useId for SapS4HanaIcon and PipedriveIcon gradients
Why: hardcoded SVG gradient/mask IDs collide when an icon renders more than once on a page (e.g. integrations listing). All other icons in this file use React's useId() — these were inconsistent. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 4f51338 commit eb4a172

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

apps/docs/components/icons.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4099,11 +4099,12 @@ export function SalesforceIcon(props: SVGProps<SVGSVGElement>) {
40994099
}
41004100

41014101
export function SapS4HanaIcon(props: SVGProps<SVGSVGElement>) {
4102+
const id = useId()
41024103
return (
41034104
<svg {...props} xmlns='http://www.w3.org/2000/svg' viewBox='0 0 412.38 204'>
41044105
<defs>
41054106
<linearGradient
4106-
id='sap-s4hana-gradient'
4107+
id={id}
41074108
x1='206.19'
41084109
y1='0'
41094110
x2='206.19'
@@ -4118,7 +4119,7 @@ export function SapS4HanaIcon(props: SVGProps<SVGSVGElement>) {
41184119
</linearGradient>
41194120
</defs>
41204121
<polyline
4121-
fill='url(#sap-s4hana-gradient)'
4122+
fill={`url(#${id})`}
41224123
fillRule='evenodd'
41234124
points='0 204 208.413 204 412.38 0 0 0 0 204'
41244125
/>

apps/sim/components/icons.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4045,6 +4045,9 @@ export function AsanaIcon(props: SVGProps<SVGSVGElement>) {
40454045
}
40464046

40474047
export function PipedriveIcon(props: SVGProps<SVGSVGElement>) {
4048+
const id = useId()
4049+
const pathId = `${id}-path`
4050+
const maskId = `${id}-mask`
40484051
return (
40494052
<svg
40504053
{...props}
@@ -4058,7 +4061,7 @@ export function PipedriveIcon(props: SVGProps<SVGSVGElement>) {
40584061
<defs>
40594062
<path
40604063
d='M59.6807,81.1772 C59.6807,101.5343 70.0078,123.4949 92.7336,123.4949 C109.5872,123.4949 126.6277,110.3374 126.6277,80.8785 C126.6277,55.0508 113.232,37.7119 93.2944,37.7119 C77.0483,37.7119 59.6807,49.1244 59.6807,81.1772 Z M101.3006,0 C142.0482,0 169.4469,32.2728 169.4469,80.3126 C169.4469,127.5978 140.584,160.60942 99.3224,160.60942 C79.6495,160.60942 67.0483,152.1836 60.4595,146.0843 C60.5063,147.5305 60.5374,149.1497 60.5374,150.8788 L60.5374,215 L18.32565,215 L18.32565,44.157 C18.32565,41.6732 17.53126,40.8873 15.07021,40.8873 L0.5531,40.8873 L0.5531,3.4741 L35.9736,3.4741 C52.282,3.4741 56.4564,11.7741 57.2508,18.1721 C63.8708,10.7524 77.5935,0 101.3006,0 Z'
4061-
id='path-1'
4064+
id={pathId}
40624065
/>
40634066
</defs>
40644067
<g
@@ -4069,10 +4072,10 @@ export function PipedriveIcon(props: SVGProps<SVGSVGElement>) {
40694072
fillRule='evenodd'
40704073
>
40714074
<g transform='translate(67.000000, 44.000000)'>
4072-
<mask id='mask-2' fill='white'>
4073-
<use href='#path-1' />
4075+
<mask id={maskId} fill='white'>
4076+
<use href={`#${pathId}`} />
40744077
</mask>
4075-
<use id='Clip-5' fill='#FFFFFF' xlinkHref='#path-1' />
4078+
<use fill='#FFFFFF' xlinkHref={`#${pathId}`} />
40764079
</g>
40774080
</g>
40784081
</svg>
@@ -4099,11 +4102,12 @@ export function SalesforceIcon(props: SVGProps<SVGSVGElement>) {
40994102
}
41004103

41014104
export function SapS4HanaIcon(props: SVGProps<SVGSVGElement>) {
4105+
const id = useId()
41024106
return (
41034107
<svg {...props} xmlns='http://www.w3.org/2000/svg' viewBox='0 0 412.38 204'>
41044108
<defs>
41054109
<linearGradient
4106-
id='sap-s4hana-gradient'
4110+
id={id}
41074111
x1='206.19'
41084112
y1='0'
41094113
x2='206.19'
@@ -4118,7 +4122,7 @@ export function SapS4HanaIcon(props: SVGProps<SVGSVGElement>) {
41184122
</linearGradient>
41194123
</defs>
41204124
<polyline
4121-
fill='url(#sap-s4hana-gradient)'
4125+
fill={`url(#${id})`}
41224126
fillRule='evenodd'
41234127
points='0 204 208.413 204 412.38 0 0 0 0 204'
41244128
/>

0 commit comments

Comments
 (0)