mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00: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,6 @@
|
||||
import {
|
||||
DarkLoadingIcon,
|
||||
LightLoadingIcon,
|
||||
} from '@blocksuite/affine/components/icons';
|
||||
import { getLoadingIconWith } from '@blocksuite/affine/components/icons';
|
||||
import { WithDisposable } from '@blocksuite/affine/global/lit';
|
||||
import { ColorScheme } from '@blocksuite/affine/model';
|
||||
import type { ColorScheme } from '@blocksuite/affine/model';
|
||||
import { unsafeCSSVar } from '@blocksuite/affine/shared/theme';
|
||||
import { baseTheme } from '@toeverything/theme';
|
||||
import {
|
||||
@@ -91,6 +88,7 @@ export class GeneratingPlaceholder extends WithDisposable(LitElement) {
|
||||
|
||||
protected override render() {
|
||||
const loadingText = this.stages[this.loadingProgress - 1] || '';
|
||||
const loadingIcon = getLoadingIconWith(this.theme);
|
||||
|
||||
return html`<style>
|
||||
.generating-body {
|
||||
@@ -101,11 +99,7 @@ export class GeneratingPlaceholder extends WithDisposable(LitElement) {
|
||||
? html`<div class="generating-header">Answer</div>`
|
||||
: nothing}
|
||||
<div class="generating-body">
|
||||
<div class="generating-icon">
|
||||
${this.theme === ColorScheme.Light
|
||||
? DarkLoadingIcon
|
||||
: LightLoadingIcon}
|
||||
</div>
|
||||
<div class="generating-icon">${loadingIcon}</div>
|
||||
<div class="loading-progress">
|
||||
<div class="loading-text">${loadingText}</div>
|
||||
<div class="loading-stage">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"de": 98,
|
||||
"el-GR": 98,
|
||||
"en": 100,
|
||||
"es-AR": 99,
|
||||
"es-AR": 98,
|
||||
"es-CL": 100,
|
||||
"es": 98,
|
||||
"fa": 98,
|
||||
|
||||
Reference in New Issue
Block a user