Stuart Taylor
2018-05-22 07:53:27 +01:00
committed by Mrugesh Mohapatra
parent b0b51c656e
commit c804c968dd
10 changed files with 98 additions and 51 deletions

View File

@ -22,4 +22,8 @@
li.open > .map-title svg { li.open > .map-title svg {
transform: rotate(90deg); transform: rotate(90deg);
} }
.map-challenge-title {
margin-bottom: 0.25rem;
}

View File

@ -45,7 +45,7 @@ function MapModal({ introNodes, nodes, show, toggleMapModal }) {
> >
<Modal.Header className='map-modal-header fcc-modal' closeButton={true}> <Modal.Header className='map-modal-header fcc-modal' closeButton={true}>
<Modal.Title className='text-center'> <Modal.Title className='text-center'>
A Map to Learn to Code A Curriculum to Learn to Code
</Modal.Title> </Modal.Title>
</Modal.Header> </Modal.Header>
<Modal.Body> <Modal.Body>

View File

@ -634,3 +634,22 @@ pre tt:after {
font-size: 28px; font-size: 28px;
text-shadow: none; text-shadow: none;
} }
.btn-primary-invert {
color: #006400;
background-color: #fff;
border-color: #006400;
}
.btn-primary-invert:hover, .btn-primary-invert:focus, .btn-primary-invert:active {
color: #006400;
border-color: #006400;
}
.btn-primary-invert.btn-primary:hover {
color: #fff;
}
.btn-primary-link > a {
color: #fff;
}

View File

@ -49,9 +49,9 @@ const IndexPage = ({
We recommend you start at the beginning{' '} We recommend you start at the beginning{' '}
<Link to={slug}>{`${blockName} -> ${title}`}</Link> <Link to={slug}>{`${blockName} -> ${title}`}</Link>
</p> </p>
<h3>Want to see what we can offer?</h3> <h3>Want to dive into our curriculum?</h3>
<Button block={true} bsSize='lg' bsStyle='primary' onClick={toggleMapModal}> <Button block={true} bsSize='lg' bsStyle='primary' onClick={toggleMapModal}>
Explore the lesson map Explore the curriculum
</Button> </Button>
</div> </div>
); );

View File

@ -171,13 +171,12 @@ class ShowClassic extends PureComponent {
return ( return (
<Fragment> <Fragment>
<Helmet title={`${blockNameTitle} | Learn freeCodeCamp`} /> <Helmet title={`${blockNameTitle} | Learn freeCodeCamp`} />
<ToolPanel /> <ToolPanel guideUrl={guideUrl} />
<ReflexContainer orientation='vertical'> <ReflexContainer orientation='vertical'>
<ReflexElement flex={1}> <ReflexElement flex={1}>
<SidePanel <SidePanel
className='full-height' className='full-height'
description={description} description={description}
guideUrl={guideUrl}
title={blockNameTitle} title={blockNameTitle}
/> />
</ReflexElement> </ReflexElement>

View File

@ -3,30 +3,26 @@ import PropTypes from 'prop-types';
import ReactDom from 'react-dom'; import ReactDom from 'react-dom';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { Button } from 'react-bootstrap';
import ChallengeTitle from './Challenge-Title'; import ChallengeTitle from './Challenge-Title';
import ChallengeDescription from './Challenge-Description'; import ChallengeDescription from './Challenge-Description';
import Spacer from '../../../components/util/Spacer'; import Spacer from '../../../components/util/Spacer';
import { initConsole, openModal } from '../redux'; import { initConsole } from '../redux';
const mapStateToProps = () => ({}); const mapStateToProps = () => ({});
const mapDispatchToProps = dispatch => const mapDispatchToProps = dispatch =>
bindActionCreators( bindActionCreators(
{ {
initConsole, initConsole
openHelpModal: () => openModal('help')
}, },
dispatch dispatch
); );
const propTypes = { const propTypes = {
description: PropTypes.arrayOf(PropTypes.string), description: PropTypes.arrayOf(PropTypes.string),
guideUrl: PropTypes.string,
initConsole: PropTypes.func.isRequired, initConsole: PropTypes.func.isRequired,
openHelpModal: PropTypes.func.isRequired,
title: PropTypes.string title: PropTypes.string
}; };
@ -56,7 +52,7 @@ export class SidePanel extends PureComponent {
} }
render() { render() {
const { title, description, guideUrl, openHelpModal } = this.props; const { title, description } = this.props;
return ( return (
<div className='instructions-panel' role='complementary'> <div className='instructions-panel' role='complementary'>
<div ref={this.bindTopDiv} /> <div ref={this.bindTopDiv} />
@ -66,28 +62,6 @@ export class SidePanel extends PureComponent {
<ChallengeDescription description={description} /> <ChallengeDescription description={description} />
</div> </div>
<Spacer /> <Spacer />
{guideUrl ? (
<div>
<Button
block={true}
bsStyle='primary'
className='btn-big'
href={guideUrl}
target='_blank'
>
Get a hint
</Button>
<div className='button-spacer' />
</div>
) : null}
<Button
block={true}
bsStyle='primary'
className='btn-big'
onClick={openHelpModal}
>
Ask for help on the forum
</Button>
</div> </div>
); );
} }

View File

@ -14,6 +14,7 @@ const mapDispatchToProps = dispatch =>
bindActionCreators( bindActionCreators(
{ {
executeChallenge, executeChallenge,
openHelpModal: () => openModal('help'),
openResetModal: () => openModal('reset'), openResetModal: () => openModal('reset'),
toggleMapModal toggleMapModal
}, },
@ -22,19 +23,31 @@ const mapDispatchToProps = dispatch =>
const propTypes = { const propTypes = {
executeChallenge: PropTypes.func.isRequired, executeChallenge: PropTypes.func.isRequired,
guideUrl: PropTypes.string,
openHelpModal: PropTypes.func.isRequired,
openResetModal: PropTypes.func.isRequired, openResetModal: PropTypes.func.isRequired,
toggleMapModal: PropTypes.func.isRequired toggleMapModal: PropTypes.func.isRequired
}; };
function ToolPanel({ executeChallenge, openResetModal, toggleMapModal }) { function ToolPanel({
executeChallenge,
openHelpModal,
openResetModal,
toggleMapModal,
guideUrl
}) {
return ( return (
<div className='tool-panel'> <div className='tool-panel'>
<div id='left-tool-panel sub-panel'> <div id='left-tool-panel'>
<Button bsStyle='default' onClick={toggleMapModal}> <Button
bsStyle='primary'
className='btn-primary-invert'
onClick={toggleMapModal}
>
View the Curriculum View the Curriculum
</Button> </Button>
</div> </div>
<div id='centre-tool-panel sub-panel'> <div id='centre-tool-panel'>
<Button bsStyle='primary' onClick={executeChallenge}> <Button bsStyle='primary' onClick={executeChallenge}>
Run the Tests Run the Tests
</Button> </Button>
@ -42,7 +55,27 @@ function ToolPanel({ executeChallenge, openResetModal, toggleMapModal }) {
Reset All Code Reset All Code
</Button> </Button>
</div> </div>
<div id='right-tool-panel sub-panel' /> <div id='right-tool-panel'>
{guideUrl ? (
<Button
block={true}
bsStyle='primary'
className='btn-primary-invert'
href={guideUrl}
target='_blank'
>
Get a hint
</Button>
) : null}
<Button
block={true}
bsStyle='primary'
className='btn-primary-invert'
onClick={openHelpModal}
>
Ask for help
</Button>
</div>
</div> </div>
); );
} }

View File

@ -7,6 +7,16 @@
background-color: #99C199; background-color: #99C199;
} }
.centre-tool-panel { #centre-tool-panel {
width: 300px; width: 300px;
} }
#right-tool-panel {
display: flex;
justify-content: center;
align-items: center;
}
#right-tool-panel a, #right-tool-panel .btn-block {
margin: 0;
}

View File

@ -31,7 +31,11 @@ export class ToolPanel extends PureComponent {
return ( return (
<div className='tool-panel'> <div className='tool-panel'>
<div id='left-tool-panel sub-panel'> <div id='left-tool-panel sub-panel'>
<Button bsStyle='default' onClick={toggleMapModal}> <Button
bsStyle='primary'
className='btn-primary-invert'
onClick={toggleMapModal}
>
View the Curriculum View the Curriculum
</Button> </Button>
</div> </div>
@ -41,7 +45,7 @@ export class ToolPanel extends PureComponent {
<Button <Button
block={true} block={true}
bsStyle='primary' bsStyle='primary'
className='btn-primary-ghost btn-big' className='btn-primary-invert'
href={guideUrl} href={guideUrl}
target='_blank' target='_blank'
> >
@ -51,10 +55,10 @@ export class ToolPanel extends PureComponent {
<Button <Button
block={true} block={true}
bsStyle='primary' bsStyle='primary'
className='btn-primary-ghost btn-big' className='btn-primary-invert'
onClick={openHelpModal} onClick={openHelpModal}
> >
Ask for help on the forum Ask for help
</Button> </Button>
</div> </div>
</div> </div>

View File

@ -55,15 +55,19 @@ function IntroductionPage({
/> />
</FullWidthRow> </FullWidthRow>
<FullWidthRow> <FullWidthRow>
<Link to={firstLessonPath}> <Link className='btn btn-lg btn-primary btn-block' to={firstLessonPath}>
<Button block={true} bsSize='lg' bsStyle='primary'> Go to the first lesson
Go to the first lesson
</Button>
</Link> </Link>
<ButtonSpacer /> <ButtonSpacer />
<Button block={true} bsSize='sm' onClick={toggleMapModal}> <Button
block={true}
bsSize='lg'
className='btn-primary-invert'
onClick={toggleMapModal}
>
View the curriculum View the curriculum
</Button> </Button>
<ButtonSpacer />
<hr /> <hr />
</FullWidthRow> </FullWidthRow>
<FullWidthRow> <FullWidthRow>