2020-07-21 15:14:58 +00:00
|
|
|
import React from 'react';
|
|
|
|
import styled from 'styled-components';
|
|
|
|
import { bindActionCreators } from 'redux';
|
2020-07-21 21:09:48 +00:00
|
|
|
import { useDispatch, useSelector } from 'react-redux';
|
2020-07-21 15:25:22 +00:00
|
|
|
import { remSize } from '../../theme';
|
2020-07-21 15:14:58 +00:00
|
|
|
import IconButton from './IconButton';
|
2020-07-21 21:01:00 +00:00
|
|
|
import { TerminalIcon } from '../../common/icons';
|
2020-07-21 15:14:58 +00:00
|
|
|
import * as IDEActions from '../../modules/IDE/actions/ide';
|
|
|
|
|
|
|
|
const BottomBarContent = styled.h2`
|
2020-07-21 15:21:46 +00:00
|
|
|
padding: ${remSize(8)};
|
2020-07-21 15:14:58 +00:00
|
|
|
|
|
|
|
svg {
|
|
|
|
max-height: ${remSize(32)};
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export default () => {
|
2020-07-21 21:09:48 +00:00
|
|
|
const { expandConsole, collapseConsole } = bindActionCreators(IDEActions, useDispatch());
|
|
|
|
const { consoleIsExpanded } = useSelector(state => state.ide);
|
2020-07-21 15:14:58 +00:00
|
|
|
|
2020-07-21 21:09:48 +00:00
|
|
|
const actions = [{ icon: TerminalIcon, aria: 'Say Something', action: consoleIsExpanded ? collapseConsole : expandConsole }];
|
2020-07-21 15:14:58 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<BottomBarContent>
|
|
|
|
{actions.map(({ icon, aria, action }) =>
|
|
|
|
(<IconButton
|
|
|
|
icon={icon}
|
|
|
|
aria-label={aria}
|
|
|
|
key={`bottom-bar-${aria}`}
|
|
|
|
onClick={() => action()}
|
|
|
|
/>))}
|
|
|
|
</BottomBarContent>
|
|
|
|
);
|
|
|
|
};
|