Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 06e0404

Browse files
authored
Make empty state copy for TAC depend on the value of the setting (#12419)
* Make empty state copy for TAC depend on the value of the setting * Update test snapshot * Fix snapshot Run the whole file or the radix IDs will br wrong 🤦 * Simplify to a ternary
1 parent 2760f9d commit 06e0404

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/components/views/spaces/threads-activity-centre/ThreadsActivityCentre.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import { getKeyBindingsManager } from "../../../../KeyBindingsManager";
3636
import { KeyBindingAction } from "../../../../accessibility/KeyboardShortcuts";
3737
import { ReleaseAnnouncement } from "../../../structures/ReleaseAnnouncement";
3838
import { useIsReleaseAnnouncementOpen } from "../../../../hooks/useIsReleaseAnnouncementOpen";
39+
import { useSettingValue } from "../../../../hooks/useSettings";
3940

4041
interface ThreadsActivityCentreProps {
4142
/**
@@ -52,6 +53,11 @@ export function ThreadsActivityCentre({ displayButtonLabel }: ThreadsActivityCen
5253
const [open, setOpen] = useState(false);
5354
const roomsAndNotifications = useUnreadThreadRooms(open);
5455
const isReleaseAnnouncementOpen = useIsReleaseAnnouncementOpen("threadsActivityCentre");
56+
const settingTACOnlyNotifs = useSettingValue<boolean>("Notifications.tac_only_notifications");
57+
58+
const emptyCaption = settingTACOnlyNotifs
59+
? _t("threads_activity_centre|no_rooms_with_threads_notifs")
60+
: _t("threads_activity_centre|no_rooms_with_unread_threads");
5561

5662
return (
5763
<div
@@ -110,9 +116,7 @@ export function ThreadsActivityCentre({ displayButtonLabel }: ThreadsActivityCen
110116
/>
111117
))}
112118
{roomsAndNotifications.rooms.length === 0 && (
113-
<div className="mx_ThreadsActivityCentre_emptyCaption">
114-
{_t("threads_activity_centre|no_rooms_with_unreads_threads")}
115-
</div>
119+
<div className="mx_ThreadsActivityCentre_emptyCaption">{emptyCaption}</div>
116120
)}
117121
</div>
118122
</Menu>

src/i18n/strings/en_EN.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3167,7 +3167,8 @@
31673167
},
31683168
"threads_activity_centre": {
31693169
"header": "Threads activity",
3170-
"no_rooms_with_unreads_threads": "You don't have rooms with unread threads yet.",
3170+
"no_rooms_with_threads_notifs": "You don't have rooms with thread notifications yet.",
3171+
"no_rooms_with_unread_threads": "You don't have rooms with unread threads yet.",
31713172
"release_announcement_description": "Threads notifications have moved, find them here from now on.",
31723173
"release_announcement_header": "Threads Activity Centre"
31733174
},

test/components/views/spaces/__snapshots__/ThreadsActivityCentre-test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ exports[`ThreadsActivityCentre should match snapshot when empty 1`] = `
153153
<div
154154
class="mx_ThreadsActivityCentre_emptyCaption"
155155
>
156-
You don't have rooms with unread threads yet.
156+
You don't have rooms with thread notifications yet.
157157
</div>
158158
</div>
159159
</div>

0 commit comments

Comments
 (0)