Feather icons

This commit is contained in:
Tom Moor
2017-09-04 12:14:18 -07:00
parent 24686aac44
commit 3c9f69d495
6 changed files with 37 additions and 28 deletions

View File

@ -2,11 +2,11 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { Star as StarIcon } from 'react-feather';
import Document from 'models/Document'; import Document from 'models/Document';
import styled from 'styled-components'; import styled from 'styled-components';
import { color } from 'styles/constants'; import { color } from 'styles/constants';
import PublishingInfo from './components/PublishingInfo'; import PublishingInfo from './components/PublishingInfo';
import StarIcon from 'components/Icon/StarIcon';
type Props = { type Props = {
document: Document, document: Document,
@ -21,11 +21,6 @@ const StyledStar = styled(StarIcon)`
margin-left: 4px; margin-left: 4px;
opacity: ${props => (props.solid ? '1 !important' : 0)}; opacity: ${props => (props.solid ? '1 !important' : 0)};
transition: opacity 100ms ease-in-out; transition: opacity 100ms ease-in-out;
svg {
width: 1em;
height: 1em;
}
`; `;
const DocumentLink = styled(Link)` const DocumentLink = styled(Link)`
@ -87,8 +82,12 @@ const DocumentLink = styled(Link)`
<h3> <h3>
{document.title} {document.title}
{document.starred {document.starred
? <a onClick={this.unstar}><StyledStar solid /></a> ? <a onClick={this.unstar}>
: <a onClick={this.star}><StyledStar /></a>} <StyledStar color={color.slateDark} size="1em" solid />
</a>
: <a onClick={this.star}>
<StyledStar color={color.slateDark} size="1em" />
</a>}
</h3> </h3>
<PublishingInfo <PublishingInfo
document={document} document={document}

View File

@ -16,8 +16,13 @@ import Avatar from 'components/Avatar';
import { LoadingIndicatorBar } from 'components/LoadingIndicator'; import { LoadingIndicatorBar } from 'components/LoadingIndicator';
import Scrollable from 'components/Scrollable'; import Scrollable from 'components/Scrollable';
import Modal from 'components/Modal'; import Modal from 'components/Modal';
import AddIcon from 'components/Icon/AddIcon'; import {
import MoreIcon from 'components/Icon/MoreIcon'; Home as HomeIcon,
Search as SearchIcon,
Star as StarIcon,
PlusCircle as AddIcon,
MoreHorizontal as MoreIcon,
} from 'react-feather';
import CollectionNew from 'scenes/CollectionNew'; import CollectionNew from 'scenes/CollectionNew';
import CollectionEdit from 'scenes/CollectionEdit'; import CollectionEdit from 'scenes/CollectionEdit';
import KeyboardShortcuts from 'scenes/KeyboardShortcuts'; import KeyboardShortcuts from 'scenes/KeyboardShortcuts';
@ -156,17 +161,23 @@ type Props = {
<Flex column> <Flex column>
<Scrollable> <Scrollable>
<LinkSection> <LinkSection>
<SidebarLink to="/dashboard">Home</SidebarLink> <SidebarLink to="/dashboard">
<SidebarLink to="/search">Search</SidebarLink> <HomeIcon size="1em" /> Home
<SidebarLink to="/starred">Starred</SidebarLink> </SidebarLink>
<SidebarLink to="/search">
<SearchIcon size="1em" /> Search
</SidebarLink>
<SidebarLink to="/starred">
<StarIcon size="1em" /> Starred
</SidebarLink>
</LinkSection> </LinkSection>
<LinkSection> <LinkSection>
{collections.active {collections.active
? <CollectionAction onClick={this.handleEditCollection}> ? <CollectionAction onClick={this.handleEditCollection}>
<MoreIcon /> <MoreIcon size={16} />
</CollectionAction> </CollectionAction>
: <CollectionAction onClick={this.handleCreateCollection}> : <CollectionAction onClick={this.handleCreateCollection}>
<AddIcon /> <AddIcon size={16} />
</CollectionAction>} </CollectionAction>}
{collections.active {collections.active
? <SidebarCollection ? <SidebarCollection
@ -231,17 +242,11 @@ const CollectionAction = styled.a`
position: absolute; position: absolute;
top: -2px; top: -2px;
right: ${layout.hpadding}; right: ${layout.hpadding};
color: ${color.slate};
svg { svg { opacity: .75; }
opacity: .35;
width: 16px;
height: 16px;
}
&:hover { &:hover {
svg { svg { opacity: 1; }
opacity: 1;
}
} }
`; `;

View File

@ -3,7 +3,7 @@ import React from 'react';
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import Flex from 'components/Flex'; import Flex from 'components/Flex';
import styled from 'styled-components'; import styled from 'styled-components';
import { layout } from 'styles/constants'; import { color, layout } from 'styles/constants';
import SidebarLink from '../SidebarLink'; import SidebarLink from '../SidebarLink';
import DropToImport from 'components/DropToImport'; import DropToImport from 'components/DropToImport';
@ -72,7 +72,7 @@ const Header = styled(Flex)`
font-size: 11px; font-size: 11px;
font-weight: 500; font-weight: 500;
text-transform: uppercase; text-transform: uppercase;
color: #9FA6AB; color: ${color.slate};
letter-spacing: 0.04em; letter-spacing: 0.04em;
padding: 0 ${layout.hpadding}; padding: 0 ${layout.hpadding};
`; `;

View File

@ -3,7 +3,7 @@ import React from 'react';
import { observer, inject } from 'mobx-react'; import { observer, inject } from 'mobx-react';
import Flex from 'components/Flex'; import Flex from 'components/Flex';
import styled from 'styled-components'; import styled from 'styled-components';
import { layout } from 'styles/constants'; import { color, layout } from 'styles/constants';
import SidebarLink from '../SidebarLink'; import SidebarLink from '../SidebarLink';
import DropToImport from 'components/DropToImport'; import DropToImport from 'components/DropToImport';
@ -44,7 +44,7 @@ const Header = styled(Flex)`
font-size: 11px; font-size: 11px;
font-weight: 500; font-weight: 500;
text-transform: uppercase; text-transform: uppercase;
color: #9FA6AB; color: ${color.slate};
letter-spacing: 0.04em; letter-spacing: 0.04em;
padding: 0 ${layout.hpadding}; padding: 0 ${layout.hpadding};
`; `;

View File

@ -146,6 +146,7 @@
"react-addons-css-transition-group": "15.3.2", "react-addons-css-transition-group": "15.3.2",
"react-dom": "^15.6.1", "react-dom": "^15.6.1",
"react-dropzone": "3.6.0", "react-dropzone": "3.6.0",
"react-feather": "^1.0.7",
"react-helmet": "3.1.0", "react-helmet": "3.1.0",
"react-keydown": "^1.7.3", "react-keydown": "^1.7.3",
"react-modal": "^2.2.1", "react-modal": "^2.2.1",

View File

@ -7391,6 +7391,10 @@ react-dropzone@3.6.0:
dependencies: dependencies:
attr-accept "^1.0.3" attr-accept "^1.0.3"
react-feather@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/react-feather/-/react-feather-1.0.7.tgz#f2118f1d2402b0c1e6f23c732f9e7f9fd4ca61e2"
react-helmet@3.1.0: react-helmet@3.1.0:
version "3.1.0" version "3.1.0"
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-3.1.0.tgz#63486194682f33004826f3687dc49a138b557050" resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-3.1.0.tgz#63486194682f33004826f3687dc49a138b557050"