Skip to content

Commit

Permalink
MM-20416: Migrate 'components/channel_header_mobile/collapse_lhs_butt…
Browse files Browse the repository at this point in the history
…on' module to TypeScript (mattermost#6971)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
  • Loading branch information
Revanth47 and mattermod committed Nov 18, 2020
1 parent 25e47b9 commit 60a6e12
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@
// See LICENSE.txt for license information.

import React from 'react';
import PropTypes from 'prop-types';
import {FormattedMessage} from 'react-intl';

import NotifyCounts from 'components/notify_counts';
import MenuIcon from 'components/widgets/icons/menu_icon';

const CollapseLhsButton = ({
type Props = {
actions: {
toggleLhs,
},
}) => (
toggleLhs: (e?:React.MouseEvent<HTMLButtonElement, MouseEvent>) => void
}
}

const CollapseLhsButton:React.FunctionComponent<Props> = (props: Props) => (
<button
key='navbar-toggle-sidebar'
type='button'
className='navbar-toggle'
data-toggle='collapse'
data-target='#sidebar-nav'
onClick={toggleLhs}
onClick={props.actions.toggleLhs}
>
<span className='sr-only'>
<FormattedMessage
Expand All @@ -32,10 +33,4 @@ const CollapseLhsButton = ({
</button>
);

CollapseLhsButton.propTypes = {
actions: PropTypes.shape({
toggleLhs: PropTypes.func.isRequired,
}).isRequired,
};

export default CollapseLhsButton;
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {bindActionCreators} from 'redux';
import {bindActionCreators, Dispatch} from 'redux';
import {connect} from 'react-redux';

import {GenericAction} from 'mattermost-redux/types/actions';

import {toggle as toggleLhs} from 'actions/views/lhs';

import CollapseLhsButton from './collapse_lhs_button';

const mapDispatchToProps = (dispatch) => ({
const mapDispatchToProps = (dispatch:Dispatch<GenericAction>) => ({
actions: bindActionCreators({
toggleLhs,
}, dispatch),
Expand Down

0 comments on commit 60a6e12

Please sign in to comment.