Skip to content

Commit bc6cbca

Browse files
feat: support both icon and image rendering for competitive sites (#410)
Updated the CompetitiveSites component to support both icon-based and image-based rendering within the profile link. - Added conditional logic to render either an icon (via iconifyClassname) or an image (via imageSrc). - Ensured styling is applied consistently via logo.style. - Maintained existing anchor tag structure with target and rel attributes for safe external linking. This improves flexibility by allowing platforms without iconify support to use custom images.
1 parent f5bd358 commit bc6cbca

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/components/competitiveSites/CompetitiveSites.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,22 @@ class CompetitiveSites extends React.Component {
2525
target="_blank"
2626
rel="noopener noreferrer"
2727
>
28-
<span
29-
className="iconify"
30-
data-icon={logo.iconifyClassname}
31-
style={logo.style}
32-
data-inline="false"
33-
></span>
28+
{logo.iconifyClassname && (
29+
<span
30+
className="iconify"
31+
data-icon={logo.iconifyClassname}
32+
style={logo.style}
33+
data-inline="false"
34+
></span>
35+
)}
36+
{!logo.iconifyClassname && logo.imageSrc && (
37+
<img
38+
className="skill-image"
39+
style={logo.style}
40+
src={`${process.env.PUBLIC_URL}/skills/${logo.imageSrc}`}
41+
alt={logo.siteName}
42+
/>
43+
)}
3444
</a>
3545
</li>
3646
</OverlayTrigger>

0 commit comments

Comments
 (0)