@lobehub/chat 0.42.0 → 0.42.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.42.1](https://github.com/lobehub/lobe-chat/compare/v0.42.0...v0.42.1)
6
+
7
+ <sup>Released on **2023-08-12**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: 优化 App 首页 Loading 态.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: 优化 App 首页 Loading 态 ([72104e8](https://github.com/lobehub/lobe-chat/commit/72104e8))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ## [Version 0.42.0](https://github.com/lobehub/lobe-chat/compare/v0.41.2...v0.42.0)
6
31
 
7
32
  <sup>Released on **2023-08-11**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.42.0",
3
+ "version": "0.42.1",
4
4
  "description": "Lobe Chat is an open-source chatbot client using LangChain, Typescript and Next.js",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -0,0 +1,35 @@
1
+ import { GridBackground, Icon } from '@lobehub/ui';
2
+ import { useTheme } from 'antd-style';
3
+ import { Loader2 } from 'lucide-react';
4
+ import { rgba } from 'polished';
5
+ import { memo } from 'react';
6
+ import { useTranslation } from 'react-i18next';
7
+ import { Center, Flexbox } from 'react-layout-kit';
8
+
9
+ const Loading = memo(() => {
10
+ const { t } = useTranslation('common');
11
+
12
+ const theme = useTheme();
13
+
14
+ return (
15
+ <Flexbox height={'100vh'} width={'100%'}>
16
+ <GridBackground
17
+ animation
18
+ colorBack={rgba(theme.colorText, 0.12)}
19
+ colorFront={rgba(theme.colorText, 0.4)}
20
+ flip
21
+ />
22
+ <Center flex={1} gap={12} width={'100%'}>
23
+ <Icon icon={Loader2} size={{ fontSize: 64 }} spin />
24
+ {t('appInitializing')}
25
+ </Center>
26
+ <GridBackground
27
+ animation
28
+ colorBack={rgba(theme.colorText, 0.12)}
29
+ colorFront={rgba(theme.colorText, 0.4)}
30
+ />
31
+ </Flexbox>
32
+ );
33
+ });
34
+
35
+ export default Loading;
@@ -1,33 +1,18 @@
1
- import { Icon } from '@lobehub/ui';
2
- import { useWhyDidYouUpdate } from 'ahooks';
3
- import { Loader2 } from 'lucide-react';
4
1
  import { memo } from 'react';
5
- import { useTranslation } from 'react-i18next';
6
- import { Center } from 'react-layout-kit';
7
2
 
8
3
  import { sessionSelectors, useSessionHydrated, useSessionStore } from '@/store/session';
9
4
 
10
5
  import Chat from './chat/index.page';
6
+ import Loading from './index/Loading';
11
7
  import Welcome from './welcome/index.page';
12
8
 
13
- const Loading = memo(() => {
14
- const { t } = useTranslation('common');
15
-
16
- return (
17
- <Center gap={12} height={'100vh'} width={'100%'}>
18
- <Icon icon={Loader2} size={{ fontSize: 64 }} spin />
19
- {t('appInitializing')}
20
- </Center>
21
- );
22
- });
23
-
24
- export default memo(() => {
9
+ const Home = memo(() => {
25
10
  const hydrated = useSessionHydrated();
26
11
  const hasSession = useSessionStore(sessionSelectors.hasSessionList);
27
12
 
28
- useWhyDidYouUpdate('index.page', { hasSession, hydrated });
29
-
30
13
  if (!hydrated) return <Loading />;
31
14
 
32
15
  return !hasSession ? <Welcome /> : <Chat />;
33
16
  });
17
+
18
+ export default Home;