@@ -13,15 +13,7 @@ import iExecLogo from '../assets/iexec-logo.svg';
1313import { ChainLink } from './ChainLink' ;
1414import { Button } from './ui/button' ;
1515
16- export function Footer ( { className } : { className ?: string } ) {
17- const { chainId } = useUserStore ( ) ;
18-
19- const navLinks = [
20- { href : 'https://www.iex.ec/' , label : 'iExec Website' } ,
21- { href : getBlockExplorerUrl ( chainId ) , label : 'Block explorer' } ,
22- { href : 'https://www.iex.ec/contact' , label : 'Contact Us' } ,
23- ] ;
24-
16+ function SocialLinksItems ( { className } : { className ?: string } ) {
2517 const socialLinks = [
2618 { href : 'https://twitter.com/iEx_ec' , icon : < SiX size = { 16 } /> } ,
2719 { href : 'https://discord.gg/pbt9m98wnU' , icon : < SiDiscord size = { 16 } /> } ,
@@ -36,6 +28,36 @@ export function Footer({ className }: { className?: string }) {
3628 } ,
3729 { href : 'https://medium.com/iex-ec' , icon : < SiMedium size = { 16 } /> } ,
3830 ] ;
31+ return (
32+ < div className = { cn ( 'flex' , className ) } >
33+ { socialLinks . map ( ( { href, icon } , idx ) => (
34+ < Button key = { idx } asChild variant = "link" className = "text-grey-200 p-2" >
35+ < a
36+ href = { href }
37+ target = "_blank"
38+ rel = "noopener noreferrer"
39+ aria-label = "Social link"
40+ >
41+ { icon }
42+ </ a >
43+ </ Button >
44+ ) ) }
45+ </ div >
46+ ) ;
47+ }
48+
49+ export function Footer ( { className } : { className ?: string } ) {
50+ const { chainId } = useUserStore ( ) ;
51+
52+ const navLinks = [
53+ { href : 'https://www.iex.ec/' , label : 'iExec Website' } ,
54+ { href : 'https://tools.docs.iex.ec/' , label : 'Doc tools' } ,
55+ { href : 'https://protocol.docs.iex.ec/' , label : 'Doc protocol' } ,
56+ ...( chainId !== undefined
57+ ? [ { href : getBlockExplorerUrl ( chainId ) , label : 'Block explorer' } ]
58+ : [ ] ) ,
59+ { href : 'https://www.iex.ec/contact' , label : 'Contact Us' } ,
60+ ] ;
3961
4062 const startYear = 2017 ;
4163 const currentYear = new Date ( ) . getFullYear ( ) ;
@@ -47,17 +69,17 @@ export function Footer({ className }: { className?: string }) {
4769 return (
4870 < footer
4971 className = { cn (
50- 'bg-grey-800 border-muted text-grey-200 relative rounded-3xl border px-6 py-10 sm:px-10 lg:px-20' ,
72+ 'bg-grey-800 border-muted text-grey-200 flex flex-col gap-6 rounded-3xl border px-6 py-10 sm:px-10 lg:px-20' ,
5173 className
5274 ) }
5375 >
54- < div className = "grid place- items-center justify-center gap-10 xl:grid-cols-2 xl:place-items-stretch " >
76+ < div className = "flex flex-col items-center justify-between gap-10 xl:flex-row " >
5577 < ChainLink to = "/" className = "flex items-center gap-2 font-mono" >
5678 < img src = { iExecLogo } width = "25" height = "25" alt = "iExec logo" />
5779 < span > iExec Explorer</ span >
5880 </ ChainLink >
5981
60- < nav className = "flex flex-col items-center gap-2 sm :flex-row sm :gap-4 xl:absolute xl:left-1/2 xl:-translate-x-1/2 " >
82+ < nav className = "flex flex-col items-center gap-2 md :flex-row md :gap-4" >
6183 { navLinks . map ( ( { href, label } , idx ) => (
6284 < div key = { idx } className = "flex items-center gap-2" >
6385 < Button
@@ -70,37 +92,22 @@ export function Footer({ className }: { className?: string }) {
7092 </ a >
7193 </ Button >
7294 { idx < navLinks . length - 1 && (
73- < span className = "bg-grey-200 hidden size-1.5 rounded-full sm :block" />
95+ < span className = "bg-grey-200 hidden size-1.5 rounded-full md :block" />
7496 ) }
7597 </ div >
7698 ) ) }
7799 </ nav >
78-
79- < div className = "flex items-center xl:justify-end" >
80- { socialLinks . map ( ( { href, icon } , idx ) => (
81- < Button
82- key = { idx }
83- asChild
84- variant = "link"
85- className = "text-grey-200 p-2"
86- >
87- < a
88- href = { href }
89- target = "_blank"
90- rel = "noopener noreferrer"
91- aria-label = "Social link"
92- >
93- { icon }
94- </ a >
95- </ Button >
96- ) ) }
97- </ div >
100+ < SocialLinksItems className = "xl:hidden" />
98101 </ div >
99102
100- < hr className = "border-grey-500 mt-10 mb-4" />
101- < p className = "w-full text-center text-sm" >
102- © All Rights Reserved { displayYear }
103- </ p >
103+ < hr className = "border-grey-500" />
104+
105+ < div className = "flex justify-between" >
106+ < p className = "w-full text-center text-sm xl:text-left" >
107+ © All Rights Reserved { displayYear }
108+ </ p >
109+ < SocialLinksItems className = "hidden xl:flex" />
110+ </ div >
104111 </ footer >
105112 ) ;
106113}
0 commit comments