2018-04-06 14:51:52 +01:00
|
|
|
/* global graphql */
|
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-03-26 13:01:24 +01:00
|
|
|
import Link from 'gatsby-link';
|
2018-04-06 14:51:52 +01:00
|
|
|
import Helmet from 'react-helmet';
|
2018-05-18 14:54:21 +01:00
|
|
|
import { bindActionCreators } from 'redux';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { Button } from 'react-bootstrap';
|
2018-03-26 13:01:24 +01:00
|
|
|
|
2018-04-06 14:51:52 +01:00
|
|
|
import { ChallengeNode } from '../redux/propTypes';
|
2018-05-18 14:54:21 +01:00
|
|
|
import { toggleMapModal } from '../redux/app';
|
2018-05-30 17:08:21 -05:00
|
|
|
import Spacer from '../components/util/Spacer';
|
2018-04-06 14:51:52 +01:00
|
|
|
|
|
|
|
import './index.css';
|
|
|
|
|
2018-05-18 14:54:21 +01:00
|
|
|
const mapStateToProps = () => ({});
|
|
|
|
|
|
|
|
const mapDispatchToProps = dispatch =>
|
|
|
|
bindActionCreators({ toggleMapModal }, dispatch);
|
|
|
|
|
2018-04-06 14:51:52 +01:00
|
|
|
const propTypes = {
|
|
|
|
data: PropTypes.shape({
|
|
|
|
challengeNode: ChallengeNode
|
2018-05-18 14:54:21 +01:00
|
|
|
}),
|
|
|
|
toggleMapModal: PropTypes.func.isRequired
|
2018-04-06 14:51:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
const IndexPage = ({
|
2018-05-18 14:54:21 +01:00
|
|
|
data: { challengeNode: { title, fields: { slug, blockName } } },
|
|
|
|
toggleMapModal
|
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-04-06 14:51:52 +01:00
|
|
|
<p>
|
2018-05-30 17:08:21 -05:00
|
|
|
You can earn verified certifications by completing each sections 6
|
2018-05-18 14:54:21 +01:00
|
|
|
required projects.
|
2018-04-06 14:51:52 +01:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
{'And yes - all of this is 100% free, thanks to the thousands of ' +
|
|
|
|
'campers who '}
|
|
|
|
<a href='https://donate.freecodecamp.org' target='_blank'>
|
|
|
|
donate
|
|
|
|
</a>{' '}
|
|
|
|
to our nonprofit.
|
|
|
|
</p>
|
|
|
|
<h3>Not sure where to start?</h3>
|
|
|
|
<p>
|
|
|
|
We recommend you start at the beginning{' '}
|
|
|
|
<Link to={slug}>{`${blockName} -> ${title}`}</Link>
|
|
|
|
</p>
|
2018-05-22 07:53:27 +01:00
|
|
|
<h3>Want to dive into our curriculum?</h3>
|
2018-05-18 14:54:21 +01:00
|
|
|
<Button block={true} bsSize='lg' bsStyle='primary' onClick={toggleMapModal}>
|
2018-05-22 07:53:27 +01:00
|
|
|
Explore the curriculum
|
2018-05-18 14:54:21 +01:00
|
|
|
</Button>
|
2018-03-26 13:01:24 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
2018-04-06 14:51:52 +01:00
|
|
|
IndexPage.displayName = 'IndexPage';
|
|
|
|
IndexPage.propTypes = propTypes;
|
|
|
|
|
2018-05-18 14:54:21 +01:00
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(IndexPage);
|
2018-04-06 14:51:52 +01:00
|
|
|
|
|
|
|
export const query = graphql`
|
|
|
|
query FirstChallenge {
|
|
|
|
challengeNode(order: { eq: 0 }, suborder: { eq: 1 }) {
|
|
|
|
title
|
|
|
|
fields {
|
|
|
|
slug
|
|
|
|
blockName
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|