summaryrefslogtreecommitdiffstats
path: root/webapp/components/status_dropdown/index.jsx
diff options
context:
space:
mode:
authorDavid Rojas Camaggi <drojascamaggi@gmail.com>2017-06-06 09:45:36 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2017-06-06 09:45:36 -0400
commit46fc47e520efeff328db9b125c5339baac7b88e5 (patch)
tree99482c33de3b18dbbb0f0964b67ba0f898afe153 /webapp/components/status_dropdown/index.jsx
parent382ba0b0d18f67d473ad677f9b5151bc5e468e14 (diff)
downloadchat-46fc47e520efeff328db9b125c5339baac7b88e5.tar.gz
chat-46fc47e520efeff328db9b125c5339baac7b88e5.tar.bz2
chat-46fc47e520efeff328db9b125c5339baac7b88e5.zip
PLT 6416 Add StatusDropdown to profile picture in top left (#6327) (#6418)
* PLT-6416 the profile picture is always shown in the top left (#6327) * PLT-6416 Add status icon to profile picture in left sidebar (#6327) * PLT-6416 Add StatusDropdown to profile picture in top left (#6327) * Fixing theme stuff for status picker * PLT-6416 Automatically close status dropdown after selection (#6327) * PLT-6416 Avoid render status dropdown in sidebar if isMobile (#6327) * PLT-6416 Change icon for status change to caret-down (#6327) * PLT-6416 Update visibility of status dropdown after window size (#6327) * PLT-6416 Refactor status dropdown for better mouse usability (#6327) * PLT-6416 Change status dropdown to the redux way (#6327) * PLT-6416 Fix header style of admin sidebar (#6327)
Diffstat (limited to 'webapp/components/status_dropdown/index.jsx')
-rw-r--r--webapp/components/status_dropdown/index.jsx33
1 files changed, 33 insertions, 0 deletions
diff --git a/webapp/components/status_dropdown/index.jsx b/webapp/components/status_dropdown/index.jsx
new file mode 100644
index 000000000..bd2f7d7d0
--- /dev/null
+++ b/webapp/components/status_dropdown/index.jsx
@@ -0,0 +1,33 @@
+import {setStatus} from 'mattermost-redux/actions/users';
+import {connect} from 'react-redux';
+import {bindActionCreators} from 'redux';
+import {
+ getCurrentUser,
+ getStatusForUserId
+} from 'mattermost-redux/selectors/entities/users';
+import {Client} from 'mattermost-redux/client';
+
+import StatusDropdown from 'components/status_dropdown/status_dropdown.jsx';
+
+function mapStateToProps(state) {
+ const currentUser = getCurrentUser(state);
+ const userId = currentUser.id;
+ const lastPicUpdate = currentUser.last_picture_update;
+ const profilePicture = Client.getProfilePictureUrl(userId, lastPicUpdate);
+ const status = getStatusForUserId(state, currentUser.id);
+ return {
+ userId,
+ profilePicture,
+ status
+ };
+}
+
+function mapDispatchToProps(dispatch) {
+ return {
+ actions: bindActionCreators({
+ setStatus
+ }, dispatch)
+ };
+}
+
+export default connect(mapStateToProps, mapDispatchToProps)(StatusDropdown);