summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-05-17 11:26:22 -0400
committerCorey Hulen <corey@hulen.com>2017-05-17 08:26:22 -0700
commita84a300947e3995945db2789dbf062c2e18c7b8e (patch)
tree56da18952e5e40356ab9260b4c09a9ad7cd20197 /webapp
parentf13b2ffbe1c92fce1f031db7ecee2477d0e69621 (diff)
downloadchat-a84a300947e3995945db2789dbf062c2e18c7b8e.tar.gz
chat-a84a300947e3995945db2789dbf062c2e18c7b8e.tar.bz2
chat-a84a300947e3995945db2789dbf062c2e18c7b8e.zip
PLT-6520 Add RhsDropdownButton component to avoid React-Bootstrap warning (#6405)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/rhs_dropdown.jsx25
-rw-r--r--webapp/components/rhs_dropdown_button.jsx20
2 files changed, 32 insertions, 13 deletions
diff --git a/webapp/components/rhs_dropdown.jsx b/webapp/components/rhs_dropdown.jsx
index 9c0f4d7b1..c6a10fa9e 100644
--- a/webapp/components/rhs_dropdown.jsx
+++ b/webapp/components/rhs_dropdown.jsx
@@ -1,24 +1,28 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
-import * as Agent from 'utils/user_agent.jsx';
+import React, {Component, PropTypes} from 'react';
+import {Dropdown} from 'react-bootstrap';
+
+import RhsDropdownButton from 'components/rhs_dropdown_button.jsx';
import RhsDropdownMenu from 'components/rhs_dropdown_menu.jsx';
-import {Dropdown} from 'react-bootstrap';
-import React from 'react';
+import * as Agent from 'utils/user_agent.jsx';
+
+export default class RhsDropdown extends Component {
+ static propTypes = {
+ dropdownContents: PropTypes.array.isRequired
+ }
-export default class RhsDropdown extends React.Component {
constructor(props) {
super(props);
- this.toggleDropdown = this.toggleDropdown.bind(this);
-
this.state = {
showDropdown: false
};
}
- toggleDropdown() {
+ toggleDropdown = () => {
const showDropdown = !this.state.showDropdown;
if (Agent.isMobile() || Agent.isMobileApp()) {
const scroll = document.querySelector('.scrollbar--view');
@@ -39,9 +43,7 @@ export default class RhsDropdown extends React.Component {
open={this.state.showDropdown}
onToggle={this.toggleDropdown}
>
- <a
- href='#'
- className='post__dropdown dropdown-toggle'
+ <RhsDropdownButton
bsRole='toggle'
onClick={this.toggleDropdown}
/>
@@ -53,6 +55,3 @@ export default class RhsDropdown extends React.Component {
}
}
-RhsDropdown.propTypes = {
- dropdownContents: React.PropTypes.array.isRequired
-};
diff --git a/webapp/components/rhs_dropdown_button.jsx b/webapp/components/rhs_dropdown_button.jsx
new file mode 100644
index 000000000..3c325a431
--- /dev/null
+++ b/webapp/components/rhs_dropdown_button.jsx
@@ -0,0 +1,20 @@
+// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import React, {PropTypes, PureComponent} from 'react';
+
+export default class RhsDropdownButton extends PureComponent {
+ static propTypes = {
+ onClick: PropTypes.func.isRequired
+ }
+
+ render() {
+ return (
+ <a
+ href='#'
+ className='post__dropdown dropdown-toggle'
+ onClick={this.props.onClick}
+ />
+ );
+ }
+}