refactor(client): simply landing query (#38935)
This commit is contained in:
committed by
GitHub
parent
fcef62d5de
commit
a9acf11209
@ -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>
|
||||||
|
@ -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 {
|
|
||||||
fields {
|
|
||||||
slug
|
|
||||||
blockName
|
|
||||||
}
|
|
||||||
id
|
|
||||||
block
|
|
||||||
title
|
|
||||||
superBlock
|
superBlock
|
||||||
dashedName
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user