mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-22 17:06:39 -06:00
Don't lazy load on iOS and don't use skeleton (#10096)
* Don't lazy load on iOS and don't use skeleton * Cleanup banner * All safari
This commit is contained in:
parent
21defbea9d
commit
d94710171d
@ -39,7 +39,7 @@ export default function NewReviewData({
|
||||
|
||||
return (
|
||||
<div className={className}>
|
||||
<div className="flex justify-center items-center mr-[100px]">
|
||||
<div className="flex justify-center items-center md:mr-[100px]">
|
||||
<Button
|
||||
className={`${
|
||||
hasUpdate
|
||||
|
@ -138,9 +138,7 @@ export default function PreviewThumbnailPlayer({
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{!imgLoaded && (
|
||||
<Skeleton className={`absolute inset-0 w-full h-full`} />
|
||||
)}
|
||||
<PreviewPlaceholder imgLoaded={imgLoaded} />
|
||||
<div className={`${imgLoaded ? "visible" : "invisible"}`}>
|
||||
<img
|
||||
ref={imgRef}
|
||||
@ -151,7 +149,7 @@ export default function PreviewThumbnailPlayer({
|
||||
"/media/frigate/",
|
||||
""
|
||||
)}`}
|
||||
loading="lazy"
|
||||
loading={isSafari ? "eager" : "lazy"}
|
||||
onLoad={() => {
|
||||
onImgLoad();
|
||||
}}
|
||||
@ -439,3 +437,15 @@ function PreviewContextItems({
|
||||
</ContextMenuContent>
|
||||
);
|
||||
}
|
||||
|
||||
function PreviewPlaceholder({ imgLoaded }: { imgLoaded: boolean }) {
|
||||
if (imgLoaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
return isSafari ? (
|
||||
<div className={`absolute inset-0 bg-gray-300`} />
|
||||
) : (
|
||||
<Skeleton className={`absolute inset-0`} />
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user