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

View File

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

View File

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