From 45e4a770a23ddecd1be209cd7d8f1456c459aa73 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Wed, 12 Aug 2020 13:26:21 +0200 Subject: [PATCH] fix: robust Certifications/Additional learning split --- client/src/components/landing/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/src/components/landing/index.js b/client/src/components/landing/index.js index f6de7ecef5..05e0217302 100644 --- a/client/src/components/landing/index.js +++ b/client/src/components/landing/index.js @@ -4,7 +4,7 @@ import { Grid, Row, Col } from '@freecodecamp/react-bootstrap'; import Helmet from 'react-helmet'; import PropTypes from 'prop-types'; import { Link } from 'gatsby'; -import { uniq } from 'lodash'; +import { uniq, partition } from 'lodash'; import { Spacer } from '../helpers'; import Login from '../Header/components/Login'; import CompanyLogos from './components/CompanyLogos'; @@ -39,8 +39,11 @@ const AsFeaturedSection = () => ( ); export const Landing = ({ nodes }) => { - const superBlocks = uniq(nodes.map(node => node.superBlock)); - const interviewPrep = superBlocks.splice(-1); + const [superBlocks, rest] = partition( + uniq(nodes.map(node => node.superBlock)), + name => name !== 'Coding Interview Prep' + ); + const interviewPrep = rest[0]; return (