feat: Collection Icons (#1281)

* wip: Working for creation, and display

* feat: IconPicker

* fix

* feat: Invert collection icon color when dark in dark mode

* Improve readability of dropdown menus in dark mode
Suggest icon based on collection name

* Add additional icons
Tweaks and final polish

* fix: Write default icon as empty icon column

* feat: Improve icon selection logic
add more keywords
Improve icon coloring when selected and in dark mode

* lint

* lint
This commit is contained in:
Tom Moor
2020-06-19 17:18:03 -07:00
committed by GitHub
parent f3ea02fdd0
commit d864e228e7
21 changed files with 417 additions and 190 deletions

View File

@ -4,19 +4,14 @@ import { observer, inject } from 'mobx-react';
import breakpoint from 'styled-components-breakpoint';
import styled from 'styled-components';
import { Link } from 'react-router-dom';
import {
CollectionIcon,
PrivateCollectionIcon,
PadlockIcon,
GoToIcon,
MoreIcon,
} from 'outline-icons';
import { PadlockIcon, GoToIcon, MoreIcon } from 'outline-icons';
import Document from 'models/Document';
import CollectionsStore from 'stores/CollectionsStore';
import { collectionUrl } from 'utils/routeHelpers';
import Flex from 'shared/components/Flex';
import BreadcrumbMenu from './BreadcrumbMenu';
import CollectionIcon from 'components/CollectionIcon';
type Props = {
document: Document,
@ -56,11 +51,7 @@ const Breadcrumb = observer(({ document, collections, onlyText }: Props) => {
return (
<Wrapper justify="flex-start" align="center">
<CollectionName to={collectionUrl(collection.id)}>
{collection.private ? (
<PrivateCollectionIcon color={collection.color} expanded />
) : (
<CollectionIcon color={collection.color} expanded />
)}{' '}
<CollectionIcon collection={collection} expanded />{' '}
<span>{collection.name}</span>
</CollectionName>
{isNestedDocument && (