Almost all icons updated

This commit is contained in:
Tom Moor
2017-10-21 15:23:23 -07:00
parent 38228d0315
commit a756769060
5 changed files with 19 additions and 24 deletions

View File

@ -11,6 +11,7 @@ import DocumentResult from './DocumentResult';
import type { State } from '../../../types'; import type { State } from '../../../types';
import DocumentsStore from 'stores/DocumentsStore'; import DocumentsStore from 'stores/DocumentsStore';
import keydown from 'react-keydown'; import keydown from 'react-keydown';
import CloseIcon from 'components/Icon/CloseIcon';
import Icon from 'components/Icon'; import Icon from 'components/Icon';
import Flex from 'components/Flex'; import Flex from 'components/Flex';
@ -149,7 +150,7 @@ class LinkToolbar extends Component {
<ToolbarButton onMouseDown={this.removeLink}> <ToolbarButton onMouseDown={this.removeLink}>
{this.isEditing {this.isEditing
? <Icon type="Trash2" light /> ? <Icon type="Trash2" light />
: <Icon type="XCircle" light />} : <CloseIcon light />}
</ToolbarButton> </ToolbarButton>
</LinkEditor> </LinkEditor>
{hasResults && {hasResults &&

View File

@ -5,28 +5,20 @@ import { color } from 'styles/constants';
export type Props = { export type Props = {
className?: string, className?: string,
type?: string,
light?: boolean, light?: boolean,
black?: boolean, black?: boolean,
primary?: boolean, primary?: boolean,
color?: string, color?: string,
size?: number,
}; };
type BaseProps = { type BaseProps = {
children?: React$Element<any>, children?: React$Element<*>,
}; };
export default function Icon({ export default function Icon({ children, ...rest }: Props & BaseProps) {
children,
light,
black,
primary,
color,
type,
...rest
}: Props & BaseProps) {
return ( return (
<Wrapper light={light} black={black} primary={primary} {...rest}> <Wrapper {...rest}>
{children} {children}
</Wrapper> </Wrapper>
); );
@ -34,6 +26,9 @@ export default function Icon({
const Wrapper = styled.span` const Wrapper = styled.span`
svg { svg {
width: ${props => (props.size ? props.size + 'px' : 'auto')};
height: ${props => (props.size ? props.size + 'px' : 'auto')};
fill: ${props => { fill: ${props => {
if (props.color) return props.color; if (props.color) return props.color;
if (props.light) return color.white; if (props.light) return color.white;

View File

@ -4,7 +4,6 @@ import styled from 'styled-components';
import { darken } from 'polished'; import { darken } from 'polished';
import { color } from 'styles/constants'; import { color } from 'styles/constants';
import { fadeAndScaleIn } from 'styles/animations'; import { fadeAndScaleIn } from 'styles/animations';
import Icon from 'components/Icon';
type Props = { type Props = {
onRequestClose: () => void, onRequestClose: () => void,
@ -38,9 +37,6 @@ class Toast extends Component {
return ( return (
<Container onClick={onRequestClose} type={type}> <Container onClick={onRequestClose} type={type}>
{type === 'info'
? <Icon type="Info" light />
: <Icon type="AlertCircle" light />}
<Message>{message}</Message> <Message>{message}</Message>
</Container> </Container>
); );

View File

@ -61,11 +61,13 @@ import { DropdownMenu, DropdownMenuItem } from 'components/DropdownMenu';
> >
New child New child
</DropdownMenuItem> </DropdownMenuItem>
<DropdownMenuItem onClick={this.handleMove}>Move</DropdownMenuItem> <DropdownMenuItem onClick={this.handleExport}>
<DropdownMenuItem onClick={this.handleExport}>Export</DropdownMenuItem> Download
</DropdownMenuItem>
<DropdownMenuItem onClick={this.handleMove}>Move</DropdownMenuItem>
{allowDelete && {allowDelete &&
<DropdownMenuItem onClick={this.handleDelete}> <DropdownMenuItem onClick={this.handleDelete}>
Delete Delete
</DropdownMenuItem>} </DropdownMenuItem>}
</DropdownMenu> </DropdownMenu>
); );

View File

@ -1,6 +1,6 @@
// @flow // @flow
import React, { Component } from 'react'; import React, { Component } from 'react';
import Icon from 'components/Icon'; import SearchIcon from 'components/Icon/SearchIcon';
import Flex from 'components/Flex'; import Flex from 'components/Flex';
import { color } from 'styles/constants'; import { color } from 'styles/constants';
import styled from 'styled-components'; import styled from 'styled-components';
@ -37,7 +37,7 @@ class SearchField extends Component {
innerRef={this.setRef} innerRef={this.setRef}
onChange={this.handleChange} onChange={this.handleChange}
spellCheck="false" spellCheck="false"
placeholder="Search…" placeholder="search…"
autoFocus autoFocus
/> />
</Flex> </Flex>
@ -59,8 +59,9 @@ const StyledInput = styled.input`
:-ms-input-placeholder { color: ${color.slateLight}; } :-ms-input-placeholder { color: ${color.slateLight}; }
`; `;
const StyledIcon = styled(Icon)` const StyledIcon = styled(SearchIcon)`
top: 3px; position: relative;
top: 6px;
`; `;
export default SearchField; export default SearchField;