1
0
mirror of https://github.com/XFox111/my-website.git synced 2026-04-22 07:28:01 +03:00

feat!: updated contact links section

This commit is contained in:
2024-09-09 13:34:13 +00:00
parent 812bd34ee5
commit 7923020458
7 changed files with 55 additions and 55 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import TitleLogo from "@/_data/TitleLogo"; import TitleLogo from "@/_data/TitleLogo";
import links from "@/_data/links"; import links from "@/_data/links";
import socials from "@/_data/socials";
import React from "react"; import React from "react";
import Button from "./Button"; import Button from "./Button";
import cls from "./Header.module.scss"; import cls from "./Header.module.scss";
@@ -13,7 +14,7 @@ const Header: React.FC = () => (
<TitleLogo /> <TitleLogo />
<NavigationLinks className={ cls.navigation } /> <NavigationLinks className={ cls.navigation } />
<SocialLinks className={ cls.socials } size={ 40 } /> <SocialLinks className={ cls.socials } size={ 40 } socials={ socials } />
<Button className={ cls.resume } as="next" href={ links.resume }> <Button className={ cls.resume } as="next" href={ links.resume }>
Download resume Download resume
+3 -2
View File
@@ -1,12 +1,13 @@
"use client"; "use client";
import links from "@/_data/links";
import socials from "@/_data/socials";
import { Dismiss24Regular, Navigation24Regular } from "@fluentui/react-icons"; import { Dismiss24Regular, Navigation24Regular } from "@fluentui/react-icons";
import React, { useCallback, useEffect, useRef, useState } from "react"; import React, { useCallback, useEffect, useRef, useState } from "react";
import Button, { ButtonProps } from "./Button"; import Button, { ButtonProps } from "./Button";
import NavigationLinks from "./NavigationLinks"; import NavigationLinks from "./NavigationLinks";
import cls from "./Sidemenu.module.scss"; import cls from "./Sidemenu.module.scss";
import SocialLinks from "./SocialLinks"; import SocialLinks from "./SocialLinks";
import links from "@/_data/links";
const Sidemenu: React.FC<SidemenuProps> = ({ button, ...panelProps }) => const Sidemenu: React.FC<SidemenuProps> = ({ button, ...panelProps }) =>
{ {
@@ -70,7 +71,7 @@ const Sidemenu: React.FC<SidemenuProps> = ({ button, ...panelProps }) =>
</header> </header>
<NavigationLinks className={ cls.navigation } links={ { className: cls.link } } /> <NavigationLinks className={ cls.navigation } links={ { className: cls.link } } />
<SocialLinks /> <SocialLinks socials={ socials } />
<Button className={ cls.resume } as="next" href={ links.resume }>Download resume</Button> <Button className={ cls.resume } as="next" href={ links.resume }>Download resume</Button>
</div> </div>
+7 -6
View File
@@ -1,20 +1,20 @@
import socials from "@/_data/socials"; import { Socials } from "@/_data/socials";
import React from "react"; import React from "react";
import { SocialIcon, networkFor, social_icons } from "react-social-icons"; import { SocialIcon, networkFor, social_icons } from "react-social-icons";
import cls from "./SocialLinks.module.scss"; import cls from "./SocialLinks.module.scss";
const SocialLinks: React.FC<SocialLinksProps> = ({ size = 50, ...props }) => ( const SocialLinks: React.FC<SocialLinksProps> = ({ size = 50, socials, ...props }) => (
<div aria-label="Social links" { ...props } className={ `${cls.socials} ${props.className}` }> <div aria-label="Social links" { ...props } className={ `${cls.socials} ${props.className}` }>
{ Object.entries(socials).map(([network, i]) => { Object.entries(socials).map(([label, i]) =>
<SocialIcon <SocialIcon
key={ network } title={ network } key={ label } title={ label } network={ i.network }
url={ i.href } target="_blank" url={ i.href } target="_blank"
className={ `${cls.link} ${cls[networkFor(i.href)] ?? ""}` } className={ `${cls.link} ${cls[i.network ?? networkFor(i.href)] ?? ""}` }
style={ { style={ {
// @ts-expect-error Inline variables are not supported in TS definition, but it works. // @ts-expect-error Inline variables are not supported in TS definition, but it works.
"--network-color": social_icons.get(networkFor(i.href))?.color, "--network-color": social_icons.get(i.network ?? networkFor(i.href))?.color,
width: size, width: size,
height: size height: size
} } /> } } />
@@ -27,4 +27,5 @@ export default SocialLinks;
export type SocialLinksProps = React.HTMLAttributes<HTMLDivElement> & { export type SocialLinksProps = React.HTMLAttributes<HTMLDivElement> & {
size?: number; size?: number;
socials: Socials;
}; };
+9 -10
View File
@@ -1,5 +1,5 @@
import socials, { Socials } from "./socials";
import Package from "@/../package.json"; import Package from "@/../package.json";
import socials, { Socials } from "./socials";
const contacts: ContactLinks = const contacts: ContactLinks =
{ {
@@ -8,21 +8,20 @@ const contacts: ContactLinks =
text: Package.author.email, text: Package.author.email,
href: "mailto:" + Package.author.email href: "mailto:" + Package.author.email
}, },
telephone:
{
text: "+7 996 929-19-69",
href: "tel:79969291969",
country: "Russia"
},
socials: socials:
{ {
"LinkedIn": socials["LinkedIn"], "LinkedIn": socials["LinkedIn"],
"Telegram": "Facebook":
{ {
username: "@xfox111", 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"
}
} }
}; };
+1
View File
@@ -27,4 +27,5 @@ export type SocialLink =
{ {
href: string; href: string;
username: string; username: string;
network?: string;
}; };
@@ -26,6 +26,12 @@
{ {
align-items: flex-end; align-items: flex-end;
text-align: right; text-align: right;
.links
{
justify-content: flex-end;
flex-wrap: wrap;
}
} }
.textarea .textarea
+4 -13
View File
@@ -1,6 +1,7 @@
"use client"; "use client";
import Button from "@/_components/Button"; import Button from "@/_components/Button";
import SocialLinks from "@/_components/SocialLinks";
import contacts from "@/_data/contacts"; import contacts from "@/_data/contacts";
import FormStatusTracker from "@/_utils/FormStatusTracker"; import FormStatusTracker from "@/_utils/FormStatusTracker";
import React, { InputHTMLAttributes, useMemo, useState } from "react"; import React, { InputHTMLAttributes, useMemo, useState } from "react";
@@ -83,27 +84,17 @@ const ContactSection: React.FC = () =>
<div className={ `${cls.container} ${cls.contacts}` }> <div className={ `${cls.container} ${cls.contacts}` }>
<h3>Direct contacts</h3> <h3>Direct contacts</h3>
<p> <SocialLinks socials={ socials } className={ cls.links } />
{ Object.entries(socials).map(([name, i]) =>
<span key={ name }>
<span aria-hidden>{ name + ": " }</span>
<a aria-label={ `${name}: ${i.username}` } href={ i.href } target="_blank">
{ i.username }
</a>
<br aria-hidden />
</span>
) }
{ phone && { phone &&
<span> <p>
<span aria-hidden>Telephone: </span> <span aria-hidden>Telephone: </span>
<a aria-label={ `Telephone: ${phone.text} (${phone.country})` } href={ phone.href }> <a aria-label={ `Telephone: ${phone.text} (${phone.country})` } href={ phone.href }>
{ phone.text } { phone.text }
</a> </a>
<span aria-hidden> ({ phone.country })</span> <span aria-hidden> ({ phone.country })</span>
</span>
}
</p> </p>
}
<Button href={ email.href } target="_blank"> <Button href={ email.href } target="_blank">
{ email.text } { email.text }