Skip to content

Commit

Permalink
Adding social icons to client side
Browse files Browse the repository at this point in the history
  • Loading branch information
amankumarrr committed Oct 20, 2024
1 parent de23373 commit d463c23
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
6 changes: 5 additions & 1 deletion components/layout/footer/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import dynamic from "next/dynamic";
import { SocialIcons } from "../../socialIcons/socialIcons";
import { Container } from "../../util/container";
import { CopyrightInfo } from "./copyright-info";
import { DeploymentInfo } from "./deployment-info";

const SocialIcons = dynamic(
() => import("../../socialIcons/socialIcons").then((x) => x.SocialIcons),
{ ssr: false }
);

const SiteInfo = dynamic(() => import("./site-info").then((x) => x.SiteInfo), {
ssr: false,
});
Expand Down
41 changes: 29 additions & 12 deletions components/socialIcons/socialIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,35 @@
import classNames from "classnames";
import React, { useEffect, useState } from "react";
import { isMobile } from "react-device-detect";
import { IconType } from "react-icons";

import {
FaFacebookF,
FaGithub,
FaInstagram,
FaLinkedinIn,
FaMeetup,
FaTiktok,
FaYoutube,
} from "react-icons/fa";

const FaFacebookF = dynamic(() =>
import("react-icons/fa").then((module) => ({ default: module.FaFacebookF }))
);
const FaGithub = dynamic(() =>
import("react-icons/fa").then((module) => ({ default: module.FaGithub }))
);
const FaInstagram = dynamic(() =>
import("react-icons/fa").then((module) => ({ default: module.FaInstagram }))
);
const FaLinkedinIn = dynamic(() =>
import("react-icons/fa").then((module) => ({ default: module.FaLinkedinIn }))
);
const FaMeetup = dynamic(() =>
import("react-icons/fa").then((module) => ({ default: module.FaMeetup }))
);
const FaTiktok = dynamic(() =>
import("react-icons/fa").then((module) => ({ default: module.FaTiktok }))
);
const FaYoutube = dynamic(() =>
import("react-icons/fa").then((module) => ({ default: module.FaYoutube }))
);

const IconType = dynamic(
() => import("react-icons").then((mod) => mod.default),
{ ssr: false }
);

import dynamic from "next/dynamic";
import { FaXTwitter } from "react-icons/fa6";
import layoutData from "../../content/global/index.json";
import { CustomLink } from "../customLink";
Expand All @@ -30,7 +47,7 @@ export type SocialTypes =

export const socialStyles: Record<
SocialTypes,
{ icon: IconType; bgClassName: string; fill?: string }
{ icon: typeof IconType; bgClassName: string; fill?: string }
> = {
youtube: {
icon: FaYoutube,
Expand Down

0 comments on commit d463c23

Please sign in to comment.