ui: 骨架屏替代全部页面级加载 spinner
- 新增 Skeleton 组件库:Skeleton、SkeletonCircle 基础元素 + 5 个业务骨架 (SwipeDeck、ProfileCard、RecordItem、BlindboxRoom、BlindboxList、RoomCard) - 替换 room、profile、blindbox 列表、blindbox 房间、invite 5 个页面的加载态 - 替换 profile 历史记录 / 收藏列表的内联加载 spinner - 更新 project-conventions.mdc:新增 Loading States 规范, 要求页面级和列表级加载必须使用骨架屏
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
Coffee,
|
||||
} from "lucide-react";
|
||||
import { getUserId } from "@/lib/userId";
|
||||
import { Skeleton, SkeletonCircle } from "@/components/Skeleton";
|
||||
import { getSceneConfig } from "@/lib/sceneConfig";
|
||||
import type { SceneType } from "@/types";
|
||||
|
||||
@@ -61,8 +62,23 @@ export default function InvitePage() {
|
||||
|
||||
if (status === "loading") {
|
||||
return (
|
||||
<div className="flex min-h-dvh flex-col items-center justify-center bg-background">
|
||||
<div className="h-6 w-6 animate-spin rounded-full border-2 border-subtle border-t-accent" />
|
||||
<div className="flex min-h-dvh flex-col items-center justify-center bg-background px-6">
|
||||
<Skeleton className="h-16 w-16 rounded-2xl" />
|
||||
<Skeleton className="mt-5 h-8 w-40" />
|
||||
<Skeleton className="mt-2 h-4 w-24" />
|
||||
<div className="mt-8 w-full max-w-xs rounded-2xl bg-surface px-6 py-5 ring-1 ring-border">
|
||||
<div className="flex flex-col items-center gap-3">
|
||||
<Skeleton className="h-5 w-44" />
|
||||
<Skeleton className="h-7 w-24 rounded-full" />
|
||||
<Skeleton className="h-4 w-32" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-6 flex gap-3">
|
||||
<SkeletonCircle className="h-10 w-10" />
|
||||
<SkeletonCircle className="h-10 w-10" />
|
||||
<SkeletonCircle className="h-10 w-10" />
|
||||
</div>
|
||||
<Skeleton className="mt-8 h-12 w-full max-w-xs rounded-xl" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user