All files / components/SocialLinks SocialLinks.tsx

100% Statements 5/5
91.66% Branches 11/12
100% Functions 1/1
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86    2x   2x   2x               8x                                                                                                                                           2x  
/* eslint-disable no-ternary, max-lines-per-function */
 
import { Li, Ul } from "./styled"
import { ComponentProps } from "."
import SocialLink from "./SocialLink"
 
const SocialLinks = ({
  facebook,
  instagram,
  reddit,
  twitterX,
  website,
  youtube
}: ComponentProps) => (
  <Ul aria-label="Social Links">
    {instagram ? (
      <Li aria-label="Instagram">
        <SocialLink
          iconGroup="fa6"
          iconName="FaInstagram"
          link={`https://instagram.com/${instagram}`}
          name={instagram}
          platformName="Instagram"
        />
      </Li>
    ) : null}
    {facebook ? (
      <Li aria-label="Facebook">
        <SocialLink
          iconGroup="fa6"
          iconName="FaFacebook"
          link={`https://facebook.com/${facebook}`}
          name={facebook}
          platformName="Facebook"
        />
      </Li>
    ) : null}
    {twitterX ? (
      <Li aria-label="Twitter X">
        <SocialLink
          iconGroup="fa6"
          iconName="FaXTwitter"
          link={`https://twitter.com/${twitterX}`}
          name={twitterX}
          platformName="Twitter X"
        />
      </Li>
    ) : null}
    {youtube ? (
      <Li aria-label="YouTube">
        <SocialLink
          iconGroup="fa6"
          iconName="FaYoutube"
          link={`https://youtube.com/${youtube}`}
          name={youtube}
          platformName="YouTube"
        />
      </Li>
    ) : null}
    {reddit ? (
      <Li aria-label="Reddit">
        <SocialLink
          iconGroup="fa6"
          iconName="FaReddit"
          link={`https://reddit.com/user/${reddit}`}
          name={reddit}
          platformName="Reddit"
        />
      </Li>
    ) : null}
    {website ? (
      <Li aria-label="Website">
        <SocialLink
          iconGroup="io5"
          iconName="IoGlobeOutline"
          link={website}
          name={website.replace(/https?:\/\//u, "")}
          platformName="Website"
        />
      </Li>
    ) : null}
  </Ul>
)
 
export default SocialLinks