Skip to content

Commit 318d596

Browse files
committed
Fit physics footer links on single row
1 parent c020430 commit 318d596

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/app/components/elements/list-groups/SocialLinks.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from "react";
22
import {Col, Row} from "reactstrap";
33
import {SITE_TITLE, siteSpecific, SOCIAL_LINKS} from "../../../services";
44
import {ExternalLink} from "../ExternalLink";
5-
import chunk from 'lodash/chunk';
65

76
const getSocialIcon = (name: string) => {
87
if (name === "x (twitter)") {
@@ -12,7 +11,7 @@ const getSocialIcon = (name: string) => {
1211
};
1312

1413
export const SocialLinksRow = () => {
15-
const linksByColumn = chunk(Object.entries(SOCIAL_LINKS), 2);
14+
const links = Object.entries(SOCIAL_LINKS);
1615
return (
1716
<div className='footer-links footer-links-social'>
1817
{
@@ -21,14 +20,12 @@ export const SocialLinksRow = () => {
2120
<>
2221
<h5>Get social</h5>
2322
<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-
)}
23+
{links.map(([_, {name, href}], index) => (
24+
<Col key={index} className="col-4">
25+
<ExternalLink href={href} key={name}>
26+
<img src={getSocialIcon(name.toLowerCase())} alt={`${SITE_TITLE} on ${name}`}
27+
className='social-logo'/>
28+
</ExternalLink>
3229
</Col>
3330
))}
3431
</Row>
@@ -37,7 +34,7 @@ export const SocialLinksRow = () => {
3734
<>
3835
<h2>Get social</h2>
3936
<div className='mt-1 text-nowrap'>
40-
{Object.entries(SOCIAL_LINKS).map(([_, {name, href}]) =>
37+
{links.map(([_, {name, href}]) =>
4138
<div className={"me-3 d-inline-block"} key={name}>
4239
<ExternalLink href={href}>
4340
<img src={getSocialIcon(name.toLowerCase())} alt={`${SITE_TITLE} on ${name}`}

0 commit comments

Comments
 (0)