1+ import Image from 'next/image' ;
2+
13import clsxm from '@/lib/clsxm' ;
2- import trackClick from '@/lib/trackClick' ;
34
45interface Props {
56 className ?: string ;
67 trackingContext : string ;
78}
89
10+ const Socials = {
11+ Discord : {
12+ url : 'https://discord.com/invite/VsPbrK2hJk' ,
13+ imgSrc : '/icons/discord.svg' ,
14+ } ,
15+ Twitter : {
16+ url : 'https://twitter.com/solana' ,
17+ imgSrc : '/icons/twitter.svg' ,
18+ } ,
19+ Github : {
20+ url : 'https://github.com/solana-labs/governance-ui' ,
21+ imgSrc : '/icons/github.svg' ,
22+ } ,
23+ } ;
24+
925const SocialIcons = ( props : Props ) => {
1026 return (
1127 < div
@@ -17,33 +33,20 @@ const SocialIcons = (props: Props) => {
1733 ) }
1834 >
1935 < div className = 'flex gap-x-4 md:gap-x-5' >
20- < a
21- rel = 'noreferrer'
22- target = '_blank'
23- href = 'https://discord.com/invite/VsPbrK2hJk'
24- className = 'shadow-sm duration-500 hover:scale-125 focus:scale-125'
25- onClick = { ( ) => trackClick ( 'discord' , props . trackingContext ) }
26- >
27- < img src = '/icons/discord.svg' className = 'h-11' alt = 'discord' />
28- </ a >
29- < a
30- rel = 'noreferrer'
31- target = '_blank'
32- href = 'https://twitter.com/solana'
33- className = 'shadow-sm duration-500 hover:scale-125 focus:scale-125'
34- onClick = { ( ) => trackClick ( 'twitter' , props . trackingContext ) }
35- >
36- < img src = '/icons/twitter.svg' className = 'h-11' alt = 'twitter' />
37- </ a >
38- < a
39- rel = 'noreferrer'
40- target = '_blank'
41- href = 'https://github.com/solana-labs/governance-ui'
42- className = 'shadow-sm duration-500 hover:scale-125 focus:scale-125'
43- onClick = { ( ) => trackClick ( 'github' , props . trackingContext ) }
44- >
45- < img src = '/icons/github.svg' className = 'h-11' alt = 'github' />
46- </ a >
36+ { Object . keys ( Socials ) . map ( ( name ) => {
37+ const { url, imgSrc } = Socials [ name ] ;
38+ return (
39+ < a
40+ key = { name }
41+ rel = 'noreferrer'
42+ target = '_blank'
43+ href = { url }
44+ className = 'default-transition text-base duration-500 hover:scale-125'
45+ >
46+ < Image src = { imgSrc } width = { 48 } height = { 48 } alt = { name } />
47+ </ a >
48+ ) ;
49+ } ) }
4750 </ div >
4851 </ div >
4952 ) ;
0 commit comments