-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 read social data from data.json
- Loading branch information
1 parent
5a02eb2
commit 7827649
Showing
4 changed files
with
37 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,37 +17,19 @@ const StyledSocialLinks = styled.div` | |
} | ||
`; | ||
|
||
const socialData = [ | ||
{ | ||
id: 'github', | ||
image: <FiGithub />, | ||
text: '/umutcanbolat', | ||
href: 'https://github.com/umutcanbolat', | ||
}, | ||
{ | ||
id: 'linkedin', | ||
image: <FaLinkedinIn />, | ||
text: '/umutcanbolat', | ||
href: 'https://www.linkedin.com/in/umutcanbolat', | ||
}, | ||
{ | ||
id: 'web', | ||
image: <VscGlobe />, | ||
text: 'umutcanbolat.com', | ||
href: 'https://www.umutcanbolat.com', | ||
}, | ||
{ | ||
id: 'email', | ||
image: <FiMail />, | ||
text: '[email protected]', | ||
href: 'mailto:[email protected]', | ||
}, | ||
]; | ||
const socialIcons = { | ||
github: <FiGithub />, | ||
linkedin: <FaLinkedinIn />, | ||
web: <VscGlobe />, | ||
email: <FiMail />, | ||
}; | ||
|
||
export default function SocialLinks() { | ||
const links = socialData.map(({ id, image, text, href }) => ( | ||
const getImageComponent = (socialId) => socialIcons[socialId] || socialIcons.web; | ||
|
||
export default function SocialLinks({ data }) { | ||
const links = data.map(({ id, text, href }) => ( | ||
<div key={id} className="item"> | ||
<SocialItem image={image} text={text} href={href} /> | ||
<SocialItem image={getImageComponent(id)} text={text} href={href} /> | ||
</div> | ||
)); | ||
return <StyledSocialLinks>{links}</StyledSocialLinks>; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,28 @@ | ||
{ | ||
"name": "Umut Canbolat", | ||
"title": "Full-Stack Software Engineer", | ||
"social": [ | ||
{ | ||
"id": "github", | ||
"text": "/umutcanbolat", | ||
"href": "https://github.com/umutcanbolat" | ||
}, | ||
{ | ||
"id": "linkedin", | ||
"text": "/umutcanbolat", | ||
"href": "https://www.linkedin.com/in/umutcanbolat" | ||
}, | ||
{ | ||
"id": "web", | ||
"text": "umutcanbolat.com", | ||
"href": "https://www.umutcanbolat.com" | ||
}, | ||
{ | ||
"id": "email", | ||
"text": "[email protected]", | ||
"href": "mailto:[email protected]" | ||
} | ||
], | ||
"experiences": [ | ||
{ | ||
"id": 1, | ||
|