1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- import React from 'react';
- import Button from '../components/Button';
- import Typography from '../components/Typography';
- import Icon from '../components/Icon';
- import CreateForm from './CreateForm';
- import MarkupTools from './MarkupTools';
- import Watermark from './Watermark';
- import useActions from '../actions';
- import useStore from '../store';
- import { BtnWrapper } from '../global/toolStyled';
- import { SidebarWrapper } from '../global/otherStyled';
- const Sidebar: React.FunctionComponent = () => {
- const [{ sidebarState, displayMode }, dispatch] = useStore();
- const { setSidebar } = useActions(dispatch);
- const onClick = (state: string): void => {
- if (state === sidebarState) {
- setSidebar('');
- } else {
- setSidebar(state);
- }
- };
- return (
- <SidebarWrapper isHidden={displayMode === 'full'}>
- <Typography light style={{ marginLeft: '30px', marginTop: '46px' }}>Main Menu</Typography>
- <MarkupTools />
- <CreateForm />
- <BtnWrapper>
- <Button shouldFitContainer align="left" onClick={(): void => { onClick('add-image'); }}>
- <Icon glyph="add-image" style={{ marginRight: '10px' }} />
- Add Image
- </Button>
- </BtnWrapper>
- <Watermark />
- </SidebarWrapper>
- );
- };
- export default Sidebar;
|