等待推荐页运行态全部资源
推荐页 ready 持续观察运行态图片、背景、音视频和资源 pending 标记 资源换签与玩法图集解析中通过隐藏标记阻止遮罩提前消失 补齐拼图、跳一跳、抓大鹅和敲木鱼运行态资源等待接入 补充推荐页资源等待回归测试和团队文档
This commit is contained in:
29
src/components/common/RuntimeResourcePendingMarker.tsx
Normal file
29
src/components/common/RuntimeResourcePendingMarker.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
type RuntimeResourcePendingMarkerProps = {
|
||||
source?: string | null;
|
||||
isPending?: boolean;
|
||||
kind?: string;
|
||||
};
|
||||
|
||||
export const RUNTIME_RESOURCE_PENDING_SELECTOR =
|
||||
'[data-runtime-resource-pending="true"]';
|
||||
|
||||
export function RuntimeResourcePendingMarker({
|
||||
source,
|
||||
isPending = true,
|
||||
kind,
|
||||
}: RuntimeResourcePendingMarkerProps) {
|
||||
const normalizedSource = source?.trim() ?? '';
|
||||
if (!isPending || !normalizedSource) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<span
|
||||
hidden
|
||||
aria-hidden="true"
|
||||
data-runtime-resource-pending="true"
|
||||
data-runtime-resource-src={normalizedSource}
|
||||
data-runtime-resource-kind={kind}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user