Skip to content

Commit 1bd285f

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 50ffcd2 commit 1bd285f

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
@@ -4069,11 +4069,12 @@ export function SalesforceIcon(props: SVGProps<SVGSVGElement>) {
40694069
}
40704070

40714071
export function SapS4HanaIcon(props: SVGProps<SVGSVGElement>) {
4072+
const id = useId()
40724073
return (
40734074
<svg {...props} xmlns='http://www.w3.org/2000/svg' viewBox='0 0 412.38 204'>
40744075
<defs>
40754076
<linearGradient
4076-
id='sap-s4hana-gradient'
4077+
id={id}
40774078
x1='206.19'
40784079
y1='0'
40794080
x2='206.19'
@@ -4088,7 +4089,7 @@ export function SapS4HanaIcon(props: SVGProps<SVGSVGElement>) {
40884089
</linearGradient>
40894090
</defs>
40904091
<polyline
4091-
fill='url(#sap-s4hana-gradient)'
4092+
fill={`url(#${id})`}
40924093
fillRule='evenodd'
40934094
points='0 204 208.413 204 412.38 0 0 0 0 204'
40944095
/>

apps/sim/components/icons.tsx

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

40174017
export function PipedriveIcon(props: SVGProps<SVGSVGElement>) {
4018+
const id = useId()
4019+
const pathId = `${id}-path`
4020+
const maskId = `${id}-mask`
40184021
return (
40194022
<svg
40204023
{...props}
@@ -4028,7 +4031,7 @@ export function PipedriveIcon(props: SVGProps<SVGSVGElement>) {
40284031
<defs>
40294032
<path
40304033
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'
4031-
id='path-1'
4034+
id={pathId}
40324035
/>
40334036
</defs>
40344037
<g
@@ -4039,10 +4042,10 @@ export function PipedriveIcon(props: SVGProps<SVGSVGElement>) {
40394042
fillRule='evenodd'
40404043
>
40414044
<g transform='translate(67.000000, 44.000000)'>
4042-
<mask id='mask-2' fill='white'>
4043-
<use href='#path-1' />
4045+
<mask id={maskId} fill='white'>
4046+
<use href={`#${pathId}`} />
40444047
</mask>
4045-
<use id='Clip-5' fill='#FFFFFF' xlinkHref='#path-1' />
4048+
<use fill='#FFFFFF' xlinkHref={`#${pathId}`} />
40464049
</g>
40474050
</g>
40484051
</svg>
@@ -4069,11 +4072,12 @@ export function SalesforceIcon(props: SVGProps<SVGSVGElement>) {
40694072
}
40704073

40714074
export function SapS4HanaIcon(props: SVGProps<SVGSVGElement>) {
4075+
const id = useId()
40724076
return (
40734077
<svg {...props} xmlns='http://www.w3.org/2000/svg' viewBox='0 0 412.38 204'>
40744078
<defs>
40754079
<linearGradient
4076-
id='sap-s4hana-gradient'
4080+
id={id}
40774081
x1='206.19'
40784082
y1='0'
40794083
x2='206.19'
@@ -4088,7 +4092,7 @@ export function SapS4HanaIcon(props: SVGProps<SVGSVGElement>) {
40884092
</linearGradient>
40894093
</defs>
40904094
<polyline
4091-
fill='url(#sap-s4hana-gradient)'
4095+
fill={`url(#${id})`}
40924096
fillRule='evenodd'
40934097
points='0 204 208.413 204 412.38 0 0 0 0 204'
40944098
/>

0 commit comments

Comments
 (0)