fix: Various React errors in console
This commit is contained in:
@ -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…"
|
||||||
|
@ -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>
|
||||||
);
|
);
|
||||||
|
@ -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}
|
||||||
>
|
>
|
||||||
|
Reference in New Issue
Block a user