Skip to content

Commit 11b2fe8

Browse files
committed
feat: centralized contact info
Fixes #13 thanks @celilygt
1 parent 13bd22b commit 11b2fe8

File tree

10 files changed

+102
-265
lines changed

10 files changed

+102
-265
lines changed

public/about-me/about.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ you can find me exploring new tech or enjoying a good cup of coffee ☕.
2626
## Links
2727

2828
* [GitHub Profile](https://github.com/fezcode)
29-
* [LinkedIn Profile](https://www.linkedin.com/in/ahmedsamilbulbul)
29+
* [LinkedIn Profile](https://www.linkedin.com/in/ahmed-samil-bulbul/?locale=en_US)
3030

3131
## Publications
3232

public/site-config.piml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,15 @@
3636
(label) EMAIL
3737
(url) mailto:samil.bulbul@gmail.com
3838
(icon) EnvelopeSimple
39+
40+
> (link)
41+
(id) repo
42+
(label) REPO
43+
(url) https://github.com/fezcode/fezcode.github.io
44+
(icon) GitBranch
45+
46+
> (link)
47+
(id) website
48+
(label) WEBSITE
49+
(url) https://fezcode.com
50+
(icon) Globe

src/components/Footer.jsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
import React from 'react';
22
import { Link } from 'react-router-dom';
33
import { version } from '../version';
4+
import { useAboutData } from '../hooks/useAboutData';
45
import {
5-
XLogoIcon,
6-
GithubLogoIcon,
7-
LinkedinLogoIcon,
86
Command,
97
Terminal,
10-
RedditLogoIcon,
118
} from '@phosphor-icons/react';
129

1310
const Footer = () => {
1411
const scrollToTop = () => window.scrollTo({ top: 0, behavior: 'smooth' });
12+
const aboutData = useAboutData();
1513

1614
return (
1715
<footer className="bg-[#050505] border-t-2 border-white/10 mt-auto selection:bg-white selection:text-black">
@@ -26,8 +24,7 @@ const Footer = () => {
2624
</span>
2725
</Link>
2826
<p className="max-w-md text-gray-400 font-mono text-xs leading-relaxed uppercase tracking-widest">
29-
{'//'} A digital garden of experimental code, architectural
30-
thoughts, and creative explorations.
27+
{'//'} {aboutData.profile.tagline || 'A digital garden of experimental code, architectural thoughts, and creative explorations.'}
3128
</p>
3229
</div>
3330

@@ -125,11 +122,10 @@ const Footer = () => {
125122
Connect
126123
</h3>
127124

128-
<div className="flex gap-3 mb-8">
129-
<SocialIcon href="https://x.com/fezcoddy" icon={XLogoIcon} />
130-
<SocialIcon href="https://github.com/fezcode" icon={GithubLogoIcon} />
131-
<SocialIcon href="https://www.reddit.com/r/fezcodex/" icon={RedditLogoIcon} />
132-
<SocialIcon href="https://www.linkedin.com/in/ahmed-samil-bulbul/" icon={LinkedinLogoIcon} />
125+
<div className="flex gap-3 mb-8 flex-wrap">
126+
{aboutData.profile.links.filter(l => l.id !== 'email' && l.id !== 'website').map((link, i) => (
127+
<SocialIcon key={i} href={link.url} icon={link.icon} />
128+
))}
133129
</div>
134130

135131
<div className="space-y-3 border-t border-white/10 pt-6">

src/hooks/useAboutData.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import { useMemo } from 'react';
2+
import { useSiteConfig } from '../context/SiteConfigContext';
3+
import { aboutData as staticAboutData } from '../pages/about-views/aboutData';
4+
import {
5+
GithubLogoIcon,
6+
LinkedinLogoIcon,
7+
EnvelopeIcon,
8+
XLogoIcon,
9+
GlobeIcon,
10+
RedditLogoIcon,
11+
GitBranchIcon,
12+
EnvelopeSimpleIcon,
13+
} from '@phosphor-icons/react';
14+
15+
const ICON_MAP = {
16+
GithubLogo: GithubLogoIcon,
17+
LinkedinLogo: LinkedinLogoIcon,
18+
EnvelopeSimple: EnvelopeSimpleIcon,
19+
Envelope: EnvelopeIcon,
20+
XLogo: XLogoIcon,
21+
Globe: GlobeIcon,
22+
RedditLogo: RedditLogoIcon,
23+
GitBranch: GitBranchIcon,
24+
};
25+
26+
export const useAboutData = () => {
27+
const { config } = useSiteConfig();
28+
29+
const data = useMemo(() => {
30+
if (!config || !config.socials) return staticAboutData;
31+
32+
const socialLinks = config.socials.map((link) => {
33+
let label = link.label.charAt(0).toUpperCase() + link.label.slice(1).toLowerCase();
34+
35+
// Custom label overrides to match original style if needed
36+
if (link.id === 'twitter') label = 'X (Twitter)';
37+
if (link.id === 'github') label = 'GitHub';
38+
if (link.id === 'linkedin') label = 'LinkedIn';
39+
if (link.id === 'website') label = 'Fezcode';
40+
41+
return {
42+
id: link.id,
43+
label: label,
44+
url: link.url,
45+
icon: ICON_MAP[link.icon] || GlobeIcon,
46+
};
47+
});
48+
49+
return {
50+
...staticAboutData,
51+
profile: {
52+
...staticAboutData.profile,
53+
email: config.socials.find((s) => s.id === 'email')?.url.replace('mailto:', '') || staticAboutData.profile.email,
54+
links: socialLinks,
55+
},
56+
};
57+
}, [config]);
58+
59+
return data;
60+
};

src/hooks/useCommandRegistry.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useAnimation } from '../context/AnimationContext';
44
import { useToast } from './useToast';
55
import { useVisualSettings } from '../context/VisualSettingsContext';
66
import { useAchievements } from '../context/AchievementContext';
7+
import { useAboutData } from './useAboutData';
78
import { version } from '../version';
89
import { KEY_SIDEBAR_STATE, remove as removeLocalStorageItem } from '../utils/LocalStorageManager';
910
import LiveClock from '../components/LiveClock';
@@ -39,6 +40,7 @@ export const useCommandRegistry = ({
3940
const { isAnimationEnabled, toggleAnimation } = useAnimation();
4041
const { addToast } = useToast();
4142
const { unlockAchievement } = useAchievements();
43+
const aboutData = useAboutData();
4244

4345
const {
4446
isInverted, toggleInvert,
@@ -82,7 +84,7 @@ export const useCommandRegistry = ({
8284
},
8385
viewSource: () => {
8486
window.open(
85-
'https://github.com/fezcode/fezcode.github.io',
87+
aboutData.profile.links.find((l) => l.id === 'repo')?.url || 'https://github.com/fezcode/fezcode.github.io',
8688
'_blank',
8789
'noopener,noreferrer',
8890
);
@@ -96,28 +98,28 @@ export const useCommandRegistry = ({
9698
},
9799
sendEmailFezcode: () => {
98100
window.open(
99-
'mailto:samil.bulbul@gmail.com',
101+
aboutData.profile.links.find((l) => l.id === 'email')?.url || 'mailto:samil.bulbul@gmail.com',
100102
'_blank',
101103
'noopener,noreferrer',
102104
);
103105
},
104106
openGitHub: () => {
105107
window.open(
106-
'https://github.com/fezcode',
108+
aboutData.profile.links.find((l) => l.id === 'github')?.url || 'https://github.com/fezcode',
107109
'_blank',
108110
'noopener,noreferrer',
109111
);
110112
},
111113
openTwitter: () => {
112114
window.open(
113-
'https://x.com/fezcoddy',
115+
aboutData.profile.links.find((l) => l.id === 'twitter')?.url || 'https://x.com/fezcoddy',
114116
'_blank',
115117
'noopener,noreferrer',
116118
);
117119
},
118120
openLinkedIn: () => {
119121
window.open(
120-
'https://www.linkedin.com/in/ahmed-samil-bulbul/?locale=en_US',
122+
aboutData.profile.links.find((l) => l.id === 'linkedin')?.url || 'https://www.linkedin.com/in/ahmed-samil-bulbul/?locale=en_US',
121123
'_blank',
122124
'noopener,noreferrer',
123125
);
@@ -499,7 +501,8 @@ export const useCommandRegistry = ({
499501
const issueBody = encodeURIComponent(
500502
`Found an issue on:\n${window.location.href}\n\n[Please describe the issue here]`,
501503
);
502-
const githubIssueUrl = `https://github.com/fezcode/fezcode.github.io/issues/new?title=${issueTitle}&body=${issueBody}`;
504+
const repoUrl = aboutData.profile.links.find((l) => l.id === 'repo')?.url || 'https://github.com/fezcode/fezcode.github.io';
505+
const githubIssueUrl = `${repoUrl}/issues/new?title=${issueTitle}&body=${issueBody}`;
503506
window.open(githubIssueUrl, '_blank', 'noopener,noreferrer');
504507
addToast({
505508
title: 'GitHub Issue',
@@ -530,6 +533,7 @@ export const useCommandRegistry = ({
530533
toggleAnimation,
531534
unlockAchievement,
532535
toggleDigitalRain,
536+
aboutData,
533537

534538
// Visual Settings dependencies
535539
isInverted, toggleInvert,

src/pages/AboutPage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const ViewSwitcher = ({ currentView }) => {
2525
const views = [
2626
{ id: 'brutalist', icon: BugIcon, label: 'Brutalist' },
2727
{ id: 'dossier', icon: ArticleIcon, label: 'Dossier' },
28-
{ id: 'hud', icon: TerminalIcon, label: 'TerminalIcon' },
28+
{ id: 'hud', icon: TerminalIcon, label: 'The Terminal' },
2929
{ id: 'blueprint', icon: TreeStructureIcon, label: 'Blueprint' },
3030
{ id: 'map', icon: GraphIcon, label: 'Mind Map' },
3131
];

0 commit comments

Comments
 (0)