mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 07:26:19 +00:00
3bce0c0191
Visual polish, first wave:
- NavigatorEmptyStateView: replaces the bare "No rooms found" text with a
centered icon + message + a Create-room CTA. Reuses existing i18n keys
(navigator.search.returned.no.results / .roomsettings.moderation.none /
.createroom.create) so no new localization entries are needed.
- NavigatorSearchSkeletonView: animate-pulse placeholder rows shown while a
search is in flight and no result is cached yet (matches the HK dashboard
skeleton pattern). Replaces the NitroCard.Content spinner overlay for the
result list.
Bug fix bundled in: NavigatorSearchView called useNavigatorSearch() a second
time purely to read searchResult for its input-sync effect. Since the hook is
not a useBetween singleton, that registered a duplicate NavigatorSearchEvent
listener AND fired a duplicate NavigatorSearchComposer on every search.
NavigatorView now owns the single useNavigatorSearch() call and passes
searchResult to NavigatorSearchView via prop.
Test maintenance: useNavigatorSearch.test.tsx was written for the original
useNitroQuery implementation, which upstream reverted (05d71dd1) to
useMessageEvent + useState. Removed the dead QueryClient scaffolding, fixed
case 1 (assert no fetch starts with empty tab), dropped case 7 (the query
invalidator no longer exists). 6 cases, all green.
Full suite 471/471. Typecheck: only the environmental renderer-mismatch
errors (soundboard / rare-values / floorplan APIs absent from the linked
renderer), none in navigator files.
26 lines
964 B
TypeScript
26 lines
964 B
TypeScript
import { FC } from 'react';
|
|
|
|
interface NavigatorSearchSkeletonViewProps
|
|
{
|
|
rows?: number;
|
|
}
|
|
|
|
export const NavigatorSearchSkeletonView: FC<NavigatorSearchSkeletonViewProps> = props =>
|
|
{
|
|
const { rows = 5 } = props;
|
|
|
|
return (
|
|
<div className="flex flex-col gap-2" aria-hidden="true">
|
|
{ Array.from({ length: rows }).map((_, index) =>
|
|
<div key={ index } className="nitro-card-panel flex items-center gap-2 px-2 py-2">
|
|
<div className="h-10 w-10 shrink-0 rounded bg-black/10 animate-pulse" />
|
|
<div className="flex flex-1 flex-col gap-1">
|
|
<div className="h-3 w-1/2 rounded bg-black/10 animate-pulse" />
|
|
<div className="h-2.5 w-1/3 rounded bg-black/10 animate-pulse" />
|
|
</div>
|
|
<div className="h-4 w-8 shrink-0 rounded bg-black/10 animate-pulse" />
|
|
</div>) }
|
|
</div>
|
|
);
|
|
};
|