Skip to content

Commit

Permalink
feat: open TSC members social links in a new tab (#1506)
Browse files Browse the repository at this point in the history
Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com>
  • Loading branch information
Olaleye-Blessing and akshatnema authored Apr 14, 2023
1 parent 9418f9a commit 6de59a1
Showing 1 changed file with 25 additions and 31 deletions.
56 changes: 25 additions & 31 deletions pages/community/tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,28 @@ export default function TSC() {
);
}

const socials = {
"Github": <GithubSVG />,
"Twitter": <TwitterSVG />,
"Linkedin": <LinkedInSVG />,
}

function SocialLink({ href, social }) {
return (
<li>
<a
href={href}
className="text-gray-600 hover:text-gray-500"
target="_blank"
rel="noreferrer noopener"
>
<span className="sr-only">{social}</span>
{socials[social]}
</a>
</li>
)
}

function UserInfo({ user }) {
return (
<li
Expand All @@ -154,37 +176,9 @@ function UserInfo({ user }) {
<div className="font-bold text-lg my-3">{user.name}</div>
<UserWorkStatus user={user} />
<ul role="list" className="flex justify-center space-x-5 my-5">
<li>
<a
href={user.github}
className="text-gray-600 hover:text-gray-500"
>
<span className="sr-only">GitHub</span>
<GithubSVG />
</a>
</li>
{user.twitter ? (
<li>
<a
href={user.twitter}
className="text-gray-600 hover:text-gray-500"
>
<span className="sr-only">Twitter</span>
<TwitterSVG />
</a>
</li>
) : null}
{user.linkedin ? (
<li>
<a
href={user.linkedin}
className="text-gray-600 hover:text-gray-500"
>
<span className="sr-only">LinkedIn</span>
<LinkedInSVG />
</a>
</li>
) : null}
<SocialLink href={user.github} social="Github" />
{user.twitter ? <SocialLink href={user.twitter} social="Twitter" /> : null}
{user.linkedin ? <SocialLink href={user.linkedin} social="Linkedin" /> : null}
</ul>
</div>
</div>
Expand Down

0 comments on commit 6de59a1

Please sign in to comment.