Skip to content

Adds tiktok and instagram profiles to footer; updates tests #195

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

Merged
merged 1 commit into from
Nov 13, 2023
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
32 changes: 20 additions & 12 deletions _tests_/components/footer/footer.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,38 @@ describe("Footer", () => {

const github = screen.getByTitle("github");
const githubA11yText = screen.getByTitle("footer-github-a11y-text");
const githubIcon = screen.getByTitle('footer-github-icon');
const copyright = screen.getByTitle('copyright-text');
const githubIcon = screen.getByTitle("footer-github-icon");
const copyright = screen.getByTitle("copyright-text");

const arweave = screen.getByTitle("arweave");
const arweaveA11yText = screen.getByTitle("footer-arweave-a11y-text");
const arweaveIcon = screen.getByTitle('footer-arweave-icon');
const tiktok = screen.getByTitle("tiktok");
const tiktokA11yText = screen.getByTitle("footer-tiktok-a11y-text");
const tiktokIcon = screen.getByTitle("footer-tiktok-icon");

const instagram = screen.getByTitle("instagram");
const instagramA11yText = screen.getByTitle("footer-instagram-a11y-text");
const instagramIcon = screen.getByTitle("footer-instagram-icon");

const twitter = screen.getByTitle("twitter");
const twitterA11yText = screen.getByTitle("footer-twitter-a11y-text");
const twitterIcon = screen.getByTitle('footer-twitter-icon');
const twitterIcon = screen.getByTitle("footer-twitter-icon");

expect(github).toBeInTheDocument();
expect(githubA11yText).toHaveTextContent('footerGitHubA11yText');
expect(githubA11yText).toHaveTextContent("footerGitHubA11yText");
expect(githubIcon).toBeInTheDocument();

expect(arweave).toBeInTheDocument();
expect(arweaveA11yText).toHaveTextContent('footerArweaveA11yText');
expect(arweaveIcon).toBeInTheDocument();
expect(tiktok).toBeInTheDocument();
expect(tiktokA11yText).toHaveTextContent("footerTiktokA11yText");
expect(tiktokIcon).toBeInTheDocument();

expect(instagram).toBeInTheDocument();
expect(instagramA11yText).toHaveTextContent("footerInstagramA11yText");
expect(instagramIcon).toBeInTheDocument();

expect(twitter).toBeInTheDocument();
expect(twitterA11yText).toHaveTextContent('footerTwitterA11yText');
expect(twitterA11yText).toHaveTextContent("footerTwitterA11yText");
expect(twitterIcon).toBeInTheDocument();

expect(copyright).toBeInTheDocument();
expect(copyright).toHaveTextContent('copyright');
expect(copyright).toHaveTextContent("copyright");
});
});
3 changes: 2 additions & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@

"footerTwitterA11yText" : "Opens the Glosseta Twitter page in a new window",
"footerGitHubA11yText" : "Opens the GitHub project repo in a new window",
"footerArweaveA11yText" : "Opens Arweave.org in a new window",
"footerInstagramA11yText" : "Opens the Glosseta Instagram page in a new window",
"footerITiktokA11yText" : "Opens the Glosseta TikTok page in a new window",

"wordOfTheDay" : "Word of the day",
"copyright" : "© Glosseta Foundation, 2023"
Expand Down
44 changes: 27 additions & 17 deletions src/components/footer/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HStack, Link, Image, chakra, VStack, Text } from "@chakra-ui/react";
import { FaGithub, FaTwitter } from "react-icons/fa";
import { FaGithub, FaTwitter, FaInstagram, FaTiktok, FaLinkedin } from "react-icons/fa";
import styles from "../../../styles/Home.module.css";
import { ExternalLinkIcon } from "@chakra-ui/icons";
import { useTranslation } from "next-i18next";
Expand Down Expand Up @@ -30,39 +30,49 @@ const Footer = (): JSX.Element => {
</Link>
<Link
padding={2}
href={"https://github.com/GlossetaFoundation/glosseta"}
href={"https://www.instagram.com/glosseta_foundation"}
display="flex"
title="github"
title="instagram"
isExternal
>
<FaGithub title="footer-github-icon" />
<FaInstagram title="footer-instagram-icon" />
<span
className={styles.visuallyhidden}
title="footer-github-a11y-text"
title="footer-instagram-a11y-text"
>
{t("footerGitHubA11yText")}
{t("footerInstagramA11yText")}
</span>
<ExternalLinkIcon mx="2px" />
</Link>
<Link
padding={2}
href={"https://www.arweave.org/"}
href={"https://www.tiktok.com/@glossetadotcom"}
display="flex"
title="arweave"
title="tiktok"
isExternal
>
<Image
borderRadius="full"
boxSize="18px"
src="/arweave_logo.png"
alt=""
title="footer-arweave-icon"
/>
<FaTiktok title="footer-tiktok-icon" />
<span
className={styles.visuallyhidden}
title="footer-arweave-a11y-text"
title="footer-tiktok-a11y-text"
>
{t("footerArweaveA11yText")}
{t("footerTiktokA11yText")}
</span>
<ExternalLinkIcon mx="2px" />
</Link>
<Link
padding={2}
href={"https://github.com/glosseta/glosseta"}
display="flex"
title="github"
isExternal
>
<FaGithub title="footer-github-icon" />
<span
className={styles.visuallyhidden}
title="footer-github-a11y-text"
>
{t("footerGitHubA11yText")}
</span>
<ExternalLinkIcon mx="2px" />
</Link>
Expand Down