Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

MM-20416: Migrate 'components/channel_header_mobile/collapse_lhs_button' module to TypeScript #6971

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
MM-20416: Migrate 'components/channel_header_mobile/collapse_lhs_butt…
…on' module to TypeScript
  • Loading branch information
Revanth47 committed Nov 7, 2020
commit 05edb5a962d5594bd2bb1ece4b921de7d7d7793b
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