Change menu label if in a community
This commit is contained in:
parent
b294ec6427
commit
fd71bca7c0
3 changed files with 12 additions and 1 deletions
|
@ -45,6 +45,7 @@ import { arrayFastClone, arrayHasDiff } from "../../../utils/arrays";
|
|||
import { objectShallowClone, objectWithOnly } from "../../../utils/objects";
|
||||
import { IconizedContextMenuOption, IconizedContextMenuOptionList } from "../context_menus/IconizedContextMenu";
|
||||
import AccessibleButton from "../elements/AccessibleButton";
|
||||
import TagOrderStore from "../../../stores/TagOrderStore";
|
||||
|
||||
interface IProps {
|
||||
onKeyDown: (ev: React.KeyboardEvent) => void;
|
||||
|
@ -129,7 +130,9 @@ const TAG_AESTHETICS: {
|
|||
}}
|
||||
/>
|
||||
<IconizedContextMenuOption
|
||||
label={_t("Explore public rooms")}
|
||||
label={TagOrderStore.getSelectedPrototypeTag()
|
||||
? _t("Explore community rooms")
|
||||
: _t("Explore public rooms")}
|
||||
iconClassName="mx_RoomList_iconExplore"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
|
|
|
@ -1121,6 +1121,7 @@
|
|||
"Rooms": "Rooms",
|
||||
"Add room": "Add room",
|
||||
"Create new room": "Create new room",
|
||||
"Explore community rooms": "Explore community rooms",
|
||||
"Explore public rooms": "Explore public rooms",
|
||||
"Low priority": "Low priority",
|
||||
"System Alerts": "System Alerts",
|
||||
|
|
|
@ -285,6 +285,13 @@ class TagOrderStore extends Store {
|
|||
getSelectedTags() {
|
||||
return this._state.selectedTags;
|
||||
}
|
||||
|
||||
getSelectedPrototypeTag() {
|
||||
if (SettingsStore.getValue("feature_communities_v2_prototypes")) {
|
||||
return this.getSelectedTags()[0];
|
||||
}
|
||||
return null; // no selection as far as this function is concerned
|
||||
}
|
||||
}
|
||||
|
||||
if (global.singletonTagOrderStore === undefined) {
|
||||
|
|
Loading…
Reference in a new issue