From 8bd1f384b94d37ad150874ca64e2f3f962a2ae23 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 8 Sep 2021 10:16:20 +0100 Subject: [PATCH] Improve tooltips on space quick actions and explore button --- src/components/structures/LeftPanel.tsx | 4 +++- src/components/views/rooms/RoomList.tsx | 12 ++++++++---- src/i18n/strings/en_EN.json | 1 + 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/structures/LeftPanel.tsx b/src/components/structures/LeftPanel.tsx index d9552712492..9a2ebd45e28 100644 --- a/src/components/structures/LeftPanel.tsx +++ b/src/components/structures/LeftPanel.tsx @@ -399,7 +399,9 @@ export default class LeftPanel extends React.Component { mx_LeftPanel_exploreButton_space: !!this.state.activeSpace, })} onClick={this.onExplore} - title={_t("Explore rooms")} + title={this.state.activeSpace + ? _t("Explore %(spaceName)s", { spaceName: this.state.activeSpace.name }) + : _t("Explore rooms")} /> ); diff --git a/src/components/views/rooms/RoomList.tsx b/src/components/views/rooms/RoomList.tsx index 4988ea6691e..541d0e1d9dc 100644 --- a/src/components/views/rooms/RoomList.tsx +++ b/src/components/views/rooms/RoomList.tsx @@ -48,6 +48,7 @@ import SpaceStore, { ISuggestedRoom, SUGGESTED_ROOMS } from "../../../stores/Spa import { showAddExistingRooms, showCreateNewRoom, showSpaceInvite } from "../../../utils/space"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import RoomAvatar from "../avatars/RoomAvatar"; +import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; interface IProps { onKeyDown: (ev: React.KeyboardEvent) => void; @@ -522,20 +523,23 @@ export default class RoomList extends React.PureComponent { } else if ( this.props.activeSpace?.canInvite(userId) || this.props.activeSpace?.getMyMembership() === "join" ) { + const spaceName = this.props.activeSpace.name; explorePrompt =
{ _t("Quick actions") }
- { this.props.activeSpace.canInvite(userId) && { _t("Invite people") } - } - { this.props.activeSpace.getMyMembership() === "join" && } + { this.props.activeSpace.getMyMembership() === "join" && { _t("Explore rooms") } - } + }
; } else if (Object.values(this.state.sublists).some(list => list.length > 0)) { const unfilteredLists = RoomListStore.instance.unfilteredLists; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 7d754a618ab..b2f09686bb3 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1643,6 +1643,7 @@ "Start a new chat": "Start a new chat", "Explore all public rooms": "Explore all public rooms", "Quick actions": "Quick actions", + "Explore %(spaceName)s": "Explore %(spaceName)s", "Use the + to make a new room or explore existing ones below": "Use the + to make a new room or explore existing ones below", "%(count)s results in all spaces|other": "%(count)s results in all spaces", "%(count)s results in all spaces|one": "%(count)s result in all spaces",