2018-04-06 14:51:52 +01:00
|
|
|
/* global graphql */
|
2018-06-01 03:36:42 +05:30
|
|
|
/* eslint-disable max-len */
|
2018-03-26 13:01:24 +01:00
|
|
|
import React from 'react';
|
2018-04-06 14:51:52 +01:00
|
|
|
import PropTypes from 'prop-types';
|
2018-09-11 15:35:46 +03:00
|
|
|
import { Link } from 'gatsby';
|
2018-04-06 14:51:52 +01:00
|
|
|
import Helmet from 'react-helmet';
|
2018-05-18 14:54:21 +01:00
|
|
|
import { connect } from 'react-redux';
|
2018-03-26 13:01:24 +01:00
|
|
|
|
2018-06-01 03:36:42 +05:30
|
|
|
import {
|
|
|
|
ChallengeNode,
|
|
|
|
AllChallengeNode,
|
|
|
|
AllMarkdownRemark
|
|
|
|
} from '../redux/propTypes';
|
2018-05-30 17:08:21 -05:00
|
|
|
import Spacer from '../components/util/Spacer';
|
2018-06-01 03:36:42 +05:30
|
|
|
import Map from '../components/Map';
|
2018-04-06 14:51:52 +01:00
|
|
|
|
|
|
|
import './index.css';
|
|
|
|
|
2018-05-18 14:54:21 +01:00
|
|
|
const mapStateToProps = () => ({});
|
|
|
|
|
2018-04-06 14:51:52 +01:00
|
|
|
const propTypes = {
|
|
|
|
data: PropTypes.shape({
|
2018-06-01 03:36:42 +05:30
|
|
|
challengeNode: ChallengeNode,
|
|
|
|
allChallengeNode: AllChallengeNode,
|
|
|
|
allMarkdownRemark: AllMarkdownRemark
|
2018-06-07 23:13:33 +01:00
|
|
|
})
|
2018-04-06 14:51:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
const IndexPage = ({
|
2018-06-01 03:36:42 +05:30
|
|
|
data: {
|
|
|
|
challengeNode: { fields: { slug } },
|
|
|
|
allChallengeNode: { edges },
|
|
|
|
allMarkdownRemark: { edges: mdEdges }
|
|
|
|
}
|
2018-04-06 14:51:52 +01:00
|
|
|
}) => (
|
|
|
|
<div className='index-page-wrapper'>
|
|
|
|
<Helmet title='Welcome to learn.freeCodeCamp!' />
|
2018-05-30 17:08:21 -05:00
|
|
|
<Spacer />
|
|
|
|
<Spacer />
|
|
|
|
<h2>Welcome to the freeCodeCamp curriculum</h2>
|
2018-05-18 14:54:21 +01:00
|
|
|
<p>We have thousands of coding lessons to help you improve your skills.</p>
|
2018-06-01 03:36:42 +05:30
|
|
|
<p>You can earn each certification by completing its 5 final projects.</p>
|
2018-04-06 14:51:52 +01:00
|
|
|
<p>
|
2018-06-01 03:36:42 +05:30
|
|
|
And yes - all of this is 100% free, thanks to the thousands of campers who{' '}
|
2018-04-06 14:51:52 +01:00
|
|
|
<a href='https://donate.freecodecamp.org' target='_blank'>
|
|
|
|
donate
|
|
|
|
</a>{' '}
|
|
|
|
to our nonprofit.
|
|
|
|
</p>
|
|
|
|
<p>
|
2018-06-01 03:36:42 +05:30
|
|
|
If you are new to coding, we recommend you{' '}
|
|
|
|
<Link to={slug}>start at the beginning</Link>.
|
2018-04-06 14:51:52 +01:00
|
|
|
</p>
|
2018-06-01 03:36:42 +05:30
|
|
|
<Spacer />
|
|
|
|
<Map
|
|
|
|
introNodes={mdEdges.map(({ node }) => node)}
|
|
|
|
nodes={edges
|
|
|
|
.map(({ node }) => node)
|
|
|
|
.filter(({ isPrivate }) => !isPrivate)}
|
|
|
|
/>
|
2018-03-26 13:01:24 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
2018-04-06 14:51:52 +01:00
|
|
|
IndexPage.displayName = 'IndexPage';
|
|
|
|
IndexPage.propTypes = propTypes;
|
|
|
|
|
2018-06-07 23:13:33 +01:00
|
|
|
export default connect(mapStateToProps)(IndexPage);
|
2018-04-06 14:51:52 +01:00
|
|
|
|
|
|
|
export const query = graphql`
|
|
|
|
query FirstChallenge {
|
|
|
|
challengeNode(order: { eq: 0 }, suborder: { eq: 1 }) {
|
|
|
|
fields {
|
|
|
|
slug
|
2018-06-01 03:36:42 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
allChallengeNode(
|
|
|
|
filter: { isPrivate: { eq: false } }
|
|
|
|
sort: { fields: [superOrder, order, suborder] }
|
|
|
|
) {
|
|
|
|
edges {
|
|
|
|
node {
|
|
|
|
fields {
|
|
|
|
slug
|
|
|
|
blockName
|
|
|
|
}
|
|
|
|
id
|
|
|
|
block
|
|
|
|
title
|
|
|
|
isRequired
|
|
|
|
isPrivate
|
|
|
|
superBlock
|
|
|
|
dashedName
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
allMarkdownRemark(filter: { frontmatter: { block: { ne: null } } }) {
|
|
|
|
edges {
|
|
|
|
node {
|
|
|
|
frontmatter {
|
|
|
|
title
|
|
|
|
block
|
|
|
|
}
|
|
|
|
fields {
|
|
|
|
slug
|
|
|
|
}
|
|
|
|
}
|
2018-04-06 14:51:52 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|