Skip to content

Commit

Permalink
always hide social link label in footer
Browse files Browse the repository at this point in the history
  • Loading branch information
Roma36 committed Sep 18, 2023
1 parent e2ab8d6 commit 5a2787e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,19 @@ export default function Footer({ links }: FooterProps) {
name="github"
href="https://github.com/opentffoundation/manifesto"
label="Go to the OpenTF's manifesto GitHub repository"
hiddenLabel
/>
<SocialIconLink
name="twitter"
href="https://twitter.com/opentforg"
label="Follow us on Twitter"
hiddenLabel
/>
<SocialIconLink
name="slack"
href="https://join.slack.com/t/slack-9uv6202/shared_invite/zt-22ifsm1t2-AF6cL0cOdzivP8E~4deDJA"
label="Join us on Slack"
hiddenLabel
/>
</div>
</footer>
Expand Down
5 changes: 4 additions & 1 deletion src/components/SocialIconLink/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Link from "@docusaurus/Link";
import React from "react";
import clsx from "clsx";

const iconMap = {
twitter:
Expand All @@ -14,12 +15,14 @@ type SocialIconLinkProps = {
name: keyof typeof iconMap;
href: string;
label: string;
hiddenLabel?: boolean;
};

export default function SocialIconLink({
href,
name,
label,
hiddenLabel = false,
}: SocialIconLinkProps) {
return (
<Link
Expand All @@ -35,7 +38,7 @@ export default function SocialIconLink({
>
<path fill="currentColor" d={iconMap[name]} />
</svg>
<span className="inline-flex xl:hidden" aria-hidden>
<span className={clsx("inline-flex xl:hidden", hiddenLabel && "hidden")} aria-hidden>
{label}
</span>
</Link>
Expand Down

0 comments on commit 5a2787e

Please sign in to comment.