From 40679b57fc9e8ab05f00a2b498243ef5ee998b66 Mon Sep 17 00:00:00 2001 From: Chen-I Lim Date: Thu, 12 Nov 2020 17:26:32 -0800 Subject: [PATCH] Fix linting --- webapp/src/widgets/menuWrapper.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webapp/src/widgets/menuWrapper.tsx b/webapp/src/widgets/menuWrapper.tsx index 2bd8a8014..638aed948 100644 --- a/webapp/src/widgets/menuWrapper.tsx +++ b/webapp/src/widgets/menuWrapper.tsx @@ -31,13 +31,13 @@ export default class MenuWrapper extends React.PureComponent { this.node = React.createRef() } - public componentDidMount() { + public componentDidMount(): void { document.addEventListener('menuItemClicked', this.close, true) document.addEventListener('click', this.closeOnBlur, true) document.addEventListener('keyup', this.keyboardClose, true) } - public componentWillUnmount() { + public componentWillUnmount(): void { document.removeEventListener('menuItemClicked', this.close, true) document.removeEventListener('click', this.closeOnBlur, true) document.removeEventListener('keyup', this.keyboardClose, true) @@ -61,13 +61,13 @@ export default class MenuWrapper extends React.PureComponent { this.close() } - public close = () => { + public close = (): void => { if (this.state.open) { this.setState({open: false}) } } - toggle = (e: React.MouseEvent) => { + private toggle = (e: React.MouseEvent): void => { /** * This is only here so that we can toggle the menus in the sidebar, because the default behavior of the mobile * version (ie the one that uses a modal) needs propagation to close the modal after selecting something @@ -82,7 +82,7 @@ export default class MenuWrapper extends React.PureComponent { this.setState({open: newState}) } - public render() { + public render(): JSX.Element { const {children} = this.props return (