From 7923020458dea6222ceedca5cac7ea4ed41566de Mon Sep 17 00:00:00 2001 From: Eugene Fox Date: Mon, 9 Sep 2024 13:34:13 +0000 Subject: [PATCH] feat!: updated contact links section --- app/_components/Header.tsx | 3 +- app/_components/Sidemenu.tsx | 5 +-- app/_components/SocialLinks.tsx | 13 ++++---- app/_data/contacts.ts | 19 +++++------ app/_data/socials.ts | 33 ++++++++++--------- app/_page_sections/ContactSection.module.scss | 6 ++++ app/_page_sections/ContactSection.tsx | 31 +++++++---------- 7 files changed, 55 insertions(+), 55 deletions(-) diff --git a/app/_components/Header.tsx b/app/_components/Header.tsx index b01f98a..2257bbd 100644 --- a/app/_components/Header.tsx +++ b/app/_components/Header.tsx @@ -1,5 +1,6 @@ import TitleLogo from "@/_data/TitleLogo"; import links from "@/_data/links"; +import socials from "@/_data/socials"; import React from "react"; import Button from "./Button"; import cls from "./Header.module.scss"; @@ -13,7 +14,7 @@ const Header: React.FC = () => ( - + diff --git a/app/_components/SocialLinks.tsx b/app/_components/SocialLinks.tsx index 6058476..4497b73 100644 --- a/app/_components/SocialLinks.tsx +++ b/app/_components/SocialLinks.tsx @@ -1,20 +1,20 @@ -import socials from "@/_data/socials"; +import { Socials } from "@/_data/socials"; import React from "react"; import { SocialIcon, networkFor, social_icons } from "react-social-icons"; import cls from "./SocialLinks.module.scss"; -const SocialLinks: React.FC = ({ size = 50, ...props }) => ( +const SocialLinks: React.FC = ({ size = 50, socials, ...props }) => (
- { Object.entries(socials).map(([network, i]) => + { Object.entries(socials).map(([label, i]) => @@ -27,4 +27,5 @@ export default SocialLinks; export type SocialLinksProps = React.HTMLAttributes & { size?: number; + socials: Socials; }; diff --git a/app/_data/contacts.ts b/app/_data/contacts.ts index 023d983..c994ee8 100644 --- a/app/_data/contacts.ts +++ b/app/_data/contacts.ts @@ -1,5 +1,5 @@ -import socials, { Socials } from "./socials"; import Package from "@/../package.json"; +import socials, { Socials } from "./socials"; const contacts: ContactLinks = { @@ -8,21 +8,20 @@ const contacts: ContactLinks = text: Package.author.email, href: "mailto:" + Package.author.email }, - telephone: - { - text: "+7 996 929-19-69", - href: "tel:79969291969", - country: "Russia" - }, socials: { "LinkedIn": socials["LinkedIn"], - "Telegram": + "Facebook": { username: "@xfox111", - href: "https://t.me/xfox111" + href: "https://facebook.com/xfox111" }, - "Twitter": socials["Twitter"] + "WhatsApp": + { + username: "@xfox111", + href: "https://wa.me/79969291969", + network: "whatsapp" + } } }; diff --git a/app/_data/socials.ts b/app/_data/socials.ts index a2f1b25..e9e5b64 100644 --- a/app/_data/socials.ts +++ b/app/_data/socials.ts @@ -1,23 +1,23 @@ import Package from "@/../package.json"; const socials: Socials = +{ + "GitHub": { - "GitHub": - { - href: Package.author.url, - username: "@xfox111" - }, - "LinkedIn": - { - href: "https://www.linkedin.com/in/xfox/", - username: "@xfox" - }, - "Twitter": - { - href: "https://twitter.com/xfox111", - username: "@xfox111" - }, - }; + href: Package.author.url, + username: "@xfox111" + }, + "LinkedIn": + { + href: "https://www.linkedin.com/in/xfox/", + username: "@xfox" + }, + "Twitter": + { + href: "https://twitter.com/xfox111", + username: "@xfox111" + }, +}; export default socials; @@ -27,4 +27,5 @@ export type SocialLink = { href: string; username: string; + network?: string; }; diff --git a/app/_page_sections/ContactSection.module.scss b/app/_page_sections/ContactSection.module.scss index 9aaab7c..6e71237 100644 --- a/app/_page_sections/ContactSection.module.scss +++ b/app/_page_sections/ContactSection.module.scss @@ -26,6 +26,12 @@ { align-items: flex-end; text-align: right; + + .links + { + justify-content: flex-end; + flex-wrap: wrap; + } } .textarea diff --git a/app/_page_sections/ContactSection.tsx b/app/_page_sections/ContactSection.tsx index 65f6f27..d315635 100644 --- a/app/_page_sections/ContactSection.tsx +++ b/app/_page_sections/ContactSection.tsx @@ -1,6 +1,7 @@ "use client"; import Button from "@/_components/Button"; +import SocialLinks from "@/_components/SocialLinks"; import contacts from "@/_data/contacts"; import FormStatusTracker from "@/_utils/FormStatusTracker"; import React, { InputHTMLAttributes, useMemo, useState } from "react"; @@ -83,27 +84,17 @@ const ContactSection: React.FC = () =>

Direct contacts

-

- { Object.entries(socials).map(([name, i]) => - - { name + ": " } - - { i.username } - -
-
- ) } + - { phone && - - Telephone: - - { phone.text } - - ({ phone.country }) - - } -

+ { phone && +

+ Telephone: + + { phone.text } + + ({ phone.country }) +

+ }