Add highlighting to search results as mocked.

This commit is contained in:
Tom Moor
2017-11-25 15:44:10 -08:00
parent 8b2f6f193f
commit 2d8a41a982
5 changed files with 76 additions and 13 deletions

View File

@@ -5,6 +5,7 @@ import { Link } from 'react-router-dom';
import Document from 'models/Document';
import styled from 'styled-components';
import { color } from 'shared/styles/constants';
import Highlight from 'components/Highlight';
import StarredIcon from 'components/Icon/StarredIcon';
import PublishingInfo from './components/PublishingInfo';
@@ -84,12 +85,18 @@ class DocumentPreview extends Component {
};
render() {
const { document, showCollection, innerRef, ...rest } = this.props;
const {
document,
showCollection,
innerRef,
highlight,
...rest
} = this.props;
return (
<DocumentLink to={document.url} innerRef={innerRef} {...rest}>
<h3>
{document.title}
<Highlight text={document.title} highlight={highlight} />
{document.starred ? (
<a onClick={this.unstar}>
<StyledStar solid />