Update prop type & documentation for HistoryVisibleBanner and VM. (#31545)

* docs: Update documentation for HistoryVisibleBanner and VM.

* docs: Improve documentation for `HistoryVisibleBanner`, second pass.

* docs: Move documentation to prop types over FC.

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* fix: Simplify type for `HistoryVisibleBannerViewModel` `threadId`.

* docs: Apply suggestions from code review

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
This commit is contained in:
Skye Elliot
2025-12-17 16:04:53 +00:00
committed by GitHub
parent e696f92bd3
commit 4da149e56f
4 changed files with 64 additions and 7 deletions

View File

@@ -54,7 +54,7 @@ describe("HistoryVisibleBannerViewModel", () => {
});
it("should not show the banner in unencrypted rooms", () => {
const vm = new HistoryVisibleBannerViewModel({ room });
const vm = new HistoryVisibleBannerViewModel({ room, threadId: null });
expect(vm.getSnapshot().visible).toBe(false);
});
@@ -76,7 +76,7 @@ describe("HistoryVisibleBannerViewModel", () => {
}),
]);
const vm = new HistoryVisibleBannerViewModel({ room });
const vm = new HistoryVisibleBannerViewModel({ room, threadId: null });
expect(vm.getSnapshot().visible).toBe(false);
});
@@ -99,7 +99,7 @@ describe("HistoryVisibleBannerViewModel", () => {
}),
]);
const vm = new HistoryVisibleBannerViewModel({ room });
const vm = new HistoryVisibleBannerViewModel({ room, threadId: null });
expect(vm.getSnapshot().visible).toBe(false);
vm.dispose();
});
@@ -145,7 +145,7 @@ describe("HistoryVisibleBannerViewModel", () => {
}),
]);
const vm = new HistoryVisibleBannerViewModel({ room });
const vm = new HistoryVisibleBannerViewModel({ room, threadId: null });
expect(vm.getSnapshot().visible).toBe(true);
await vm.onClose();
expect(vm.getSnapshot().visible).toBe(false);