From 5ef0f078222103d6a5a3be5ed4d06c0dedaae0b1 Mon Sep 17 00:00:00 2001 From: Mathias Schopmans Date: Fri, 1 Mar 2024 10:33:11 +0100 Subject: [PATCH] feat: add social links in footer --- data/config.json | 32 +++++++++- src/components/Footer/Footer.module.css | 15 ++++- src/components/Footer/Footer.tsx | 2 + .../SocialLinks/SocialLinks.module.css | 28 +++++++++ src/components/SocialLinks/SocialLinks.tsx | 58 +++++++++++++++++++ src/icons/social-facebook.svg | 4 ++ src/icons/social-github.svg | 4 ++ src/icons/social-instagram.svg | 4 ++ src/icons/social-linkedin.svg | 4 ++ src/icons/social-x.svg | 4 ++ src/icons/social-xing.svg | 4 ++ src/icons/social-youtube.svg | 4 ++ src/lib/data.ts | 4 ++ 13 files changed, 164 insertions(+), 3 deletions(-) create mode 100644 src/components/SocialLinks/SocialLinks.module.css create mode 100644 src/components/SocialLinks/SocialLinks.tsx create mode 100644 src/icons/social-facebook.svg create mode 100644 src/icons/social-github.svg create mode 100644 src/icons/social-instagram.svg create mode 100644 src/icons/social-linkedin.svg create mode 100644 src/icons/social-x.svg create mode 100644 src/icons/social-xing.svg create mode 100644 src/icons/social-youtube.svg diff --git a/data/config.json b/data/config.json index 9bf9a68..f042e05 100644 --- a/data/config.json +++ b/data/config.json @@ -83,5 +83,35 @@ "chart": { "size": 800, "blipSize": 12 - } + }, + "social": [ + { + "href": "https://www.facebook.com/aoepeople", + "icon": "facebook" + }, + { + "href": "https://twitter.com/aoepeople", + "icon": "x" + }, + { + "href": "https://www.linkedin.com/company/aoe", + "icon": "linkedIn" + }, + { + "href": "https://www.xing.com/company/aoe", + "icon": "xing" + }, + { + "href": "https://www.instagram.com/aoepeople", + "icon": "instagram" + }, + { + "href": "https://www.youtube.com/user/aoepeople", + "icon": "youtube" + }, + { + "href": "https://github.com/aoepeople", + "icon": "github" + } + ] } diff --git a/src/components/Footer/Footer.module.css b/src/components/Footer/Footer.module.css index b9f47d5..a8254af 100644 --- a/src/components/Footer/Footer.module.css +++ b/src/components/Footer/Footer.module.css @@ -11,7 +11,7 @@ .description { font-size: 12px; - margin: 0; + margin: 0 0 30px; } @media (min-width: 768px) { @@ -22,6 +22,17 @@ } .logo { - margin: 0 60px 0 0; + margin: 0; + } + + .description { + margin: 0 50px 0; + } +} + +@media (min-width: 768px) and (max-width: 1023px) { + .socialLinks { + flex-wrap: wrap; + min-width: 150px; } } diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx index 29971dc..9cbfff2 100644 --- a/src/components/Footer/Footer.tsx +++ b/src/components/Footer/Footer.tsx @@ -1,6 +1,7 @@ import logo from "../../../public/logo.svg"; import styles from "./Footer.module.css"; +import { SocialLinks } from "@/components/SocialLinks/SocialLinks"; import { getAppName, getMessages } from "@/lib/data"; export function Footer() { @@ -12,6 +13,7 @@ export function Footer() {
{appName}

{footerFootnote}

+
); diff --git a/src/components/SocialLinks/SocialLinks.module.css b/src/components/SocialLinks/SocialLinks.module.css new file mode 100644 index 0000000..2e8f6f0 --- /dev/null +++ b/src/components/SocialLinks/SocialLinks.module.css @@ -0,0 +1,28 @@ +.links { + display: flex; + align-items: center; + justify-content: center; + gap: 10px; + list-style: none; + padding: 0; +} + +.icon { + fill: var(--background); + width: 16px; + height: 16px; +} + +.link { + border: 1px solid var(--border); + background: var(--foreground); + padding: 6px; + border-radius: 50%; + + &:hover { + background: var(--background); + .icon { + fill: var(--foreground); + } + } +} diff --git a/src/components/SocialLinks/SocialLinks.tsx b/src/components/SocialLinks/SocialLinks.tsx new file mode 100644 index 0000000..8d7ec1f --- /dev/null +++ b/src/components/SocialLinks/SocialLinks.tsx @@ -0,0 +1,58 @@ +import styles from "./SocialLinks.module.css"; + +import { + SocialFacebook, + SocialGithub, + SocialInstagram, + SocialLinkedin, + SocialX, + SocialXing, + SocialYoutube, +} from "@/components/Icons"; +import { getSocialLinks } from "@/lib/data"; +import { cn } from "@/lib/utils"; + +interface SocialLinksProps { + className?: string; +} + +function getIcon(name: string) { + switch (name.toLowerCase()) { + case "facebook": + return SocialFacebook; + case "github": + return SocialGithub; + case "instagram": + return SocialInstagram; + case "linkedin": + return SocialLinkedin; + case "x": + return SocialX; + case "xing": + return SocialXing; + case "youtube": + return SocialYoutube; + default: + return null; + } +} + +export function SocialLinks({ className }: SocialLinksProps) { + const links = getSocialLinks(); + return ( + + ); +} diff --git a/src/icons/social-facebook.svg b/src/icons/social-facebook.svg new file mode 100644 index 0000000..03290a5 --- /dev/null +++ b/src/icons/social-facebook.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/src/icons/social-github.svg b/src/icons/social-github.svg new file mode 100644 index 0000000..647872a --- /dev/null +++ b/src/icons/social-github.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/src/icons/social-instagram.svg b/src/icons/social-instagram.svg new file mode 100644 index 0000000..15091f3 --- /dev/null +++ b/src/icons/social-instagram.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/src/icons/social-linkedin.svg b/src/icons/social-linkedin.svg new file mode 100644 index 0000000..ae735d1 --- /dev/null +++ b/src/icons/social-linkedin.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/src/icons/social-x.svg b/src/icons/social-x.svg new file mode 100644 index 0000000..41112ef --- /dev/null +++ b/src/icons/social-x.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/src/icons/social-xing.svg b/src/icons/social-xing.svg new file mode 100644 index 0000000..910f564 --- /dev/null +++ b/src/icons/social-xing.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/src/icons/social-youtube.svg b/src/icons/social-youtube.svg new file mode 100644 index 0000000..2c3d559 --- /dev/null +++ b/src/icons/social-youtube.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/src/lib/data.ts b/src/lib/data.ts index f1d451d..afefc93 100644 --- a/src/lib/data.ts +++ b/src/lib/data.ts @@ -36,6 +36,10 @@ export function getReleases(): string[] { return data.releases; } +export function getSocialLinks() { + return config.social; +} + export function getTags(): string[] { return data.tags; }