From c804c968dded45a2a809e2755d59563d12712d62 Mon Sep 17 00:00:00 2001 From: Stuart Taylor Date: Tue, 22 May 2018 07:53:27 +0100 Subject: [PATCH] Fix: Map UI & Tool panel styles (#83) Closes #75 ![image](https://user-images.githubusercontent.com/18572518/40308418-21227656-5cfe-11e8-9fbc-e4384ba8bc98.png) ![image](https://user-images.githubusercontent.com/18572518/40308442-347f09b2-5cfe-11e8-8834-dd87c146fc74.png) ![image](https://user-images.githubusercontent.com/18572518/40308459-43b1205a-5cfe-11e8-9b47-75b9b946a029.png) ![image](https://user-images.githubusercontent.com/18572518/40308496-63870e62-5cfe-11e8-8359-c4fd9c3ec345.png) --- packages/learn/src/components/Map/map.css | 6 ++- .../learn/src/components/MapModal/index.js | 2 +- packages/learn/src/layouts/global.css | 19 ++++++++ packages/learn/src/pages/index.js | 4 +- .../src/templates/Challenges/classic/Show.js | 3 +- .../Challenges/components/Side-Panel.js | 32 ++------------ .../Challenges/components/Tool-Panel.js | 43 ++++++++++++++++--- .../Challenges/components/tool-panel.css | 14 +++++- .../Challenges/project/Tool-Panel.js | 12 ++++-- .../learn/src/templates/Introduction/Intro.js | 14 +++--- 10 files changed, 98 insertions(+), 51 deletions(-) diff --git a/packages/learn/src/components/Map/map.css b/packages/learn/src/components/Map/map.css index 9b5fa81bfd..6bcbddd8a2 100644 --- a/packages/learn/src/components/Map/map.css +++ b/packages/learn/src/components/Map/map.css @@ -22,4 +22,8 @@ li.open > .map-title svg { transform: rotate(90deg); -} \ No newline at end of file +} + +.map-challenge-title { + margin-bottom: 0.25rem; +} diff --git a/packages/learn/src/components/MapModal/index.js b/packages/learn/src/components/MapModal/index.js index 2b030128d3..6bac732685 100644 --- a/packages/learn/src/components/MapModal/index.js +++ b/packages/learn/src/components/MapModal/index.js @@ -45,7 +45,7 @@ function MapModal({ introNodes, nodes, show, toggleMapModal }) { > - A Map to Learn to Code + A Curriculum to Learn to Code diff --git a/packages/learn/src/layouts/global.css b/packages/learn/src/layouts/global.css index 0c9a632e27..e717ac4f4e 100644 --- a/packages/learn/src/layouts/global.css +++ b/packages/learn/src/layouts/global.css @@ -634,3 +634,22 @@ pre tt:after { font-size: 28px; 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; +} \ No newline at end of file diff --git a/packages/learn/src/pages/index.js b/packages/learn/src/pages/index.js index 4be4c31d28..bdfdc3ae80 100644 --- a/packages/learn/src/pages/index.js +++ b/packages/learn/src/pages/index.js @@ -49,9 +49,9 @@ const IndexPage = ({ We recommend you start at the beginning{' '} {`${blockName} -> ${title}`}

-

Want to see what we can offer?

+

Want to dive into our curriculum?

); diff --git a/packages/learn/src/templates/Challenges/classic/Show.js b/packages/learn/src/templates/Challenges/classic/Show.js index 6a0ae113fd..4388d0c305 100644 --- a/packages/learn/src/templates/Challenges/classic/Show.js +++ b/packages/learn/src/templates/Challenges/classic/Show.js @@ -171,13 +171,12 @@ class ShowClassic extends PureComponent { return ( - + diff --git a/packages/learn/src/templates/Challenges/components/Side-Panel.js b/packages/learn/src/templates/Challenges/components/Side-Panel.js index b8b4bdb88a..28c8569790 100644 --- a/packages/learn/src/templates/Challenges/components/Side-Panel.js +++ b/packages/learn/src/templates/Challenges/components/Side-Panel.js @@ -3,30 +3,26 @@ import PropTypes from 'prop-types'; import ReactDom from 'react-dom'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; -import { Button } from 'react-bootstrap'; import ChallengeTitle from './Challenge-Title'; import ChallengeDescription from './Challenge-Description'; import Spacer from '../../../components/util/Spacer'; -import { initConsole, openModal } from '../redux'; +import { initConsole } from '../redux'; const mapStateToProps = () => ({}); const mapDispatchToProps = dispatch => bindActionCreators( { - initConsole, - openHelpModal: () => openModal('help') + initConsole }, dispatch ); const propTypes = { description: PropTypes.arrayOf(PropTypes.string), - guideUrl: PropTypes.string, initConsole: PropTypes.func.isRequired, - openHelpModal: PropTypes.func.isRequired, title: PropTypes.string }; @@ -56,7 +52,7 @@ export class SidePanel extends PureComponent { } render() { - const { title, description, guideUrl, openHelpModal } = this.props; + const { title, description } = this.props; return (
@@ -66,28 +62,6 @@ export class SidePanel extends PureComponent {
- {guideUrl ? ( -
- -
-
- ) : null} -
); } diff --git a/packages/learn/src/templates/Challenges/components/Tool-Panel.js b/packages/learn/src/templates/Challenges/components/Tool-Panel.js index fbb5e62f0c..20ebcf48d3 100644 --- a/packages/learn/src/templates/Challenges/components/Tool-Panel.js +++ b/packages/learn/src/templates/Challenges/components/Tool-Panel.js @@ -14,6 +14,7 @@ const mapDispatchToProps = dispatch => bindActionCreators( { executeChallenge, + openHelpModal: () => openModal('help'), openResetModal: () => openModal('reset'), toggleMapModal }, @@ -22,19 +23,31 @@ const mapDispatchToProps = dispatch => const propTypes = { executeChallenge: PropTypes.func.isRequired, + guideUrl: PropTypes.string, + openHelpModal: PropTypes.func.isRequired, openResetModal: PropTypes.func.isRequired, toggleMapModal: PropTypes.func.isRequired }; -function ToolPanel({ executeChallenge, openResetModal, toggleMapModal }) { +function ToolPanel({ + executeChallenge, + openHelpModal, + openResetModal, + toggleMapModal, + guideUrl +}) { return (
-
-
-
+
@@ -42,7 +55,27 @@ function ToolPanel({ executeChallenge, openResetModal, toggleMapModal }) { Reset All Code
-
+
+ {guideUrl ? ( + + ) : null} + +
); } diff --git a/packages/learn/src/templates/Challenges/components/tool-panel.css b/packages/learn/src/templates/Challenges/components/tool-panel.css index 833d76450c..4f592fc78d 100644 --- a/packages/learn/src/templates/Challenges/components/tool-panel.css +++ b/packages/learn/src/templates/Challenges/components/tool-panel.css @@ -7,6 +7,16 @@ background-color: #99C199; } -.centre-tool-panel { +#centre-tool-panel { width: 300px; -} \ No newline at end of file +} + +#right-tool-panel { + display: flex; + justify-content: center; + align-items: center; +} + +#right-tool-panel a, #right-tool-panel .btn-block { + margin: 0; +} diff --git a/packages/learn/src/templates/Challenges/project/Tool-Panel.js b/packages/learn/src/templates/Challenges/project/Tool-Panel.js index 6776b3be5b..8cfdb1ba75 100644 --- a/packages/learn/src/templates/Challenges/project/Tool-Panel.js +++ b/packages/learn/src/templates/Challenges/project/Tool-Panel.js @@ -31,7 +31,11 @@ export class ToolPanel extends PureComponent { return (
-
@@ -41,7 +45,7 @@ export class ToolPanel extends PureComponent {
diff --git a/packages/learn/src/templates/Introduction/Intro.js b/packages/learn/src/templates/Introduction/Intro.js index 2504cd0778..aa410e986f 100644 --- a/packages/learn/src/templates/Introduction/Intro.js +++ b/packages/learn/src/templates/Introduction/Intro.js @@ -55,15 +55,19 @@ function IntroductionPage({ /> - - + + Go to the first lesson - +