Show spinner whilst initial search request is in progress (#12883)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-08-12 14:44:07 +01:00 committed by GitHub
parent 239330b5e2
commit 0e37c09042
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,6 +23,7 @@ import { _t } from "../../../languageHandler";
import { PosthogScreenTracker } from "../../../PosthogTrackers"; import { PosthogScreenTracker } from "../../../PosthogTrackers";
import SearchWarning, { WarningKind } from "../elements/SearchWarning"; import SearchWarning, { WarningKind } from "../elements/SearchWarning";
import { SearchInfo, SearchScope } from "../../../Searching"; import { SearchInfo, SearchScope } from "../../../Searching";
import InlineSpinner from "../elements/InlineSpinner";
interface Props { interface Props {
searchInfo?: SearchInfo; searchInfo?: SearchInfo;
@ -41,13 +42,15 @@ const RoomSearchAuxPanel: React.FC<Props> = ({ searchInfo, isRoomEncrypted, onSe
<div className="mx_RoomSearchAuxPanel_summary"> <div className="mx_RoomSearchAuxPanel_summary">
<SearchIcon width="24px" height="24px" /> <SearchIcon width="24px" height="24px" />
<div className="mx_RoomSearchAuxPanel_summary_text"> <div className="mx_RoomSearchAuxPanel_summary_text">
{searchInfo {searchInfo?.count !== undefined ? (
? _t( _t(
"room|search|summary", "room|search|summary",
{ count: searchInfo.count ?? 0 }, { count: searchInfo.count },
{ query: () => <b>{searchInfo.term}</b> }, { query: () => <b>{searchInfo.term}</b> },
) )
: undefined} ) : (
<InlineSpinner />
)}
<SearchWarning kind={WarningKind.Search} isRoomEncrypted={isRoomEncrypted} showLogo={false} /> <SearchWarning kind={WarningKind.Search} isRoomEncrypted={isRoomEncrypted} showLogo={false} />
</div> </div>
</div> </div>