Skip to content

Commit

Permalink
Refactored code into a single ProfileLinks component, excluding repea…
Browse files Browse the repository at this point in the history
…ted code.
  • Loading branch information
gabrielpenteado committed Aug 23, 2024
1 parent fc79c9a commit bebbd58
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 109 deletions.
13 changes: 0 additions & 13 deletions src/components/Links/GitHub/GitHub.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions src/components/Links/LinkedIn/LinkedIn.css

This file was deleted.

13 changes: 0 additions & 13 deletions src/components/Links/LinkedIn/LinkedIn.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions src/components/Links/Website/Website.css

This file was deleted.

13 changes: 0 additions & 13 deletions src/components/Links/Website/Website.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions src/components/Links/X-Twitter/XTwitter.css

This file was deleted.

13 changes: 0 additions & 13 deletions src/components/Links/X-Twitter/XTwitter.tsx

This file was deleted.

19 changes: 9 additions & 10 deletions src/components/Profile/Profile.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import "./Profile.css";
import { FaGithub, FaLinkedin } from "react-icons/fa";
import { FaSquareXTwitter } from "react-icons/fa6";
import Title from "../Title/Title";
import Bubble from "../Bubble/Bubble";
import ProfileImage from "./ProfileImage/ProfileImage";
import ProfileLanguages, {
type Language,
} from "./ProfileLanguages/ProfileLanguages";
import GitHub from "../Links/GitHub/GitHub";
import LinkedIn from "../Links/LinkedIn/LinkedIn";
import XTwitter from "../Links/X-Twitter/XTwitter";
import Website from "../Links/Website/Website";
import ProfileLink from "./ProfileLink/ProfileLink";

type TechnicalCategory = {
category: string;
Expand Down Expand Up @@ -44,6 +39,13 @@ const ProfileHeader = ({
twitter,
website,
}: Data["profile"]) => {
const profileLinks = {
github,
linkedin,
twitter,
website,
};

return (
<div className="profile__header">
<ProfileImage circular={true} border={true} />
Expand All @@ -53,10 +55,7 @@ const ProfileHeader = ({
))}
</div>
<div className="profile__header__links">
<GitHub githubLink={github} />
<LinkedIn linkedinLink={linkedin} />
<XTwitter xtwitterLink={twitter} />
<Website websiteLink={website} />
<ProfileLink links={profileLinks} />
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.github__link {
.profile__header__link {
display: flex;
align-items: center;
gap: 0.5em;
Expand All @@ -9,7 +9,7 @@
}
}

.github__link a {
.profile__header__link a {
text-decoration: none;
color: inherit;
}
34 changes: 34 additions & 0 deletions src/components/Profile/ProfileLink/ProfileLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { FaGithub, FaHouseUser, FaLinkedin } from "react-icons/fa";
import "./ProfileLink.css";

type ProfileLinks = {
github: string;
linkedin: string;
twitter: string;
website: string;
};

const ProfileLink = ({ links }: { links: ProfileLinks }) => {
return (
<>
<div className="profile__header__link">
<FaGithub />
<a href={`https://${links.github}`}>{links.github}</a>
</div>
<div className="profile__header__link">
<FaLinkedin />
<a href={`https://${links.linkedin}`}>{links.linkedin}</a>
</div>
<div className="profile__header__link">
<FaGithub />
<a href={`https://${links.twitter}`}>{links.twitter}</a>
</div>
<div className="profile__header__link">
<FaHouseUser />
<a href={`https://${links.website}`}>{links.website}</a>
</div>
</>
);
};

export default ProfileLink;

0 comments on commit bebbd58

Please sign in to comment.