|
| 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 | +} |
0 commit comments