-
Notifications
You must be signed in to change notification settings - Fork 654
Expand file tree
/
Copy pathFooter.tsx
More file actions
201 lines (185 loc) · 6.48 KB
/
Copy pathFooter.tsx
File metadata and controls
201 lines (185 loc) · 6.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
'use client';
import Link from 'next/link';
import { useTranslation } from '@/context/TranslationContext';
interface FooterLink {
label: string;
href: string;
isExternal?: boolean;
}
interface SocialLink {
label: string;
href: string;
ariaLabel: string;
icon: string;
}
function LinkComponent({
href,
isExternal,
children,
className = '',
ariaLabel,
}: {
href: string;
isExternal?: boolean;
children: React.ReactNode;
className?: string;
ariaLabel?: string;
}) {
const baseClasses = `group inline-block px-1 rounded transition-all duration-300 hover:-translate-y-[2px] hover:font-medium hover:text-teal-800 dark:hover:text-violet-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 dark:focus:ring-offset-zinc-950 ${className}`;
if (isExternal) {
return (
<a
href={href}
target="_blank"
rel="noopener noreferrer"
className={baseClasses}
aria-label={ariaLabel}
>
<span className="relative inline-block">
{children}
<span className="absolute left-0 -bottom-px h-px w-0 bg-slate-500 dark:bg-slate-400 transition-all duration-500 ease-out group-hover:w-full" />
</span>
</a>
);
}
return (
<Link href={href} className={baseClasses} aria-label={ariaLabel}>
<span className="relative inline-block">
{children}
<span className="absolute left-0 -bottom-px h-px w-0 bg-slate-500 dark:bg-slate-400 transition-all duration-500 ease-out group-hover:w-full" />
</span>
</Link>
);
}
export function Footer() {
const { t } = useTranslation();
const currentYear = new Date().getFullYear();
const navigationLinks: FooterLink[] = [
{ label: t('footer.home'), href: '/', isExternal: false },
{ label: t('footer.generator'), href: '/generator', isExternal: false },
{ label: t('footer.compare'), href: '/compare', isExternal: false },
{ label: t('footer.customization'), href: '/customize', isExternal: false },
{ label: t('footer.faq'), href: '/faq', isExternal: false },
{ label: t('footer.contributors'), href: '/contributors', isExternal: false },
];
const resourceLinks: FooterLink[] = [
{
label: t('footer.documentation'),
href: 'https://github.com/JhaSourav07/commitpulse/blob/main/README.md',
isExternal: true,
},
{
label: t('footer.github_repo'),
href: 'https://github.com/JhaSourav07/commitpulse',
isExternal: true,
},
];
const socialLinks: SocialLink[] = [
{
label: t('footer.github'),
href: 'https://github.com/JhaSourav07/commitpulse',
ariaLabel: 'CommitPulse on GitHub',
icon: 'github',
},
{
label: t('footer.creator_github'),
href: 'https://github.com/jhasourav07',
ariaLabel: 'Creator Sourav Jha on GitHub',
icon: 'creator',
},
{
label: t('footer.discord'),
href: 'https://discord.gg/Cb73bS79j',
ariaLabel: 'Join CommitPulse on Discord',
icon: 'discord',
},
{
label: t('footer.twitter'),
href: 'https://x.com/JhaSourav07',
ariaLabel: 'Creator on X',
icon: 'twitter',
},
{
label: t('footer.linkedin'),
href: 'https://linkedin.com/in/souravjhahind',
ariaLabel: 'Creator on LinkedIn',
icon: 'linkedin',
},
];
return (
<footer className="mt-auto border-t border-black/5 bg-white/50 px-4 py-8 backdrop-blur dark:border-white/5 dark:bg-zinc-950/50 sm:px-6 md:py-12">
<div className="mx-auto max-w-6xl">
{/* Main Footer Content */}
<div className="grid grid-cols-2 gap-6 md:grid-cols-2 lg:grid-cols-4 mb-6">
{/* Brand Section */}
<div className="flex flex-col items-start lg:col-span-1">
<h2 className="font-bold text-lg text-black dark:text-white">CommitPulse</h2>
<p className="mt-2 text-sm text-zinc-600 dark:text-zinc-400">{t('footer.tagline')}</p>
</div>
{/* Navigation Section */}
<div className="flex flex-col items-center sm:items-start">
<h3 className="font-semibold text-sm text-black dark:text-white mb-3">
{t('footer.navigation')}
</h3>
<nav className="flex flex-col gap-2 text-center sm:text-left">
{navigationLinks.map((link) => (
<LinkComponent
key={link.href}
href={link.href}
isExternal={link.isExternal}
className="text-sm text-zinc-600 dark:text-zinc-400"
>
{link.label}
</LinkComponent>
))}
</nav>
</div>
{/* Resources Section */}
<div className="flex flex-col items-center sm:items-start">
<h3 className="font-semibold text-sm text-black dark:text-white mb-3">
{t('footer.resources')}
</h3>
<nav className="flex flex-col gap-2 text-center sm:text-left">
{resourceLinks.map((link) => (
<LinkComponent
key={link.href}
href={link.href}
isExternal={link.isExternal}
className="text-sm text-zinc-600 dark:text-zinc-400"
>
{link.label}
</LinkComponent>
))}
</nav>
</div>
{/* Connect Section */}
<div className="flex flex-col items-center sm:items-start">
<h3 className="font-semibold text-sm text-black dark:text-white mb-3">
{t('footer.connect')}
</h3>
<div className="flex flex-col gap-2 text-center sm:text-left">
{socialLinks.map((link) => (
<LinkComponent
key={link.href}
href={link.href}
isExternal
ariaLabel={link.ariaLabel}
className="text-sm text-zinc-600 dark:text-zinc-400"
>
{link.label}
</LinkComponent>
))}
</div>
</div>
</div>
{/* Divider */}
<div className="border-t border-black/5 dark:border-white/5" />
{/* Bottom Section */}
<div className="mt-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 text-xs text-zinc-500 dark:text-zinc-500">
<p>{t('footer.copyright', { year: currentYear.toString() })}</p>
<p>{t('footer.made_with')}</p>
</div>
</div>
</footer>
);
}