Add Room List join rooms prompt
This commit is contained in:
parent
fa9490b02b
commit
ce9d31a778
1 changed files with 22 additions and 7 deletions
|
@ -368,13 +368,28 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
|
||||||
|
|
||||||
public render() {
|
public render() {
|
||||||
let explorePrompt: JSX.Element;
|
let explorePrompt: JSX.Element;
|
||||||
if (!this.props.isMinimized && RoomListStore.instance.getFirstNameFilterCondition()) {
|
if (!this.props.isMinimized) {
|
||||||
explorePrompt = <div className="mx_RoomList_explorePrompt">
|
if (RoomListStore.instance.getFirstNameFilterCondition()) {
|
||||||
<div>{_t("Can't see what you’re looking for?")}</div>
|
explorePrompt = <div className="mx_RoomList_explorePrompt">
|
||||||
<AccessibleButton kind="link" onClick={this.onExplore}>
|
<div>{_t("Can't see what you’re looking for?")}</div>
|
||||||
{_t("Explore all public rooms")}
|
<AccessibleButton kind="link" onClick={this.onExplore}>
|
||||||
</AccessibleButton>
|
{_t("Explore all public rooms")}
|
||||||
</div>;
|
</AccessibleButton>
|
||||||
|
</div>;
|
||||||
|
} else if (Object.values(this.state.sublists).some(list => list.length > 0)) {
|
||||||
|
const unfilteredLists = RoomListStore.instance.unfilteredLists
|
||||||
|
const unfilteredRooms = unfilteredLists[DefaultTagID.Untagged] || [];
|
||||||
|
const unfilteredHistorical = unfilteredLists[DefaultTagID.Archived] || [];
|
||||||
|
// show a prompt to join/create rooms if the user is in 0 rooms and no historical
|
||||||
|
if (unfilteredRooms.length < 1 && unfilteredHistorical < 1) {
|
||||||
|
explorePrompt = <div className="mx_RoomList_explorePrompt">
|
||||||
|
<div>{_t("Use the + to make a new room or explore existing ones below")}</div>
|
||||||
|
<AccessibleButton kind="link" onClick={this.onExplore}>
|
||||||
|
{_t("Explore all public rooms")}
|
||||||
|
</AccessibleButton>
|
||||||
|
</div>;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const sublists = this.renderSublists();
|
const sublists = this.renderSublists();
|
||||||
|
|
Loading…
Reference in a new issue