Refactor. Add trash and open icons

This commit is contained in:
Tom Moor
2017-10-21 16:21:43 -07:00
parent bafc491901
commit a909bf86b4
37 changed files with 122 additions and 330 deletions

View File

@@ -146,13 +146,14 @@ const Menu = styled.div`
opacity: 0;
background-color: #2F3336;
border-radius: 4px;
transition: opacity 250ms ease-in-out, transform 250ms ease-in-out;
transform: scale(.95);
transition: opacity 150ms cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 150ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
line-height: 0;
height: 40px;
min-width: 260px;
${({ active }) => active && `
transform: translateY(-6px);
transform: translateY(-6px) scale(1);
opacity: 1;
`}
`;

View File

@@ -12,7 +12,8 @@ import type { State } from '../../../types';
import DocumentsStore from 'stores/DocumentsStore';
import keydown from 'react-keydown';
import CloseIcon from 'components/Icon/CloseIcon';
import Icon from 'components/Icon';
import OpenIcon from 'components/Icon/OpenIcon';
import TrashIcon from 'components/Icon/TrashIcon';
import Flex from 'components/Flex';
@keydown
@@ -145,12 +146,10 @@ class LinkToolbar extends Component {
/>
{this.isEditing &&
<ToolbarButton onMouseDown={this.openLink}>
<Icon type="ExternalLink" light />
<OpenIcon light />
</ToolbarButton>}
<ToolbarButton onMouseDown={this.removeLink}>
{this.isEditing
? <Icon type="Trash2" light />
: <CloseIcon light />}
{this.isEditing ? <TrashIcon light /> : <CloseIcon light />}
</ToolbarButton>
</LinkEditor>
{hasResults &&