From fbc4db1e9bc7a5aa9f83db932bbad3994c95c6e8 Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra Date: Sun, 17 Feb 2019 14:47:10 +0530 Subject: [PATCH] revert(client): place tool panel at the bottom This reverts commit e6d2a9df93b62413bd54b76609ece6517b65c4db. --- .../Challenges/classic/DesktopLayout.js | 83 +++++++++---------- .../Challenges/classic/MobileLayout.js | 9 +- .../src/templates/Challenges/classic/Show.js | 18 +--- .../templates/Challenges/classic/classic.css | 12 +-- .../Challenges/components/Tool-Panel.js | 13 +-- 5 files changed, 52 insertions(+), 83 deletions(-) diff --git a/client/src/templates/Challenges/classic/DesktopLayout.js b/client/src/templates/Challenges/classic/DesktopLayout.js index 004659dab1..3379bbeadc 100644 --- a/client/src/templates/Challenges/classic/DesktopLayout.js +++ b/client/src/templates/Challenges/classic/DesktopLayout.js @@ -1,4 +1,4 @@ -import React, { Component, Fragment } from 'react'; +import React, { Component } from 'react'; import { ReflexContainer, ReflexSplitter, ReflexElement } from 'react-reflex'; import PropTypes from 'prop-types'; @@ -14,8 +14,7 @@ const propTypes = { onStopResize: PropTypes.func, onResize: PropTypes.func }), - testOutput: PropTypes.element, - toolPanel: PropTypes.element + testOutput: PropTypes.element }; class DesktopLayout extends Component { @@ -27,50 +26,46 @@ class DesktopLayout extends Component { editor, testOutput, hasPreview, - preview, - toolPanel + preview } = this.props; return ( - - - - {instructions} - - - - {challengeFile && ( - - - {editor} - - - - {testOutput} - - - )} - - {hasPreview && } - {hasPreview && ( - - {preview} - + + + {instructions} + + + + {challengeFile && ( + + + {editor} + + + + {testOutput} + + )} - - {toolPanel} - + + {hasPreview && } + {hasPreview && ( + + {preview} + + )} + ); } } diff --git a/client/src/templates/Challenges/classic/MobileLayout.js b/client/src/templates/Challenges/classic/MobileLayout.js index 916204cb54..007aaab91c 100644 --- a/client/src/templates/Challenges/classic/MobileLayout.js +++ b/client/src/templates/Challenges/classic/MobileLayout.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { TabPane, Tabs } from '@freecodecamp/react-bootstrap'; import { connect } from 'react-redux'; +import ToolPanel from '../components/Tool-Panel'; import { createStructuredSelector } from 'reselect'; import { currentTabSelector, moveToTab } from '../redux'; import { bindActionCreators } from 'redux'; @@ -22,12 +23,13 @@ const mapDispatchToProps = dispatch => const propTypes = { currentTab: PropTypes.number, editor: PropTypes.element, + guideUrl: PropTypes.string, hasPreview: PropTypes.bool, instructions: PropTypes.element, moveToTab: PropTypes.func, preview: PropTypes.element, testOutput: PropTypes.element, - toolPanel: PropTypes.element + videoUrl: PropTypes.string }; class MobileLayout extends Component { @@ -40,7 +42,8 @@ class MobileLayout extends Component { testOutput, hasPreview, preview, - toolPanel + guideUrl, + videoUrl } = this.props; const editorTabPaneProps = { @@ -71,7 +74,7 @@ class MobileLayout extends Component { )} - {toolPanel} + ); } diff --git a/client/src/templates/Challenges/classic/Show.js b/client/src/templates/Challenges/classic/Show.js index 1950c84204..acc6b4ac7f 100644 --- a/client/src/templates/Challenges/classic/Show.js +++ b/client/src/templates/Challenges/classic/Show.js @@ -19,7 +19,6 @@ import VideoModal from '../components/VideoModal'; import ResetModal from '../components/ResetModal'; import MobileLayout from './MobileLayout'; import DesktopLayout from './DesktopLayout'; -import ToolPanel from '../components/Tool-Panel'; import { createGuideUrl } from '../utils'; import { challengeTypes } from '../../../../utils/challengeTypes'; @@ -244,17 +243,6 @@ class ShowClassic extends Component { ); } - renderToolPanel(isMobile) { - return ( - - ); - } - render() { return ( @@ -266,13 +254,14 @@ class ShowClassic extends Component { matches ? ( ) : ( ) } diff --git a/client/src/templates/Challenges/classic/classic.css b/client/src/templates/Challenges/classic/classic.css index c21229059b..11ea39d1a1 100644 --- a/client/src/templates/Challenges/classic/classic.css +++ b/client/src/templates/Challenges/classic/classic.css @@ -3,7 +3,7 @@ } .desktop-layout { - height: calc(100vh - var(--header-height) - 42px); + height: calc(100vh - var(--header-height)); } .monaco-menu .action-label { @@ -34,13 +34,3 @@ height: 100%; overflow: hidden; } - -.classic-tool-panel.tool-panel-group { - display: flex; - flex-direction: row-reverse; - padding: 0 2px; -} - -.classic-tool-panel.tool-panel-group .btn-block + .btn-block { - margin: 0 2px 0 0; -} diff --git a/client/src/templates/Challenges/components/Tool-Panel.js b/client/src/templates/Challenges/components/Tool-Panel.js index 1d54883829..2b578c94e8 100644 --- a/client/src/templates/Challenges/components/Tool-Panel.js +++ b/client/src/templates/Challenges/components/Tool-Panel.js @@ -21,7 +21,6 @@ const mapDispatchToProps = dispatch => ); const propTypes = { - className: PropTypes.string, executeChallenge: PropTypes.func.isRequired, guideUrl: PropTypes.string, isMobile: PropTypes.bool, @@ -32,7 +31,6 @@ const propTypes = { }; function ToolPanel({ - className, executeChallenge, isMobile, openHelpModal, @@ -43,11 +41,9 @@ function ToolPanel({ }) { return ( -
+ }`}> @@ -96,10 +92,7 @@ function ToolPanel({ ToolPanel.displayName = 'ToolPanel'; ToolPanel.propTypes = propTypes; -export default connect( - mapStateToProps, - mapDispatchToProps -)(ToolPanel); +export default connect(mapStateToProps, mapDispatchToProps)(ToolPanel); /*