refactor(client): simply landing query (#38935)

This commit is contained in:
Oliver Eyton-Williams
2020-05-28 17:26:48 +02:00
committed by GitHub
parent fcef62d5de
commit a9acf11209
2 changed files with 7 additions and 17 deletions

View File

@ -14,7 +14,7 @@ import './landing.css';
import '../Map/map.css'; import '../Map/map.css';
const propTypes = { const propTypes = {
edges: PropTypes.array nodes: PropTypes.array
}; };
const BigCallToAction = () => ( const BigCallToAction = () => (
@ -38,8 +38,8 @@ const AsFeaturedSection = () => (
</Row> </Row>
); );
export const Landing = ({ edges }) => { export const Landing = ({ nodes }) => {
const superBlocks = uniq(edges.map(element => element.node.superBlock)); const superBlocks = uniq(nodes.map(node => node.superBlock));
const interviewPrep = superBlocks.splice(-1); const interviewPrep = superBlocks.splice(-1);
return ( return (
<Fragment> <Fragment>

View File

@ -7,10 +7,10 @@ import { AllChallengeNode } from '../redux/propTypes';
export const IndexPage = ({ export const IndexPage = ({
data: { data: {
allChallengeNode: { edges } allChallengeNode: { nodes }
} }
}) => { }) => {
return <Landing edges={edges} />; return <Landing nodes={nodes} />;
}; };
const propTypes = { const propTypes = {
@ -30,18 +30,8 @@ export const query = graphql`
filter: { isHidden: { eq: false } } filter: { isHidden: { eq: false } }
sort: { fields: [superOrder, order, challengeOrder] } sort: { fields: [superOrder, order, challengeOrder] }
) { ) {
edges { nodes {
node { superBlock
fields {
slug
blockName
}
id
block
title
superBlock
dashedName
}
} }
} }
} }