1
1
import React from "react" ;
2
- import { ListGroup , ListGroupItem } from "reactstrap" ;
2
+ import { Col , Row } from "reactstrap" ;
3
3
import { SITE_TITLE , siteSpecific , SOCIAL_LINKS } from "../../../services" ;
4
4
import { ExternalLink } from "../ExternalLink" ;
5
+ import chunk from 'lodash/chunk' ;
5
6
6
7
const getSocialIcon = ( name : string ) => {
7
8
if ( name === "x (twitter)" ) {
@@ -11,33 +12,36 @@ const getSocialIcon = (name: string) => {
11
12
} ;
12
13
13
14
export const SocialLinksRow = ( ) => {
15
+ const linksByColumn = chunk ( Object . entries ( SOCIAL_LINKS ) , 2 ) ;
14
16
return (
15
17
< div className = 'footer-links footer-links-social' >
16
18
{
17
19
siteSpecific (
18
20
// Physics
19
21
< >
20
- < h5 > Get social</ h5 >
21
- < ListGroup className = 'mt-3 pb-5 py-lg-3 link-list d-md-flex flex-row' >
22
- { Object . entries ( SOCIAL_LINKS ) . map ( ( [ _ , { name, href} ] ) =>
23
- < ListGroupItem key = { name } className = 'border-0 px-0 py-0 pb-1 bg-transparent' >
24
- < ExternalLink href = { href } >
25
- < img src = { getSocialIcon ( name . toLowerCase ( ) ) } alt = { `${ SITE_TITLE } on ${ name } ` }
26
- className = 'social-logo' />
27
- </ ExternalLink >
28
- </ ListGroupItem >
29
- ) }
30
- </ ListGroup >
22
+ < h5 > Get social</ h5 >
23
+ < Row >
24
+ { linksByColumn . map ( ( column , index ) => (
25
+ < Col key = { index } >
26
+ { column . map ( ( [ _ , { name, href} ] ) =>
27
+ < ExternalLink href = { href } key = { name } >
28
+ < img src = { getSocialIcon ( name . toLowerCase ( ) ) } alt = { `${ SITE_TITLE } on ${ name } ` }
29
+ className = 'social-logo' />
30
+ </ ExternalLink >
31
+ ) }
32
+ </ Col >
33
+ ) ) }
34
+ </ Row >
31
35
</ > ,
32
36
// CS
33
37
< >
34
- < h2 > Get social</ h2 >
38
+ < h2 > Get social</ h2 >
35
39
< div className = 'mt-1 text-nowrap' >
36
40
{ Object . entries ( SOCIAL_LINKS ) . map ( ( [ _ , { name, href} ] ) =>
37
41
< div className = { "me-3 d-inline-block" } key = { name } >
38
42
< ExternalLink href = { href } >
39
43
< img src = { getSocialIcon ( name . toLowerCase ( ) ) } alt = { `${ SITE_TITLE } on ${ name } ` }
40
- className = 'img-fluid footer-social-logo' />
44
+ className = 'img-fluid footer-social-logo' />
41
45
</ ExternalLink >
42
46
</ div >
43
47
) }
0 commit comments