diff --git a/client/constants.js b/client/constants.js index 2a2c1858..50ca8f8e 100644 --- a/client/constants.js +++ b/client/constants.js @@ -39,6 +39,8 @@ export const EXPAND_SIDEBAR = 'EXPAND_SIDEBAR'; export const COLLAPSE_SIDEBAR = 'COLLAPSE_SIDEBAR'; export const CONSOLE_EVENT = 'CONSOLE_EVENT'; +export const EXPAND_CONSOLE = 'EXPAND_CONSOLE'; +export const COLLAPSE_CONSOLE = 'COLLAPSE_CONSOLE'; // eventually, handle errors more specifically and better export const ERROR = 'ERROR'; diff --git a/client/images/down-arrow.svg b/client/images/down-arrow.svg new file mode 100644 index 00000000..03019675 --- /dev/null +++ b/client/images/down-arrow.svg @@ -0,0 +1,14 @@ + + \ No newline at end of file diff --git a/client/images/up-arrow.svg b/client/images/up-arrow.svg new file mode 100644 index 00000000..7d78ff1f --- /dev/null +++ b/client/images/up-arrow.svg @@ -0,0 +1,14 @@ + + \ No newline at end of file diff --git a/client/modules/IDE/actions/ide.js b/client/modules/IDE/actions/ide.js index 4d01d50b..fa668e4c 100644 --- a/client/modules/IDE/actions/ide.js +++ b/client/modules/IDE/actions/ide.js @@ -55,3 +55,17 @@ export function collapseSidebar() { type: ActionTypes.COLLAPSE_SIDEBAR }; } + +export function expandConsole() { + console.log('expand console!'); + return { + type: ActionTypes.EXPAND_CONSOLE + }; +} + +export function collapseConsole() { + return { + type: ActionTypes.COLLAPSE_CONSOLE + }; +} + diff --git a/client/modules/IDE/components/Console.js b/client/modules/IDE/components/Console.js index 952b5787..5455f9d3 100644 --- a/client/modules/IDE/components/Console.js +++ b/client/modules/IDE/components/Console.js @@ -1,4 +1,8 @@ import React, { PropTypes } from 'react'; +import InlineSVG from 'react-inlinesvg'; +const upArrowUrl = require('../../../images/up-arrow.svg'); +const downArrowUrl = require('../../../images/down-arrow.svg'); +import classNames from 'classnames'; /** * How many console messages to store @@ -34,7 +38,9 @@ class Console extends React.Component { } shouldComponentUpdate(nextProps) { - return (nextProps.consoleEvent !== this.props.consoleEvent) || (nextProps.isPlaying && !this.props.isPlaying); + return (nextProps.consoleEvent !== this.props.consoleEvent) + || (nextProps.isPlaying && !this.props.isPlaying) + || (this.props.isExpanded !== nextProps.isExpanded); } componentDidUpdate() { @@ -43,10 +49,22 @@ class Console extends React.Component { render() { const childrenToDisplay = this.children.slice(-consoleMax); + const consoleClass = classNames({ + 'preview-console': true, + 'preview-console--collapsed': !this.props.isExpanded + }); return ( -