fix: Various React errors in console

This commit is contained in:
Tom Moor
2020-04-05 13:27:11 -07:00
parent 98b5350c65
commit 9d8e99400f
3 changed files with 8 additions and 2 deletions

View File

@ -45,11 +45,13 @@ class MainSidebar extends React.Component<Props> {
this.props.documents.fetchDrafts(); this.props.documents.fetchDrafts();
} }
handleCreateCollection = () => { handleCreateCollection = (ev: SyntheticEvent<>) => {
ev.preventDefault();
this.props.ui.setActiveModal('collection-new'); this.props.ui.setActiveModal('collection-new');
}; };
handleInviteModalOpen = () => { handleInviteModalOpen = (ev: SyntheticEvent<>) => {
ev.preventDefault();
this.inviteModalOpen = true; this.inviteModalOpen = true;
}; };
@ -145,6 +147,7 @@ class MainSidebar extends React.Component<Props> {
/> />
{can.invite && ( {can.invite && (
<SidebarLink <SidebarLink
to="/settings/people"
onClick={this.handleInviteModalOpen} onClick={this.handleInviteModalOpen}
icon={<PlusIcon />} icon={<PlusIcon />}
label="Invite people…" label="Invite people…"

View File

@ -66,9 +66,11 @@ class Collections extends React.Component<Props> {
/> />
))} ))}
<SidebarLink <SidebarLink
to="/collections"
onClick={this.props.onCreateCollection} onClick={this.props.onCreateCollection}
icon={<PlusIcon />} icon={<PlusIcon />}
label="New collection…" label="New collection…"
exact
/> />
</Flex> </Flex>
); );

View File

@ -51,6 +51,7 @@ export default function Contents({ document }: Props) {
<List> <List>
{headings.map(heading => ( {headings.map(heading => (
<ListItem <ListItem
key={heading.slug}
level={heading.level} level={heading.level}
active={activeSlug === heading.slug} active={activeSlug === heading.slug}
> >