From f3bedb0932aba6f178642f3a3d66ad6dfee72092 Mon Sep 17 00:00:00 2001 From: ghalestrilo Date: Tue, 21 Jul 2020 18:09:48 -0300 Subject: [PATCH] :ok_hand: make console button toggle between collapse and expand --- client/components/mobile/ActionStrip.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/components/mobile/ActionStrip.jsx b/client/components/mobile/ActionStrip.jsx index ed3f53e0..0d75a579 100644 --- a/client/components/mobile/ActionStrip.jsx +++ b/client/components/mobile/ActionStrip.jsx @@ -1,7 +1,7 @@ import React from 'react'; import styled from 'styled-components'; import { bindActionCreators } from 'redux'; -import { useDispatch } from 'react-redux'; +import { useDispatch, useSelector } from 'react-redux'; import { remSize } from '../../theme'; import IconButton from './IconButton'; import { TerminalIcon } from '../../common/icons'; @@ -16,9 +16,10 @@ const BottomBarContent = styled.h2` `; export default () => { - const { expandConsole } = bindActionCreators(IDEActions, useDispatch()); + const { expandConsole, collapseConsole } = bindActionCreators(IDEActions, useDispatch()); + const { consoleIsExpanded } = useSelector(state => state.ide); - const actions = [{ icon: TerminalIcon, aria: 'Say Something', action: expandConsole }]; + const actions = [{ icon: TerminalIcon, aria: 'Say Something', action: consoleIsExpanded ? collapseConsole : expandConsole }]; return (