Skip to content

Commit 82c4376

Browse files
committed
fix: render footer social icons as inline SVG
1 parent dc788df commit 82c4376

2 files changed

Lines changed: 7 additions & 23 deletions

File tree

src/components/Layout.jsx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { NavLink, Outlet } from 'react-router-dom';
2-
import githubIcon from '../assets/icons/github.svg';
3-
import linkedinIcon from '../assets/icons/linkedin.svg';
4-
import xIcon from '../assets/icons/x.svg';
5-
import mailIcon from '../assets/icons/mail.svg';
2+
import { FaEnvelope, FaGithub, FaLinkedinIn } from 'react-icons/fa';
3+
import { FaXTwitter } from 'react-icons/fa6';
64

75
const navItems = [
86
{ to: '/', label: 'home' },
@@ -14,25 +12,25 @@ const socialLinks = [
1412
{
1513
label: 'LinkedIn',
1614
href: 'https://www.linkedin.com/in/david-bingmann-13b897293/',
17-
icon: linkedinIcon,
15+
Icon: FaLinkedinIn,
1816
external: true,
1917
},
2018
{
2119
label: 'Mail',
2220
href: 'mailto:contact@davidbingmann.de',
23-
icon: mailIcon,
21+
Icon: FaEnvelope,
2422
external: false,
2523
},
2624
{
2725
label: 'GitHub',
2826
href: 'https://github.com/davidbingmann',
29-
icon: githubIcon,
27+
Icon: FaGithub,
3028
external: true,
3129
},
3230
{
3331
label: 'X',
3432
href: 'https://x.com/davidbingmann',
35-
icon: xIcon,
33+
Icon: FaXTwitter,
3634
external: true,
3735
},
3836
];
@@ -73,14 +71,7 @@ export default function Layout() {
7371
rel={link.external ? 'noreferrer' : undefined}
7472
aria-label={link.label}
7573
>
76-
<span
77-
className="footer-icon"
78-
aria-hidden="true"
79-
style={{
80-
WebkitMaskImage: `url(${link.icon})`,
81-
maskImage: `url(${link.icon})`,
82-
}}
83-
/>
74+
<link.Icon className="footer-icon" aria-hidden="true" focusable="false" />
8475
<span className="sr-only">{link.label}</span>
8576
</a>
8677
))}

src/styles.css

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,6 @@ p {
334334
width: 18px;
335335
height: 18px;
336336
display: block;
337-
background-color: currentColor;
338-
-webkit-mask-repeat: no-repeat;
339-
mask-repeat: no-repeat;
340-
-webkit-mask-size: contain;
341-
mask-size: contain;
342-
-webkit-mask-position: center;
343-
mask-position: center;
344337
}
345338

346339
.sr-only {

0 commit comments

Comments
 (0)