Skip to content

Commit f3bedb0

Browse files
committed
👌 make console button toggle between collapse and expand
1 parent 3f01fc4 commit f3bedb0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

client/components/mobile/ActionStrip.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import styled from 'styled-components';
33
import { bindActionCreators } from 'redux';
4-
import { useDispatch } from 'react-redux';
4+
import { useDispatch, useSelector } from 'react-redux';
55
import { remSize } from '../../theme';
66
import IconButton from './IconButton';
77
import { TerminalIcon } from '../../common/icons';
@@ -16,9 +16,10 @@ const BottomBarContent = styled.h2`
1616
`;
1717

1818
export default () => {
19-
const { expandConsole } = bindActionCreators(IDEActions, useDispatch());
19+
const { expandConsole, collapseConsole } = bindActionCreators(IDEActions, useDispatch());
20+
const { consoleIsExpanded } = useSelector(state => state.ide);
2021

21-
const actions = [{ icon: TerminalIcon, aria: 'Say Something', action: expandConsole }];
22+
const actions = [{ icon: TerminalIcon, aria: 'Say Something', action: consoleIsExpanded ? collapseConsole : expandConsole }];
2223

2324
return (
2425
<BottomBarContent>

0 commit comments

Comments
 (0)