Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: correct BrandTextLoading position after removing SSG CSS-in-JS injection (#11312)

Innei0de4eb803e92
diff --git a/src/components/Loading/BrandTextLoading/index.module.css b/src/components/Loading/BrandTextLoading/index.module.css
new file mode 100644
index 00000000000..3b5751fa028
--- /dev/null
+++ b/src/components/Loading/BrandTextLoading/index.module.css
@@ -0,0 +1,81 @@
+.container {
+ --brand-text-color: var(--colorText, #1f1f1f);
+ --brand-muted-color: var(--colorTextSecondary, #8c8c8c);
+ --brand-border-color: var(--colorBorder, #d9d9d9);
+ --brand-tag-bg: var(--colorFillTertiary, rgba(0, 0, 0, 0.04));
+
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+
+ width: 100%;
+ height: 100vh;
+ height: 100dvh;
+ gap: 12px;
+}
+
+[data-theme='dark'] .container {
+ --brand-text-color: var(--colorText, #f0f0f0);
+ --brand-muted-color: var(--colorTextSecondary, #a6a6a6);
+ --brand-border-color: var(--colorBorder, #424242);
+ --brand-tag-bg: var(--colorFillTertiary, rgba(255, 255, 255, 0.08));
+}
+
+.brand {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+
+ opacity: 0.6;
+ color: var(--brand-text-color);
+}
+
+.brand :global(.lobe-brand-loading) {
+ display: block;
+ color: inherit;
+}
+
+.debug {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 4px;
+
+ padding: 16px;
+}
+
+.debugRow {
+ display: flex;
+ gap: 8px;
+ align-items: center;
+
+ font-size: 12px;
+ color: var(--brand-muted-color);
+}
+
+.debugRow code {
+ font-family:
+ ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
+ monospace;
+}
+
+.debugTag {
+ display: inline-flex;
+ align-items: center;
+
+ padding: 2px 8px;
+ border: 1px solid var(--brand-border-color);
+ border-radius: 6px;
+
+ background: var(--brand-tag-bg);
+}
+
+.debugTag code {
+ color: var(--brand-text-color);
+}
+
+.debugHint {
+ font-size: 12px;
+ color: var(--brand-muted-color);
+}
diff --git a/src/components/Loading/BrandTextLoading/index.tsx b/src/components/Loading/BrandTextLoading/index.tsx
index d8c3256c0e3..53e9bc4e04d 100644
--- a/src/components/Loading/BrandTextLoading/index.tsx
+++ b/src/components/Loading/BrandTextLoading/index.tsx
@@ -1,34 +1,41 @@
-import { Center, Tag, Text } from '@lobehub/ui';
import { BrandLoading, LobeHubText } from '@lobehub/ui/brand';
import { isCustomBranding } from '@/const/version';
import CircleLoading from '../CircleLoading';
+import styles from './index.module.css';
interface BrandTextLoadingProps {
debugId: string;
}
const BrandTextLoading = ({ debugId }: BrandTextLoadingProps) => {
- if (isCustomBranding) return <CircleLoading />;
+ if (isCustomBranding)
+ return (
+ <div className={styles.container}>
+ <CircleLoading />
+ </div>
+ );
+
+ const showDebug = process.env.NODE_ENV === 'development' && debugId;
return (
- <Center height={'100%'} width={'100%'}>
- <BrandLoading size={40} style={{ opacity: 0.6 }} text={LobeHubText} />
- {process.env.NODE_ENV === 'development' && debugId && (
- <Center gap={4} padding={16}>
- <Text code style={{ alignItems: 'center', display: 'flex' }}>
- Debug ID:{' '}
- <Tag size={'large'}>
- <Text code>{debugId}</Text>
- </Tag>
- </Text>
- <Text fontSize={12} type={'secondary'}>
- only visible in development
- </Text>
- </Center>
+ <div className={styles.container}>
+ <div aria-label="Loading" className={styles.brand} role="status">
+ <BrandLoading size={40} text={LobeHubText} />
+ </div>
+ {showDebug && (
+ <div className={styles.debug}>
+ <div className={styles.debugRow}>
+ <code>Debug ID:</code>
+ <span className={styles.debugTag}>
+ <code>{debugId}</code>
+ </span>
+ </div>
+ <div className={styles.debugHint}>only visible in development</div>
+ </div>
)}
- </Center>
+ </div>
);
};