mirror of https://github.com/vector-im/riot-web
move help & communities button out of tag panel
so we can shove the custom tag buttons between them in the next commitpull/21833/head
parent
3265fe394d
commit
bdc7936130
|
@ -19,6 +19,7 @@
|
||||||
@import "./structures/_SearchBox.scss";
|
@import "./structures/_SearchBox.scss";
|
||||||
@import "./structures/_TabbedView.scss";
|
@import "./structures/_TabbedView.scss";
|
||||||
@import "./structures/_TagPanel.scss";
|
@import "./structures/_TagPanel.scss";
|
||||||
|
@import "./structures/_TagPanelButtons.scss";
|
||||||
@import "./structures/_TopLeftMenuButton.scss";
|
@import "./structures/_TopLeftMenuButton.scss";
|
||||||
@import "./structures/_UploadBar.scss";
|
@import "./structures/_UploadBar.scss";
|
||||||
@import "./structures/_UserSettings.scss";
|
@import "./structures/_UserSettings.scss";
|
||||||
|
|
|
@ -33,6 +33,11 @@ limitations under the License.
|
||||||
flex: 0 0 140px;
|
flex: 0 0 140px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mx_LeftPanel_tagPanelContainer {
|
||||||
|
flex: 0 0 70px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.mx_LeftPanel_hideButton {
|
.mx_LeftPanel_hideButton {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 10px;
|
top: 10px;
|
||||||
|
|
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.mx_TagPanel {
|
.mx_TagPanel {
|
||||||
flex: 0 0 70px;
|
flex: 1;
|
||||||
background-color: $tagpanel-bg-color;
|
background-color: $tagpanel-bg-color;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
@ -123,40 +123,3 @@ limitations under the License.
|
||||||
padding-left: 4px;
|
padding-left: 4px;
|
||||||
padding-right: 4px;
|
padding-right: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_TagPanel_groupsButton {
|
|
||||||
flex: 0;
|
|
||||||
margin: 17px 0 3px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mx_TagPanel_groupsButton > .mx_GroupsButton:before {
|
|
||||||
mask: url('$(res)/img/feather-icons/users.svg');
|
|
||||||
mask-position: center 11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mx_TagPanel_groupsButton > .mx_TagPanel_report:before {
|
|
||||||
mask: url('$(res)/img/feather-icons/life-buoy.svg');
|
|
||||||
mask-position: center 9px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mx_TagPanel_groupsButton > .mx_AccessibleButton {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
height: 40px;
|
|
||||||
width: 40px;
|
|
||||||
border-radius: 20px;
|
|
||||||
background-color: $roomheader-addroom-color;
|
|
||||||
position: relative;
|
|
||||||
/* overwrite mx_RoleButton inline-block */
|
|
||||||
display: block !important;
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
background-color: $tagpanel-bg-color;
|
|
||||||
mask-repeat: no-repeat;
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
/*
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
.mx_TagPanelButtons {
|
||||||
|
background-color: $tagpanel-bg-color;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 17px 0 3px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mx_TagPanelButtons > .mx_GroupsButton:before {
|
||||||
|
mask: url('$(res)/img/feather-icons/users.svg');
|
||||||
|
mask-position: center 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mx_TagPanelButtons > .mx_TagPanelButtons_report:before {
|
||||||
|
mask: url('$(res)/img/feather-icons/life-buoy.svg');
|
||||||
|
mask-position: center 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mx_TagPanelButtons > .mx_AccessibleButton {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
height: 40px;
|
||||||
|
width: 40px;
|
||||||
|
border-radius: 20px;
|
||||||
|
background-color: $roomheader-addroom-color;
|
||||||
|
position: relative;
|
||||||
|
/* overwrite mx_RoleButton inline-block */
|
||||||
|
display: block !important;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
background-color: $tagpanel-bg-color;
|
||||||
|
mask-repeat: no-repeat;
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
}
|
|
@ -24,7 +24,7 @@ import { KeyCode } from '../../Keyboard';
|
||||||
import sdk from '../../index';
|
import sdk from '../../index';
|
||||||
import dis from '../../dispatcher';
|
import dis from '../../dispatcher';
|
||||||
import VectorConferenceHandler from '../../VectorConferenceHandler';
|
import VectorConferenceHandler from '../../VectorConferenceHandler';
|
||||||
|
import TagPanelButtons from './TagPanelButtons';
|
||||||
import SettingsStore from '../../settings/SettingsStore';
|
import SettingsStore from '../../settings/SettingsStore';
|
||||||
|
|
||||||
|
|
||||||
|
@ -188,7 +188,13 @@ const LeftPanel = React.createClass({
|
||||||
const CallPreview = sdk.getComponent('voip.CallPreview');
|
const CallPreview = sdk.getComponent('voip.CallPreview');
|
||||||
|
|
||||||
const tagPanelEnabled = SettingsStore.getValue("TagPanel.enableTagPanel");
|
const tagPanelEnabled = SettingsStore.getValue("TagPanel.enableTagPanel");
|
||||||
const tagPanel = tagPanelEnabled ? <TagPanel /> : <div />;
|
let tagPanelContainer;
|
||||||
|
if (tagPanelEnabled) {
|
||||||
|
tagPanelContainer = (<div className="mx_LeftPanel_tagPanelContainer">
|
||||||
|
<TagPanel />
|
||||||
|
<TagPanelButtons />
|
||||||
|
</div>);
|
||||||
|
}
|
||||||
|
|
||||||
const containerClasses = classNames(
|
const containerClasses = classNames(
|
||||||
"mx_LeftPanel_container", "mx_fadable",
|
"mx_LeftPanel_container", "mx_fadable",
|
||||||
|
@ -206,7 +212,7 @@ const LeftPanel = React.createClass({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={containerClasses}>
|
<div className={containerClasses}>
|
||||||
{ tagPanel }
|
{ tagPanelContainer }
|
||||||
<aside className={"mx_LeftPanel dark-panel"} onKeyDown={ this._onKeyDown } onFocus={ this._onFocus } onBlur={ this._onBlur }>
|
<aside className={"mx_LeftPanel dark-panel"} onKeyDown={ this._onKeyDown } onFocus={ this._onFocus } onBlur={ this._onBlur }>
|
||||||
<TopLeftMenuButton collapsed={ this.props.collapsed } />
|
<TopLeftMenuButton collapsed={ this.props.collapsed } />
|
||||||
{ searchBox }
|
{ searchBox }
|
||||||
|
|
|
@ -23,7 +23,6 @@ import GroupActions from '../../actions/GroupActions';
|
||||||
|
|
||||||
import sdk from '../../index';
|
import sdk from '../../index';
|
||||||
import dis from '../../dispatcher';
|
import dis from '../../dispatcher';
|
||||||
import Modal from '../../Modal';
|
|
||||||
import { _t } from '../../languageHandler';
|
import { _t } from '../../languageHandler';
|
||||||
|
|
||||||
import { Droppable } from 'react-beautiful-dnd';
|
import { Droppable } from 'react-beautiful-dnd';
|
||||||
|
@ -48,8 +47,6 @@ const TagPanel = React.createClass({
|
||||||
this.context.matrixClient.on("Group.myMembership", this._onGroupMyMembership);
|
this.context.matrixClient.on("Group.myMembership", this._onGroupMyMembership);
|
||||||
this.context.matrixClient.on("sync", this._onClientSync);
|
this.context.matrixClient.on("sync", this._onClientSync);
|
||||||
|
|
||||||
this._dispatcherRef = dis.register(this._onAction);
|
|
||||||
|
|
||||||
this._tagOrderStoreToken = TagOrderStore.addListener(() => {
|
this._tagOrderStoreToken = TagOrderStore.addListener(() => {
|
||||||
if (this.unmounted) {
|
if (this.unmounted) {
|
||||||
return;
|
return;
|
||||||
|
@ -70,9 +67,6 @@ const TagPanel = React.createClass({
|
||||||
if (this._filterStoreToken) {
|
if (this._filterStoreToken) {
|
||||||
this._filterStoreToken.remove();
|
this._filterStoreToken.remove();
|
||||||
}
|
}
|
||||||
if (this._dispatcherRef) {
|
|
||||||
dis.unregister(this._dispatcherRef);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_onGroupMyMembership() {
|
_onGroupMyMembership() {
|
||||||
|
@ -106,21 +100,11 @@ const TagPanel = React.createClass({
|
||||||
dis.dispatch({action: 'deselect_tags'});
|
dis.dispatch({action: 'deselect_tags'});
|
||||||
},
|
},
|
||||||
|
|
||||||
_onAction(payload) {
|
|
||||||
if (payload.action === "show_redesign_feedback_dialog") {
|
|
||||||
const RedesignFeedbackDialog =
|
|
||||||
sdk.getComponent("views.dialogs.RedesignFeedbackDialog");
|
|
||||||
Modal.createDialog(RedesignFeedbackDialog);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const GroupsButton = sdk.getComponent('elements.GroupsButton');
|
|
||||||
const DNDTagTile = sdk.getComponent('elements.DNDTagTile');
|
const DNDTagTile = sdk.getComponent('elements.DNDTagTile');
|
||||||
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
|
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
|
||||||
const TintableSvg = sdk.getComponent('elements.TintableSvg');
|
const TintableSvg = sdk.getComponent('elements.TintableSvg');
|
||||||
const GeminiScrollbarWrapper = sdk.getComponent("elements.GeminiScrollbarWrapper");
|
const GeminiScrollbarWrapper = sdk.getComponent("elements.GeminiScrollbarWrapper");
|
||||||
const ActionButton = sdk.getComponent("elements.ActionButton");
|
|
||||||
|
|
||||||
const tags = this.state.orderedTags.map((tag, index) => {
|
const tags = this.state.orderedTags.map((tag, index) => {
|
||||||
return <DNDTagTile
|
return <DNDTagTile
|
||||||
|
@ -174,13 +158,6 @@ const TagPanel = React.createClass({
|
||||||
) }
|
) }
|
||||||
</Droppable>
|
</Droppable>
|
||||||
</GeminiScrollbarWrapper>
|
</GeminiScrollbarWrapper>
|
||||||
<div className="mx_TagPanel_divider" />
|
|
||||||
<div className="mx_TagPanel_groupsButton">
|
|
||||||
<GroupsButton />
|
|
||||||
<ActionButton
|
|
||||||
className="mx_TagPanel_report" action="show_redesign_feedback_dialog"
|
|
||||||
label={_t("Report bugs & give feedback")} tooltip={true} />
|
|
||||||
</div>
|
|
||||||
</div>;
|
</div>;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
/*
|
||||||
|
Copyright 2017, 2018 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 dis from '../../dispatcher';
|
||||||
|
import Modal from '../../Modal';
|
||||||
|
import { _t } from '../../languageHandler';
|
||||||
|
|
||||||
|
const TagPanelButtons = React.createClass({
|
||||||
|
displayName: 'TagPanelButtons',
|
||||||
|
|
||||||
|
|
||||||
|
componentWillMount: function() {
|
||||||
|
this._dispatcherRef = dis.register(this._onAction);
|
||||||
|
},
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
if (this._dispatcherRef) {
|
||||||
|
dis.unregister(this._dispatcherRef);
|
||||||
|
this._dispatcherRef = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_onAction(payload) {
|
||||||
|
if (payload.action === "show_redesign_feedback_dialog") {
|
||||||
|
const RedesignFeedbackDialog =
|
||||||
|
sdk.getComponent("views.dialogs.RedesignFeedbackDialog");
|
||||||
|
Modal.createDialog(RedesignFeedbackDialog);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const GroupsButton = sdk.getComponent('elements.GroupsButton');
|
||||||
|
const ActionButton = sdk.getComponent("elements.ActionButton");
|
||||||
|
|
||||||
|
return (<div className="mx_TagPanelButtons">
|
||||||
|
<GroupsButton />
|
||||||
|
<ActionButton
|
||||||
|
className="mx_TagPanelButtons_report" action="show_redesign_feedback_dialog"
|
||||||
|
label={_t("Report bugs & give feedback")} tooltip={true} />
|
||||||
|
</div>);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
export default TagPanelButtons;
|
Loading…
Reference in New Issue