generated from mattermost/mattermost-plugin-starter-template
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mm 91 add active status to header icon (#96)
* MM-91/add active status to header icon * #MM-91/add active class to span tag inside button wrap * MM-91/Response to reviewer comments * MM-91/Response to second reviewer comments * MM-91/Response to reviewer comment * MM-91/Response to PR review comment, naming adjustment and incorporate selectors in mapping state
- Loading branch information
Showing
9 changed files
with
76 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
webapp/src/components/channel_header_button/channel_header_button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. | ||
// See LICENSE.txt for license information. | ||
|
||
import React from 'react'; | ||
|
||
type Props = { | ||
shouldHighlight: boolean, | ||
}; | ||
|
||
export default function ChannelHeaderButton(props: Props) { | ||
return ( | ||
<span className={props.shouldHighlight ? 'channel-header__icon--active' : ''} > | ||
<i className='icon fa fa-list '/> | ||
</span> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. | ||
// See LICENSE.txt for license information. | ||
|
||
import {connect} from 'react-redux'; | ||
import { bindActionCreators } from 'redux'; | ||
|
||
import { isRhsVisible } from 'selectors'; | ||
|
||
import {showRHSPlugin} from 'actions'; | ||
|
||
import ChannelHeaderButton from './channel_header_button'; | ||
|
||
function mapStateToProps(state) { | ||
return { | ||
shouldHighlight: isRhsVisible(state), | ||
}; | ||
} | ||
|
||
function mapDispatchToProp(dispatch) { | ||
return { | ||
actions: bindActionCreators({ | ||
showRHSPlugin, | ||
}, dispatch), | ||
}; | ||
} | ||
|
||
export default connect(mapStateToProps, mapDispatchToProp)(ChannelHeaderButton); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters