Skip to content

Commit

Permalink
Merge pull request #66 from ryanbalieiro/social-icons-refactoring
Browse files Browse the repository at this point in the history
Improvements on the Social Icons component.
  • Loading branch information
ubaimutl authored Sep 24, 2024
2 parents 460317b + ccad258 commit 470d81e
Showing 1 changed file with 27 additions and 42 deletions.
69 changes: 27 additions & 42 deletions src/components/socialicons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,40 @@ import {
FaLinkedin,
FaYoutube,
FaTwitch,
FaInstagram,
FaSnapchatGhost,
FaTiktok,
FaCircle
} from "react-icons/fa";
import { socialprofils } from "../../content_option";

const ICON_MAPPING = {
default: FaCircle,
facebook: FaFacebookF,
github: FaGithub,
instagram: FaInstagram,
linkedin: FaLinkedin,
snapchat: FaSnapchatGhost,
tiktok: FaTiktok,
twitter: FaTwitter,
twitch: FaTwitch,
youtube: FaYoutube
};

export const Socialicons = (params) => {
return (
<div className="stick_follow_icon">
<ul>
{socialprofils.twitter && (
<li>
<a href={socialprofils.twitter}>
<FaTwitter />
</a>
</li>
)}
{socialprofils.github && (
<li>
<a href={socialprofils.github}>
<FaGithub />
</a>
</li>
)}
{socialprofils.facebook && (
<li>
<a href={socialprofils.facebook}>
<FaFacebookF />
</a>
</li>
)}
{socialprofils.linkedin && (
<li>
<a href={socialprofils.linkedin}>
<FaLinkedin />
</a>
</li>
)}
{socialprofils.youtube && (
<li>
<a href={socialprofils.youtube}>
<FaYoutube />
</a>
</li>
)}
{socialprofils.twitch && (
<li>
<a href={socialprofils.twitch}>
<FaTwitch />
</a>
</li>
)}
{Object.entries(socialprofils).map(([platform, url]) => {
const IconComponent = ICON_MAPPING[platform] || ICON_MAPPING.default;
return (
<li key={platform}>
<a href={url}>
<IconComponent />
</a>
</li>
);
})}
</ul>
<p>Follow Me</p>
</div>
Expand Down

0 comments on commit 470d81e

Please sign in to comment.