Skip to content

Commit 48265c1

Browse files
committed
♻️ refactor(components): update contact and social components
- rename contact to contacts for consistent naming - move Socials components to shared directory - update imports to reflect new structure
1 parent 0c8eb42 commit 48265c1

6 files changed

Lines changed: 20 additions & 14 deletions

File tree

src/App.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import "./App.css";
22
import { Header } from "components/Header";
3-
import { SocialPlatformLink } from "components/Header/Socials";
3+
import { SocialPlatformLink } from "components/Socials";
44
import { AboutSection } from "components/Section/AboutSection";
5-
import { Contact, ContactSection } from "components/Section/ContactSection";
5+
import { Contacts, ContactSection } from "components/Section/ContactSection";
66
import {
77
ExperienceSection,
88
ExperienceSectionProps,
@@ -144,7 +144,7 @@ const projects: Project[] = [
144144
},
145145
];
146146

147-
const contact: Contact = {
147+
const contacts: Contacts = {
148148
tel: "(502) 220-8265",
149149
mailto: "isaacpoolemusic@gmail.com",
150150
};
@@ -157,7 +157,7 @@ function App() {
157157
<SkillsSection skills={skills} />
158158
<ExperienceSection {...experience} />
159159
<ProjectsSection projects={projects} />
160-
<ContactSection {...contact} />
160+
<ContactSection contacts={contacts} socials={socials} />
161161
</>
162162
);
163163
}

src/components/Header/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Link } from "react-scroll";
22
import { SectionLabels, SectionType } from "consts";
33
import styles from "./index.module.css";
4-
import { SocialPlatformLink, Socials } from "./Socials";
4+
import { SocialPlatformLink, Socials } from "../Socials";
55

66
export interface HeaderProps {
77
sections: readonly SectionType[];
Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
11
import { Section } from "components/Section";
2-
import { Contact } from "lucide-react";
32
import { ContactIcons } from "./ContactIcons";
43
import styles from "./index.module.css";
4+
import { SocialPlatformLink, Socials } from "components/Socials";
55

6-
export interface Contact {
6+
export interface Contacts {
77
tel: `(${string}) ${string}-${string}`;
88
mailto: `${string}@${string}.${string}`;
99
}
1010

11-
const labels: Record<keyof Contact, string> = {
11+
const labels: Record<keyof Contacts, string> = {
1212
tel: "Phone",
1313
mailto: "Email",
1414
};
1515

16-
export const ContactSection = (contact: Contact) => {
16+
export interface ContactSectionProps {
17+
contacts: Contacts;
18+
socials: SocialPlatformLink[];
19+
}
20+
21+
export const ContactSection = ({ contacts, socials }: ContactSectionProps) => {
1722
return (
1823
<Section subject="contact" className={styles["contact"]}>
1924
<h3>Contact</h3>
2025
<div className={styles["container"]}>
21-
{Object.keys(contact).map((key) => {
22-
const value = contact[key as keyof Contact];
23-
const label = labels[key as keyof Contact];
24-
const icon = ContactIcons[key as keyof Contact];
26+
{Object.keys(contacts).map((key) => {
27+
const value = contacts[key as keyof Contacts];
28+
const label = labels[key as keyof Contacts];
29+
const icon = ContactIcons[key as keyof Contacts];
2530

2631
return (
27-
<a key={key} href={`${key}:${contact[key as keyof Contact]}`}>
32+
<a key={key} href={`${key}:${contacts[key as keyof Contacts]}`}>
2833
<div className={styles["icon"]}>{icon}</div>
2934
<div className={styles["text"]}>
3035
<p>{label}</p>
@@ -34,6 +39,7 @@ export const ContactSection = (contact: Contact) => {
3439
);
3540
})}
3641
</div>
42+
<Socials platforms={socials} />
3743
</Section>
3844
);
3945
};
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)