mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
add spinner for color loading fallback
This commit is contained in:
@@ -17,6 +17,7 @@ import { LibraryHeaderBar } from '/@/renderer/features/shared/components/library
|
|||||||
import { PageErrorBoundary } from '/@/renderer/features/shared/components/page-error-boundary';
|
import { PageErrorBoundary } from '/@/renderer/features/shared/components/page-error-boundary';
|
||||||
import { useFastAverageColor } from '/@/renderer/hooks';
|
import { useFastAverageColor } from '/@/renderer/hooks';
|
||||||
import { useAlbumBackground, useCurrentServer } from '/@/renderer/store';
|
import { useAlbumBackground, useCurrentServer } from '/@/renderer/store';
|
||||||
|
import { Spinner } from '/@/shared/components/spinner/spinner';
|
||||||
import { LibraryItem } from '/@/shared/types/domain-types';
|
import { LibraryItem } from '/@/shared/types/domain-types';
|
||||||
|
|
||||||
const AlbumDetailRoute = () => {
|
const AlbumDetailRoute = () => {
|
||||||
@@ -44,7 +45,7 @@ const AlbumDetailRoute = () => {
|
|||||||
const { background: backgroundColor, isLoading: isColorLoading } = useFastAverageColor({
|
const { background: backgroundColor, isLoading: isColorLoading } = useFastAverageColor({
|
||||||
id: albumId,
|
id: albumId,
|
||||||
src: imageUrl,
|
src: imageUrl,
|
||||||
srcLoaded: !detailQuery.isLoading,
|
srcLoaded: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const background = backgroundColor;
|
const background = backgroundColor;
|
||||||
@@ -52,7 +53,7 @@ const AlbumDetailRoute = () => {
|
|||||||
const showBlurredImage = albumBackground;
|
const showBlurredImage = albumBackground;
|
||||||
|
|
||||||
if (isColorLoading) {
|
if (isColorLoading) {
|
||||||
return null;
|
return <Spinner container />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user