Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adds bluesky social link to header #1190

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/assets/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 35 additions & 24 deletions src/components/header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,30 @@ export default function Header() {
<Search />
<div class={style.social}>
<ReleaseLink class={cx(style.socialItem, style.release)} />
<a
class={style.socialItem}
aria-label="Browse the code on GitHub"
<SocialIcon
label="Browse the code on GitHub"
href="https://github.com/preactjs/preact"
>
<svg aria-hidden viewBox="0 0 24 24">
<use href="/icons.svg#github" />
</svg>
</a>
<a
class={style.socialItem}
aria-label="Follow us on Twitter"
viewbox="0 0 24 24"
id="github"
/>
<SocialIcon
label="Follow us on Twitter"
href="https://twitter.com/preactjs"
>
<svg aria-hidden viewBox="0 0 34 27.646">
<use href="/icons.svg#twitter" />
</svg>
</a>
<a
class={style.socialItem}
aria-label="Chat with us on Slack"
viewbox="0 0 34 27.646"
id="twitter"
/>
<SocialIcon
label="Follow us on Bluesky"
href="https://bsky.app/profile/preactjs.com"
viewbox="0 0 568 501"
id="bluesky"
/>
<SocialIcon
label="Chat with us on Slack"
href="http://chat.preactjs.com/"
>
<svg aria-hidden viewBox="0 0 512 512">
<use href="/icons.svg#slack" />
</svg>
</a>
viewbox="0 0 512 512"
id="slack"
/>
</div>
<div class={style.translation}>
<NavMenu language />
Expand All @@ -77,6 +74,20 @@ export default function Header() {
);
}

const SocialIcon = ({ label, href, viewbox, id }) => (
<a
class={style.socialItem}
aria-label={label}
href={href}
target="_blank"
rel="noopener noreferrer"
>
<svg aria-hidden viewBox={viewbox}>
<use href={`/icons.svg#${id}`} />
</svg>
</a>
);

const HamburgerMenu = ({ open, ...props }) => (
<div class={style.hamburger} open={open} {...props}>
<div class={style.hb1} />
Expand Down