Fixed React warnings

This commit is contained in:
Jori Lallo
2017-12-05 01:22:22 -08:00
parent 5a0f3d027a
commit 866c43b2cb
3 changed files with 16 additions and 10 deletions

View File

@ -29,8 +29,8 @@ const Collaborators = ({ document }: Props) => {
<Avatars>
<StyledTooltip tooltip={tooltip} placement="bottom">
{collaborators.map(user => (
<AvatarWrapper>
<Avatar key={user.id} src={user.avatarUrl} />
<AvatarWrapper key={user.id}>
<Avatar src={user.avatarUrl} />
</AvatarWrapper>
))}
</StyledTooltip>

View File

@ -98,13 +98,13 @@ class DocumentPreview extends Component {
<h3>
<Highlight text={document.title} highlight={highlight} />
{document.starred ? (
<a onClick={this.unstar}>
<span onClick={this.unstar}>
<StyledStar solid />
</a>
</span>
) : (
<a onClick={this.star}>
<span onClick={this.star}>
<StyledStar />
</a>
</span>
)}
</h3>
<PublishingInfo

View File

@ -45,12 +45,18 @@ class Dashboard extends Component {
{showContent ? (
<span>
{hasRecentlyViewed && [
<Subheading>Recently viewed</Subheading>,
<DocumentList documents={documents.recentlyViewed} />,
<Subheading key="viewed">Recently viewed</Subheading>,
<DocumentList
key="viewedDocuments"
documents={documents.recentlyViewed}
/>,
]}
{hasRecentlyEdited && [
<Subheading>Recently edited</Subheading>,
<DocumentList documents={documents.recentlyEdited} />,
<Subheading key="edited">Recently edited</Subheading>,
<DocumentList
key="editedDocuments"
documents={documents.recentlyEdited}
/>,
]}
</span>
) : (