From 929c8627d323deea8c3c4d2137ee56e307838d38 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 27 Sep 2017 17:45:49 +0100 Subject: [PATCH 1/3] Add button to get to MyGroups (view_my_groups or path #/groups) --- src/components/structures/MyGroups.js | 2 +- src/components/views/elements/GroupsButton.js | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 src/components/views/elements/GroupsButton.js diff --git a/src/components/structures/MyGroups.js b/src/components/structures/MyGroups.js index 624f3c67dd..3752e76f89 100644 --- a/src/components/structures/MyGroups.js +++ b/src/components/structures/MyGroups.js @@ -102,7 +102,7 @@ export default withMatrixClient(React.createClass({ } return
- +
diff --git a/src/components/views/elements/GroupsButton.js b/src/components/views/elements/GroupsButton.js new file mode 100644 index 0000000000..61460f747d --- /dev/null +++ b/src/components/views/elements/GroupsButton.js @@ -0,0 +1,39 @@ +/* +Copyright 2017 New Vector Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import React from 'react'; +import sdk from '../../../index'; +import PropTypes from 'prop-types'; +import { _t } from '../../../languageHandler'; + +const GroupsButton = function(props) { + const ActionButton = sdk.getComponent('elements.ActionButton'); + return ( + + ); +}; + +GroupsButton.propTypes = { + size: PropTypes.string, + tooltip: PropTypes.bool, +}; + +export default GroupsButton; From 18e0d8da860cde51df53bb7d09132e5f739e009c Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 29 Sep 2017 10:27:40 +0100 Subject: [PATCH 2/3] Rename Flair feature to Groups --- src/UserSettingsStore.js | 4 ++-- src/components/views/elements/Flair.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/UserSettingsStore.js b/src/UserSettingsStore.js index 1d1924cd23..9b7554bda2 100644 --- a/src/UserSettingsStore.js +++ b/src/UserSettingsStore.js @@ -35,7 +35,7 @@ export default { }, { name: "-", - id: 'feature_flair', + id: 'feature_groups', default: false, }, ], @@ -43,7 +43,7 @@ export default { // horrible but it works. The locality makes this somewhat more palatable. doTranslations: function() { this.LABS_FEATURES[0].name = _t("Matrix Apps"); - this.LABS_FEATURES[1].name = _t("Flair"); + this.LABS_FEATURES[1].name = _t("Groups"); }, loadProfileInfo: function() { diff --git a/src/components/views/elements/Flair.js b/src/components/views/elements/Flair.js index 11dbcbc021..61df660fd5 100644 --- a/src/components/views/elements/Flair.js +++ b/src/components/views/elements/Flair.js @@ -191,7 +191,7 @@ export default class Flair extends React.Component { componentWillMount() { this._unmounted = false; - if (UserSettingsStore.isFeatureEnabled('feature_flair') && groupSupport) { + if (UserSettingsStore.isFeatureEnabled('feature_groups') && groupSupport) { this._generateAvatars(); } } From c8b215815655397ed831e0052e1692277b473d3b Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 29 Sep 2017 10:42:23 +0100 Subject: [PATCH 3/3] Lint --- src/components/views/elements/GroupsButton.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/views/elements/GroupsButton.js b/src/components/views/elements/GroupsButton.js index 61460f747d..f973fda74a 100644 --- a/src/components/views/elements/GroupsButton.js +++ b/src/components/views/elements/GroupsButton.js @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React from 'react'; import sdk from '../../../index'; import PropTypes from 'prop-types'; import { _t } from '../../../languageHandler'; @@ -23,7 +22,7 @@ const GroupsButton = function(props) { const ActionButton = sdk.getComponent('elements.ActionButton'); return (