mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 10:15:43 +03:00
add feature flag for grid view
This commit is contained in:
parent
8fa7ec0fac
commit
c2f6fc381c
3 changed files with 22 additions and 10 deletions
|
@ -21,6 +21,7 @@ import dis from '../../../dispatcher';
|
|||
import TagOrderActions from '../../../actions/TagOrderActions';
|
||||
import MatrixClientPeg from '../../../MatrixClientPeg';
|
||||
import sdk from '../../../index';
|
||||
import SettingsStore from "../../../settings/SettingsStore";
|
||||
|
||||
export default class TagTileContextMenu extends React.Component {
|
||||
static propTypes = {
|
||||
|
@ -64,6 +65,18 @@ export default class TagTileContextMenu extends React.Component {
|
|||
|
||||
render() {
|
||||
const TintableSvg = sdk.getComponent("elements.TintableSvg");
|
||||
let gridViewOption;
|
||||
if (SettingsStore.isFeatureEnabled("feature_gridview")) {
|
||||
gridViewOption = (<div className="mx_TagTileContextMenu_item" onClick={this._onViewAsGridClick} >
|
||||
<TintableSvg
|
||||
className="mx_TagTileContextMenu_item_icon"
|
||||
src="img/icons-gridview.svg"
|
||||
width="15"
|
||||
height="15"
|
||||
/>
|
||||
{ _t('View as grid') }
|
||||
</div>);
|
||||
}
|
||||
return <div>
|
||||
<div className="mx_TagTileContextMenu_item" onClick={this._onViewCommunityClick} >
|
||||
<TintableSvg
|
||||
|
@ -74,15 +87,7 @@ export default class TagTileContextMenu extends React.Component {
|
|||
/>
|
||||
{ _t('View Community') }
|
||||
</div>
|
||||
<div className="mx_TagTileContextMenu_item" onClick={this._onViewAsGridClick} >
|
||||
<TintableSvg
|
||||
className="mx_TagTileContextMenu_item_icon"
|
||||
src="img/icons-gridview.svg"
|
||||
width="15"
|
||||
height="15"
|
||||
/>
|
||||
{ _t('View as grid') }
|
||||
</div>
|
||||
{ gridViewOption }
|
||||
<hr className="mx_TagTileContextMenu_separator" />
|
||||
<div className="mx_TagTileContextMenu_item" onClick={this._onRemoveClick} >
|
||||
<img className="mx_TagTileContextMenu_item_icon" src="img/icon_context_delete.svg" width="15" height="15" />
|
||||
|
|
|
@ -1405,5 +1405,6 @@
|
|||
"Failed to set direct chat tag": "Failed to set direct chat tag",
|
||||
"Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room",
|
||||
"Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room",
|
||||
"View as grid": "View as grid"
|
||||
"View as grid": "View as grid",
|
||||
"Allow up to 6 rooms in a community to be shown simultaneously in a grid via the context menu": "Allow up to 6 rooms in a community to be shown simultaneously in a grid via the context menu"
|
||||
}
|
||||
|
|
|
@ -102,6 +102,12 @@ export const SETTINGS = {
|
|||
supportedLevels: LEVELS_FEATURE,
|
||||
default: false,
|
||||
},
|
||||
"feature_gridview": {
|
||||
isFeature: true,
|
||||
displayName: _td("Allow up to 6 rooms in a community to be shown simultaneously in a grid via the context menu"),
|
||||
supportedLevels: LEVELS_FEATURE,
|
||||
default: false,
|
||||
},
|
||||
"MessageComposerInput.dontSuggestEmoji": {
|
||||
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
||||
displayName: _td('Disable Emoji suggestions while typing'),
|
||||
|
|
Loading…
Reference in a new issue