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 16:10:21 +03:00
|
|
|
import { Link, graphql } 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-09-30 11:37:19 +01:00
|
|
|
|
|
|
|
import LearnLayout from '../components/layouts/Learn';
|
|
|
|
import Spacer from '../components/helpers/Spacer';
|
2018-06-01 03:36:42 +05:30
|
|
|
import Map from '../components/Map';
|
2018-04-06 14:51:52 +01:00
|
|
|
|
2018-09-30 11:37:19 +01:00
|
|
|
import './learn.css';
|
2018-04-06 14:51:52 +01:00
|
|
|
|
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: {
|
2018-09-30 11:37:19 +01:00
|
|
|
challengeNode: {
|
|
|
|
fields: { slug }
|
|
|
|
},
|
2018-06-01 03:36:42 +05:30
|
|
|
allChallengeNode: { edges },
|
|
|
|
allMarkdownRemark: { edges: mdEdges }
|
|
|
|
}
|
2018-04-06 14:51:52 +01:00
|
|
|
}) => (
|
2018-09-30 11:37:19 +01:00
|
|
|
<LearnLayout>
|
|
|
|
<div className='learn-page-wrapper'>
|
2019-02-16 13:01:15 +05:30
|
|
|
<Helmet title='Learn | freeCodeCamp.org' />
|
2018-09-30 11:37:19 +01:00
|
|
|
<Spacer />
|
|
|
|
<Spacer />
|
|
|
|
<h2>Welcome to the freeCodeCamp curriculum</h2>
|
|
|
|
<p>
|
|
|
|
We have thousands of coding lessons to help you improve your skills.
|
|
|
|
</p>
|
|
|
|
<p>You can earn each certification by completing its 5 final projects.</p>
|
|
|
|
<p>
|
|
|
|
And yes - all of this is 100% free, thanks to the thousands of campers
|
|
|
|
who{' '}
|
2019-02-18 20:43:41 +05:30
|
|
|
<a href='/donate' rel='noopener noreferrer' target='_blank'>
|
2018-09-30 11:37:19 +01:00
|
|
|
donate
|
|
|
|
</a>{' '}
|
|
|
|
to our nonprofit.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
If you are new to coding, we recommend you{' '}
|
|
|
|
<Link to={slug}>start at the beginning</Link>.
|
|
|
|
</p>
|
|
|
|
<Spacer />
|
|
|
|
<Map
|
|
|
|
introNodes={mdEdges.map(({ node }) => node)}
|
|
|
|
nodes={edges
|
|
|
|
.map(({ node }) => node)
|
|
|
|
.filter(({ isPrivate }) => !isPrivate)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</LearnLayout>
|
2018-03-26 13:01:24 +01:00
|
|
|
);
|
|
|
|
|
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 {
|
2018-10-04 14:47:55 +01:00
|
|
|
challengeNode(order: { eq: 0 }, challengeOrder: { eq: 0 }) {
|
2018-04-06 14:51:52 +01:00
|
|
|
fields {
|
|
|
|
slug
|
2018-06-01 03:36:42 +05:30
|
|
|
}
|
|
|
|
}
|
2019-02-18 19:32:49 +00:00
|
|
|
allChallengeNode(sort: { fields: [superOrder, order, challengeOrder] }) {
|
2018-06-01 03:36:42 +05:30
|
|
|
edges {
|
|
|
|
node {
|
|
|
|
fields {
|
|
|
|
slug
|
|
|
|
blockName
|
|
|
|
}
|
|
|
|
id
|
|
|
|
block
|
|
|
|
title
|
|
|
|
isRequired
|
|
|
|
superBlock
|
|
|
|
dashedName
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
allMarkdownRemark(filter: { frontmatter: { block: { ne: null } } }) {
|
|
|
|
edges {
|
|
|
|
node {
|
|
|
|
frontmatter {
|
|
|
|
title
|
|
|
|
block
|
|
|
|
}
|
|
|
|
fields {
|
|
|
|
slug
|
|
|
|
}
|
|
|
|
}
|
2018-04-06 14:51:52 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|