mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-17 14:27:02 +08:00
refactor(editor): get loading icon with theme (#12079)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a unified loading spinner icon that adapts to light or dark themes automatically. - **Refactor** - Streamlined loading icon usage across the app by replacing multiple theme-based icons with a single helper function for consistent and simplified icon management. - **Chores** - Removed an unused dependency to improve package management. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import { getEmbedCardIcons } from '@blocksuite/affine-block-embed';
|
||||
import {
|
||||
CaptionedBlockComponent,
|
||||
SelectedStyle,
|
||||
} from '@blocksuite/affine-components/caption';
|
||||
import { getAttachmentFileIcon } from '@blocksuite/affine-components/icons';
|
||||
import {
|
||||
getAttachmentFileIcon,
|
||||
getLoadingIconWith,
|
||||
} from '@blocksuite/affine-components/icons';
|
||||
import { Peekable } from '@blocksuite/affine-components/peek';
|
||||
import { toast } from '@blocksuite/affine-components/toast';
|
||||
import {
|
||||
@@ -297,7 +299,7 @@ export class AttachmentBlockComponent extends CaptionedBlockComponent<Attachment
|
||||
const cardStyle = style ?? AttachmentBlockStyles[1];
|
||||
|
||||
const theme = this.std.get(ThemeProvider).theme$.value;
|
||||
const { LoadingIcon } = getEmbedCardIcons(theme);
|
||||
const loadingIcon = getLoadingIconWith(theme);
|
||||
|
||||
const blobState = this.blobState$.value;
|
||||
const {
|
||||
@@ -319,7 +321,7 @@ export class AttachmentBlockComponent extends CaptionedBlockComponent<Attachment
|
||||
};
|
||||
|
||||
const icon = loading
|
||||
? LoadingIcon
|
||||
? loadingIcon
|
||||
: error
|
||||
? WarningIcon()
|
||||
: AttachmentIcon();
|
||||
|
||||
Reference in New Issue
Block a user