Skip to content

Commit 6d72a74

Browse files
committed
feat: add Footer component with social links and navigation
1 parent 58b5d49 commit 6d72a74

File tree

4 files changed

+115
-0
lines changed

4 files changed

+115
-0
lines changed

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@fontsource-variable/mulish": "^5.2.5",
2121
"@fontsource/space-mono": "^5.2.5",
2222
"@hookform/resolvers": "^5.0.1",
23+
"@icons-pack/react-simple-icons": "^12.7.0",
2324
"@radix-ui/react-dialog": "^1.1.7",
2425
"@radix-ui/react-label": "^2.1.3",
2526
"@radix-ui/react-select": "^2.2.2",

src/components/Footer.tsx

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
import { cn } from '@/lib/utils';
2+
import {
3+
SiDiscord,
4+
SiMedium,
5+
SiTelegram,
6+
SiX,
7+
SiYoutube,
8+
} from '@icons-pack/react-simple-icons';
9+
import { Link } from '@tanstack/react-router';
10+
import { Linkedin } from 'lucide-react';
11+
import iExecLogo from '../assets/iexec-logo.svg';
12+
import { Button } from './ui/button';
13+
14+
export function Footer({ className }: { className?: string }) {
15+
const navLinks = [
16+
{ href: 'https://www.iex.ec/', label: 'iExec Website' },
17+
{ href: 'https://blockscout-bellecour.iex.ec/', label: 'Blockscout' },
18+
{ href: 'https://www.iex.ec/contact', label: 'Contact Us' },
19+
];
20+
21+
const socialLinks = [
22+
{ href: 'https://twitter.com/iEx_ec', icon: <SiX size={16} /> },
23+
{ href: 'https://discord.gg/pbt9m98wnU', icon: <SiDiscord size={16} /> },
24+
{ href: 'https://t.me/iexec_rlc_official', icon: <SiTelegram size={16} /> },
25+
{
26+
href: 'https://www.youtube.com/channel/UCwWxZWvKVHn3CXnmDooLWtA',
27+
icon: <SiYoutube size={16} />,
28+
},
29+
{
30+
href: 'https://www.linkedin.com/company/iex.ec/',
31+
icon: <Linkedin size={16} />,
32+
},
33+
{ href: 'https://medium.com/iex-ec', icon: <SiMedium size={16} /> },
34+
];
35+
36+
const startYear = 2025;
37+
const currentYear = new Date().getFullYear();
38+
const displayYear =
39+
currentYear > startYear
40+
? `${startYear} - ${currentYear}`
41+
: `${currentYear}`;
42+
43+
return (
44+
<footer
45+
className={cn(
46+
'bg-grey-800 border-muted text-grey-200 rounded-3xl border p-10 sm:p-20',
47+
className
48+
)}
49+
>
50+
<div className="grid place-items-center justify-center gap-10 xl:grid-cols-3 xl:place-items-stretch">
51+
<Link to="/" className="flex items-center gap-2 font-mono">
52+
<img src={iExecLogo} width="25" height="25" alt="iExec logo" />
53+
<span className="hidden sm:block">iExec Explorer</span>
54+
</Link>
55+
56+
<nav className="flex flex-col items-start gap-4 sm:flex-row sm:items-center sm:gap-4">
57+
{navLinks.map(({ href, label }, idx) => (
58+
<div key={idx} className="flex items-center gap-2">
59+
<Button
60+
asChild
61+
variant="link"
62+
className="text-grey-200 p-2 font-mono"
63+
>
64+
<a href={href} target="_blank" rel="noopener noreferrer">
65+
{label}
66+
</a>
67+
</Button>
68+
{idx < navLinks.length - 1 && (
69+
<span className="bg-grey-200 hidden size-1.5 rounded-full sm:block" />
70+
)}
71+
</div>
72+
))}
73+
</nav>
74+
75+
<div className="flex items-center xl:justify-end">
76+
{socialLinks.map(({ href, icon }, idx) => (
77+
<Button
78+
key={idx}
79+
asChild
80+
variant="link"
81+
className="text-grey-200 p-2"
82+
>
83+
<a
84+
href={href}
85+
target="_blank"
86+
rel="noopener noreferrer"
87+
aria-label="Social link"
88+
>
89+
{icon}
90+
</a>
91+
</Button>
92+
))}
93+
</div>
94+
</div>
95+
96+
<hr className="border-grey-500 mt-10 mb-4" />
97+
<p className="w-full text-center text-sm">
98+
© All Rights Reserved {displayYear}
99+
</p>
100+
</footer>
101+
);
102+
}

src/routes/__root.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createRootRoute, Outlet } from '@tanstack/react-router';
22
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools';
3+
import { Footer } from '@/components/Footer';
34
import { Navbar } from '@/components/navbar/NavBar';
45
import { useWatchAccount } from '@/hooks/useWatchAccount';
56

@@ -14,6 +15,7 @@ function Root() {
1415
<div className="mx-auto mb-20 w-full px-6 md:px-10 lg:px-20">
1516
<Navbar />
1617
<Outlet />
18+
<Footer className="mt-32" />
1719
<TanStackRouterDevtools />
1820
</div>
1921
);

0 commit comments

Comments
 (0)