@lobehub/chat 0.152.0 → 0.152.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 +25 -0
- package/package.json +1 -1
- package/src/app/(main)/market/{_layout/Desktop/AgentDetail.tsx → @detail/_layout/Desktop.tsx} +16 -11
- package/src/app/(main)/market/{(mobile)/features/AgentDetail.tsx → @detail/_layout/Mobile.tsx} +8 -6
- package/src/app/(main)/market/@detail/default.tsx +21 -0
- package/src/app/(main)/market/{features/AgentDetailContent/AgentInfo → @detail/features/AgentDetailContent}/Header.tsx +30 -21
- package/src/app/(main)/market/{features/AgentDetailContent/AgentInfo → @detail/features/AgentDetailContent}/index.tsx +10 -4
- package/src/app/(main)/market/{features/AgentDetailContent/AgentInfo → @detail/features/AgentDetailContent}/style.ts +7 -11
- package/src/app/(main)/market/_layout/Desktop/Header.tsx +3 -6
- package/src/app/(main)/market/_layout/Desktop/Hero.tsx +39 -0
- package/src/app/(main)/market/_layout/Desktop/index.tsx +23 -44
- package/src/app/(main)/market/_layout/Mobile/Header.tsx +2 -2
- package/src/app/(main)/market/_layout/Mobile/index.tsx +15 -9
- package/src/app/(main)/market/_layout/type.ts +6 -0
- package/src/app/(main)/market/features/AgentCard/AgentCardBanner.tsx +10 -9
- package/src/app/(main)/market/features/AgentCard/index.tsx +133 -58
- package/src/app/(main)/market/features/AgentList.tsx +94 -0
- package/src/app/(main)/market/features/AgentSearchBar.tsx +42 -0
- package/src/app/(main)/market/features/ShareAgentButton/Inner.tsx +9 -7
- package/src/app/(main)/market/features/ShareAgentButton/index.tsx +22 -15
- package/src/app/(main)/market/features/TagList.tsx +65 -0
- package/src/app/(main)/market/layout.tsx +11 -0
- package/src/app/(main)/market/loading.tsx +2 -2
- package/src/app/(main)/market/page.tsx +22 -12
- package/src/features/ChatInput/STT/browser.tsx +1 -1
- package/src/features/ChatInput/STT/openai.tsx +1 -1
- package/src/features/Conversation/components/InboxWelcome/AgentsSuggest.tsx +2 -2
- package/src/locales/resources.ts +1 -0
- package/src/server/translation.ts +20 -0
- package/src/services/__tests__/chat.test.ts +1 -1
- package/src/store/market/action.ts +1 -1
- package/src/store/session/slices/session/action.ts +1 -1
- package/src/utils/difference.ts +2 -1
- package/src/app/(main)/market/(desktop)/index.tsx +0 -20
- package/src/app/(main)/market/(mobile)/features/AgentCard.tsx +0 -31
- package/src/app/(main)/market/(mobile)/index.tsx +0 -25
- package/src/app/(main)/market/components/Loading.tsx +0 -13
- package/src/app/(main)/market/features/AgentCard/AgentCardItem.tsx +0 -54
- package/src/app/(main)/market/features/AgentCard/style.ts +0 -33
- package/src/app/(main)/market/features/AgentDetailContent/index.tsx +0 -12
- package/src/app/(main)/market/features/AgentSearchBar/index.tsx +0 -40
- package/src/app/(main)/market/features/PageTitle/index.tsx +0 -13
- package/src/app/(main)/market/features/TagList/Inner.tsx +0 -28
- package/src/app/(main)/market/features/TagList/index.tsx +0 -23
- package/src/app/(main)/market/layout.ts +0 -8
- /package/src/app/(main)/market/{features/AgentDetailContent/AgentInfo → @detail/features/AgentDetailContent}/Comment.tsx +0 -0
- /package/src/app/(main)/market/{features/AgentDetailContent/AgentInfo → @detail/features/AgentDetailContent}/Loading.tsx +0 -0
- /package/src/app/(main)/market/{features/AgentDetailContent/AgentInfo → @detail/features/AgentDetailContent}/TokenTag.tsx +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.152.1](https://github.com/lobehub/lobe-chat/compare/v0.152.0...v0.152.1)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-05-01**</sup>
|
|
8
|
+
|
|
9
|
+
#### ♻ Code Refactoring
|
|
10
|
+
|
|
11
|
+
- **misc**: Refactor Market Layout.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### Code refactoring
|
|
19
|
+
|
|
20
|
+
- **misc**: Refactor Market Layout, closes [#2320](https://github.com/lobehub/lobe-chat/issues/2320) ([c05c3c1](https://github.com/lobehub/lobe-chat/commit/c05c3c1))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
## [Version 0.152.0](https://github.com/lobehub/lobe-chat/compare/v0.151.11...v0.152.0)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2024-04-30**</sup>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.152.
|
|
3
|
+
"version": "0.152.1",
|
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"framework",
|
package/src/app/(main)/market/{_layout/Desktop/AgentDetail.tsx → @detail/_layout/Desktop.tsx}
RENAMED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { DraggablePanel, DraggablePanelBody, DraggablePanelContainer } from '@lobehub/ui';
|
|
2
|
-
import { createStyles } from 'antd-style';
|
|
3
|
-
import { memo, useCallback, useState } from 'react';
|
|
4
|
+
import { createStyles, useResponsive } from 'antd-style';
|
|
5
|
+
import { PropsWithChildren, memo, useCallback, useState } from 'react';
|
|
6
|
+
import { Flexbox } from 'react-layout-kit';
|
|
4
7
|
|
|
5
8
|
import SafeSpacing from '@/components/SafeSpacing';
|
|
6
9
|
import { MARKET_SIDEBAR_WIDTH } from '@/const/layoutTokens';
|
|
7
10
|
import { agentMarketSelectors, useMarketStore } from '@/store/market';
|
|
8
11
|
|
|
9
|
-
import AgentDetailContent from '../../features/AgentDetailContent';
|
|
10
|
-
|
|
11
12
|
const useStyles = createStyles(({ css, token, stylish }) => ({
|
|
12
13
|
content: css`
|
|
13
14
|
display: flex;
|
|
@@ -15,7 +16,7 @@ const useStyles = createStyles(({ css, token, stylish }) => ({
|
|
|
15
16
|
height: 100% !important;
|
|
16
17
|
`,
|
|
17
18
|
drawer: css`
|
|
18
|
-
background: ${token.
|
|
19
|
+
background: ${token.colorBgContainer};
|
|
19
20
|
`,
|
|
20
21
|
header: css`
|
|
21
22
|
border-bottom: 1px solid ${token.colorBorder};
|
|
@@ -23,8 +24,9 @@ const useStyles = createStyles(({ css, token, stylish }) => ({
|
|
|
23
24
|
noScrollbar: stylish.noScrollbar,
|
|
24
25
|
}));
|
|
25
26
|
|
|
26
|
-
const SideBar = memo(() => {
|
|
27
|
+
const SideBar = memo<PropsWithChildren>(({ children }) => {
|
|
27
28
|
const { styles } = useStyles();
|
|
29
|
+
const { md = true } = useResponsive();
|
|
28
30
|
const [tempId, setTempId] = useState<string>('');
|
|
29
31
|
const [showAgentSidebar, deactivateAgent, activateAgent] = useMarketStore((s) => [
|
|
30
32
|
agentMarketSelectors.showSideBar(s),
|
|
@@ -44,6 +46,8 @@ const SideBar = memo(() => {
|
|
|
44
46
|
[deactivateAgent, activateAgent, tempId],
|
|
45
47
|
);
|
|
46
48
|
|
|
49
|
+
const minWidth = md ? MARKET_SIDEBAR_WIDTH : 350;
|
|
50
|
+
|
|
47
51
|
return (
|
|
48
52
|
<DraggablePanel
|
|
49
53
|
className={styles.drawer}
|
|
@@ -51,8 +55,9 @@ const SideBar = memo(() => {
|
|
|
51
55
|
content: styles.content,
|
|
52
56
|
}}
|
|
53
57
|
expand={showAgentSidebar}
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
maxWidth={'80vw' as any}
|
|
59
|
+
minWidth={minWidth}
|
|
60
|
+
mode={md ? 'fixed' : 'float'}
|
|
56
61
|
onExpandChange={handleExpandChange}
|
|
57
62
|
placement={'right'}
|
|
58
63
|
showHandlerWideArea={false}
|
|
@@ -61,15 +66,15 @@ const SideBar = memo(() => {
|
|
|
61
66
|
style={{
|
|
62
67
|
flex: 'none',
|
|
63
68
|
height: '100%',
|
|
64
|
-
minWidth:
|
|
69
|
+
minWidth: minWidth,
|
|
65
70
|
}}
|
|
66
71
|
>
|
|
67
|
-
<SafeSpacing />
|
|
72
|
+
{md && <SafeSpacing />}
|
|
68
73
|
<DraggablePanelBody
|
|
69
74
|
className={styles.noScrollbar}
|
|
70
75
|
style={{ padding: 0, position: 'relative' }}
|
|
71
76
|
>
|
|
72
|
-
<
|
|
77
|
+
<Flexbox>{children}</Flexbox>
|
|
73
78
|
</DraggablePanelBody>
|
|
74
79
|
</DraggablePanelContainer>
|
|
75
80
|
</DraggablePanel>
|
package/src/app/(main)/market/{(mobile)/features/AgentDetail.tsx → @detail/_layout/Mobile.tsx}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Modal } from '@lobehub/ui';
|
|
2
|
-
import { memo } from 'react';
|
|
4
|
+
import { PropsWithChildren, memo } from 'react';
|
|
3
5
|
import { useTranslation } from 'react-i18next';
|
|
4
6
|
|
|
5
7
|
import { agentMarketSelectors, useMarketStore } from '@/store/market';
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const AgentDetail = memo(() => {
|
|
9
|
+
const AgentDetail = memo<PropsWithChildren>(({ children }) => {
|
|
10
10
|
const [showAgentSidebar, deactivateAgent] = useMarketStore((s) => [
|
|
11
11
|
agentMarketSelectors.showSideBar(s),
|
|
12
12
|
s.deactivateAgent,
|
|
@@ -17,12 +17,14 @@ const AgentDetail = memo(() => {
|
|
|
17
17
|
return (
|
|
18
18
|
<Modal
|
|
19
19
|
allowFullscreen
|
|
20
|
-
onCancel={
|
|
20
|
+
onCancel={() => {
|
|
21
|
+
deactivateAgent();
|
|
22
|
+
}}
|
|
21
23
|
open={showAgentSidebar}
|
|
22
24
|
styles={{ body: { padding: 0 } }}
|
|
23
25
|
title={t('sidebar.title')}
|
|
24
26
|
>
|
|
25
|
-
|
|
27
|
+
{children}
|
|
26
28
|
</Modal>
|
|
27
29
|
);
|
|
28
30
|
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import ServerLayout from '@/components/server/ServerLayout';
|
|
2
|
+
import { isMobileDevice } from '@/utils/responsive';
|
|
3
|
+
|
|
4
|
+
import Desktop from './_layout/Desktop';
|
|
5
|
+
import Mobile from './_layout/Mobile';
|
|
6
|
+
import AgentDetailContent from './features/AgentDetailContent';
|
|
7
|
+
|
|
8
|
+
const Layout = ServerLayout({ Desktop, Mobile });
|
|
9
|
+
|
|
10
|
+
const Detail = () => {
|
|
11
|
+
const mobile = isMobileDevice();
|
|
12
|
+
return (
|
|
13
|
+
<Layout>
|
|
14
|
+
<AgentDetailContent mobile={mobile} />
|
|
15
|
+
</Layout>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
Detail.displayName = 'AgentDetail';
|
|
20
|
+
|
|
21
|
+
export default Detail;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Avatar, Tag } from '@lobehub/ui';
|
|
2
2
|
import { App, Button, Typography } from 'antd';
|
|
3
|
+
import isEqual from 'fast-deep-equal';
|
|
3
4
|
import { startCase } from 'lodash-es';
|
|
4
5
|
import { useRouter } from 'next/navigation';
|
|
5
6
|
import { memo } from 'react';
|
|
6
7
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { Center } from 'react-layout-kit';
|
|
8
|
+
import { Center, Flexbox } from 'react-layout-kit';
|
|
8
9
|
|
|
9
10
|
import { SESSION_CHAT_URL } from '@/const/url';
|
|
10
11
|
import { useIsMobile } from '@/hooks/useIsMobile';
|
|
@@ -15,12 +16,14 @@ import { useStyles } from './style';
|
|
|
15
16
|
|
|
16
17
|
const { Link } = Typography;
|
|
17
18
|
|
|
18
|
-
const Header = memo(() => {
|
|
19
|
+
const Header = memo<{ mobile?: boolean }>(({ mobile }) => {
|
|
20
|
+
const setSearchKeywords = useMarketStore((s) => s.setSearchKeywords);
|
|
19
21
|
const router = useRouter();
|
|
20
22
|
const { t } = useTranslation('market');
|
|
21
23
|
const { styles, theme } = useStyles();
|
|
22
24
|
const createSession = useSessionStore((s) => s.createSession);
|
|
23
|
-
const agentItem = useMarketStore(agentMarketSelectors.currentAgentItem);
|
|
25
|
+
const agentItem = useMarketStore(agentMarketSelectors.currentAgentItem, isEqual);
|
|
26
|
+
|
|
24
27
|
const { message } = App.useApp();
|
|
25
28
|
|
|
26
29
|
const { meta, createAt, author, homepage, config } = agentItem;
|
|
@@ -38,43 +41,49 @@ const Header = memo(() => {
|
|
|
38
41
|
|
|
39
42
|
const handleAddAgent = () => {
|
|
40
43
|
if (!agentItem) return;
|
|
41
|
-
|
|
42
44
|
createSession({ config, meta }, false);
|
|
43
45
|
message.success(t('addAgentSuccess'));
|
|
44
46
|
};
|
|
45
47
|
|
|
46
48
|
return (
|
|
47
49
|
<Center className={styles.container} gap={16}>
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
<Center
|
|
51
|
+
flex={'none'}
|
|
52
|
+
height={120}
|
|
53
|
+
style={{
|
|
54
|
+
backgroundColor:
|
|
55
|
+
backgroundColor || mobile ? theme.colorBgElevated : theme.colorBgContainer,
|
|
56
|
+
borderRadius: '50%',
|
|
57
|
+
overflow: 'hidden',
|
|
58
|
+
zIndex: 2,
|
|
59
|
+
}}
|
|
60
|
+
width={120}
|
|
61
|
+
>
|
|
62
|
+
<Avatar animation avatar={avatar} size={100} />
|
|
63
|
+
</Center>
|
|
64
|
+
<h2 className={styles.title}>{title}</h2>
|
|
56
65
|
<Center gap={6} horizontal style={{ flexWrap: 'wrap' }}>
|
|
57
66
|
{(tags as string[]).map((tag: string, index) => (
|
|
58
|
-
<Tag
|
|
59
|
-
key={index}
|
|
60
|
-
onClick={() => useMarketStore.setState({ searchKeywords: tag })}
|
|
61
|
-
style={{ margin: 0 }}
|
|
62
|
-
>
|
|
67
|
+
<Tag key={index} onClick={() => setSearchKeywords(tag)} style={{ margin: 0 }}>
|
|
63
68
|
{startCase(tag).trim()}
|
|
64
69
|
</Tag>
|
|
65
70
|
))}
|
|
66
71
|
</Center>
|
|
67
72
|
<div className={styles.desc}>{description}</div>
|
|
68
|
-
<Link aria-label={author} className={styles.author} href={homepage} target={'_blank'}>
|
|
69
|
-
@{author}
|
|
70
|
-
</Link>
|
|
71
73
|
<Button block onClick={handleAddAgentAndConverse} type={'primary'}>
|
|
72
74
|
{t('addAgentAndConverse')}
|
|
73
75
|
</Button>
|
|
74
76
|
<Button block onClick={handleAddAgent}>
|
|
75
77
|
{t('addAgent')}
|
|
76
78
|
</Button>
|
|
77
|
-
<
|
|
79
|
+
<Flexbox align={'center'} gap={12} horizontal>
|
|
80
|
+
<Link aria-label={author} className={styles.author} href={homepage} target={'_blank'}>
|
|
81
|
+
@{author}
|
|
82
|
+
</Link>
|
|
83
|
+
<time className={styles.time} dateTime={new Date(createAt).toISOString()}>
|
|
84
|
+
{createAt}
|
|
85
|
+
</time>
|
|
86
|
+
</Flexbox>
|
|
78
87
|
</Center>
|
|
79
88
|
);
|
|
80
89
|
});
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Markdown, TabsNav } from '@lobehub/ui';
|
|
2
4
|
import { memo, useState } from 'react';
|
|
3
5
|
import { useTranslation } from 'react-i18next';
|
|
4
6
|
import { Flexbox } from 'react-layout-kit';
|
|
5
7
|
|
|
8
|
+
import AgentCardBanner from '@/app/(main)/market/features/AgentCard/AgentCardBanner';
|
|
6
9
|
import { useMarketStore } from '@/store/market';
|
|
7
10
|
|
|
8
|
-
import AgentCardBanner from '../../../features/AgentCard/AgentCardBanner';
|
|
9
11
|
import Comment from './Comment';
|
|
10
12
|
import Header from './Header';
|
|
11
13
|
import Loading from './Loading';
|
|
@@ -17,7 +19,7 @@ enum InfoTabs {
|
|
|
17
19
|
prompt = 'prompt',
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
const AgentModalInner = memo(() => {
|
|
22
|
+
const AgentModalInner = memo<{ mobile?: boolean }>(({ mobile }) => {
|
|
21
23
|
const [useFetchAgent, currentIdentifier] = useMarketStore((s) => [
|
|
22
24
|
s.useFetchAgent,
|
|
23
25
|
s.currentIdentifier,
|
|
@@ -34,8 +36,12 @@ const AgentModalInner = memo(() => {
|
|
|
34
36
|
|
|
35
37
|
return (
|
|
36
38
|
<>
|
|
37
|
-
<AgentCardBanner
|
|
38
|
-
|
|
39
|
+
<AgentCardBanner
|
|
40
|
+
avatar={meta?.avatar}
|
|
41
|
+
size={800}
|
|
42
|
+
style={{ height: 120, marginBottom: -60 }}
|
|
43
|
+
/>
|
|
44
|
+
<Header mobile={mobile} />
|
|
39
45
|
<Flexbox align={'center'}>
|
|
40
46
|
<TabsNav
|
|
41
47
|
activeKey={tab}
|
|
@@ -4,21 +4,13 @@ export const useStyles = createStyles(({ css, token, prefixCls }) => ({
|
|
|
4
4
|
author: css`
|
|
5
5
|
font-size: 12px;
|
|
6
6
|
`,
|
|
7
|
-
|
|
8
|
-
avatar: css`
|
|
9
|
-
flex: none;
|
|
10
|
-
`,
|
|
11
7
|
container: css`
|
|
12
8
|
position: relative;
|
|
13
9
|
padding: 16px 16px 24px;
|
|
14
10
|
border-bottom: 1px solid ${token.colorBorderSecondary};
|
|
15
11
|
`,
|
|
16
|
-
date: css`
|
|
17
|
-
font-size: 12px;
|
|
18
|
-
color: ${token.colorTextDescription};
|
|
19
|
-
`,
|
|
20
12
|
desc: css`
|
|
21
|
-
color: ${token.
|
|
13
|
+
color: ${token.colorTextSecondary};
|
|
22
14
|
text-align: center;
|
|
23
15
|
`,
|
|
24
16
|
loading: css`
|
|
@@ -30,9 +22,13 @@ export const useStyles = createStyles(({ css, token, prefixCls }) => ({
|
|
|
30
22
|
nav: css`
|
|
31
23
|
padding-top: 8px;
|
|
32
24
|
`,
|
|
25
|
+
time: css`
|
|
26
|
+
font-size: 12px;
|
|
27
|
+
color: ${token.colorTextDescription};
|
|
28
|
+
`,
|
|
33
29
|
title: css`
|
|
34
|
-
|
|
35
|
-
font-weight:
|
|
30
|
+
margin-bottom: 0;
|
|
31
|
+
font-weight: bold;
|
|
36
32
|
text-align: center;
|
|
37
33
|
`,
|
|
38
34
|
}));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { ChatHeader, Logo } from '@lobehub/ui';
|
|
2
4
|
import { createStyles } from 'antd-style';
|
|
3
|
-
import Link from 'next/link';
|
|
4
5
|
import { memo } from 'react';
|
|
5
6
|
|
|
6
7
|
import ShareAgentButton from '../../features/ShareAgentButton';
|
|
@@ -17,11 +18,7 @@ const Header = memo(() => {
|
|
|
17
18
|
|
|
18
19
|
return (
|
|
19
20
|
<ChatHeader
|
|
20
|
-
left={
|
|
21
|
-
<Link aria-label={'home'} href={'/'}>
|
|
22
|
-
<Logo className={styles.logo} extra={'Discover'} size={36} type={'text'} />
|
|
23
|
-
</Link>
|
|
24
|
-
}
|
|
21
|
+
left={<Logo className={styles.logo} extra={'Discover'} size={36} type={'text'} />}
|
|
25
22
|
right={<ShareAgentButton />}
|
|
26
23
|
/>
|
|
27
24
|
);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { GridBackground } from '@lobehub/ui';
|
|
4
|
+
import { createStyles } from 'antd-style';
|
|
5
|
+
import { memo } from 'react';
|
|
6
|
+
import { Center } from 'react-layout-kit';
|
|
7
|
+
|
|
8
|
+
const useStyles = createStyles(({ css, responsive }) => ({
|
|
9
|
+
background: css`
|
|
10
|
+
width: 80%;
|
|
11
|
+
margin: -60px 0 -20px;
|
|
12
|
+
|
|
13
|
+
${responsive.md} {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
`,
|
|
17
|
+
title: css`
|
|
18
|
+
z-index: 2;
|
|
19
|
+
|
|
20
|
+
margin-top: 24px;
|
|
21
|
+
|
|
22
|
+
font-size: min(56px, 5vw);
|
|
23
|
+
font-weight: 800;
|
|
24
|
+
line-height: 1.2;
|
|
25
|
+
text-align: center;
|
|
26
|
+
`,
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
const Hero = memo(() => {
|
|
30
|
+
const { theme, styles } = useStyles();
|
|
31
|
+
return (
|
|
32
|
+
<Center>
|
|
33
|
+
<h1 className={styles.title}>Find & Use The Best Agents</h1>
|
|
34
|
+
<GridBackground animation className={styles.background} colorFront={theme.colorText} random />
|
|
35
|
+
</Center>
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export default Hero;
|
|
@@ -1,61 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { GridBackground } from '@lobehub/ui';
|
|
4
|
-
import { createStyles } from 'antd-style';
|
|
5
|
-
import dynamic from 'next/dynamic';
|
|
6
|
-
import { PropsWithChildren, memo } from 'react';
|
|
7
|
-
import { Center, Flexbox } from 'react-layout-kit';
|
|
1
|
+
import { Flexbox } from 'react-layout-kit';
|
|
8
2
|
|
|
9
3
|
import SafeSpacing from '@/components/SafeSpacing';
|
|
10
|
-
import ClientResponsiveLayout from '@/components/client/ClientResponsiveLayout';
|
|
11
4
|
import { MAX_WIDTH } from '@/const/layoutTokens';
|
|
12
5
|
|
|
13
|
-
import
|
|
6
|
+
import { LayoutProps } from '../type';
|
|
14
7
|
import Header from './Header';
|
|
8
|
+
import Hero from './Hero';
|
|
15
9
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const useStyles = createStyles(({ css }) => ({
|
|
19
|
-
background: css`
|
|
20
|
-
width: 80%;
|
|
21
|
-
margin: -60px 0 -20px;
|
|
22
|
-
`,
|
|
23
|
-
title: css`
|
|
24
|
-
z-index: 2;
|
|
25
|
-
margin-top: 24px;
|
|
26
|
-
font-size: 56px;
|
|
27
|
-
font-weight: 800;
|
|
28
|
-
`,
|
|
29
|
-
}));
|
|
30
|
-
|
|
31
|
-
const Desktop = memo<PropsWithChildren>(({ children }) => {
|
|
32
|
-
const { theme, styles } = useStyles();
|
|
33
|
-
|
|
10
|
+
const Layout = ({ children, detail }: LayoutProps) => {
|
|
34
11
|
return (
|
|
35
|
-
<Flexbox
|
|
12
|
+
<Flexbox
|
|
13
|
+
height={'100%'}
|
|
14
|
+
id={'lobe-market-container'}
|
|
15
|
+
style={{ position: 'relative' }}
|
|
16
|
+
width={'100%'}
|
|
17
|
+
>
|
|
36
18
|
<Header />
|
|
37
|
-
<Flexbox
|
|
38
|
-
<Flexbox
|
|
19
|
+
<Flexbox height={'100%'} horizontal style={{ position: 'relative' }} width={'100%'}>
|
|
20
|
+
<Flexbox
|
|
21
|
+
align={'center'}
|
|
22
|
+
flex={1}
|
|
23
|
+
padding={16}
|
|
24
|
+
style={{ overflowX: 'hidden', overflowY: 'scroll', position: 'relative' }}
|
|
25
|
+
>
|
|
39
26
|
<SafeSpacing />
|
|
40
|
-
|
|
41
27
|
<Flexbox gap={16} style={{ maxWidth: MAX_WIDTH, position: 'relative', width: '100%' }}>
|
|
42
|
-
<
|
|
43
|
-
<h1 className={styles.title}>Find & Use The Best Agents</h1>
|
|
44
|
-
<GridBackground
|
|
45
|
-
animation
|
|
46
|
-
className={styles.background}
|
|
47
|
-
colorFront={theme.colorText}
|
|
48
|
-
random
|
|
49
|
-
/>
|
|
50
|
-
</Center>
|
|
51
|
-
<AgentSearchBar />
|
|
28
|
+
<Hero />
|
|
52
29
|
{children}
|
|
53
30
|
</Flexbox>
|
|
54
31
|
</Flexbox>
|
|
55
|
-
|
|
32
|
+
{detail}
|
|
56
33
|
</Flexbox>
|
|
57
34
|
</Flexbox>
|
|
58
35
|
);
|
|
59
|
-
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
Layout.displayName = 'DesktopMarketLayout';
|
|
60
39
|
|
|
61
|
-
export default
|
|
40
|
+
export default Layout;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { MobileNavBar } from '@lobehub/ui';
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
|
|
6
6
|
import { mobileHeaderSticky } from '@/styles/mobileHeader';
|
|
@@ -10,7 +10,7 @@ import ShareAgentButton from '../../features/ShareAgentButton';
|
|
|
10
10
|
const Header = memo(() => {
|
|
11
11
|
return (
|
|
12
12
|
<MobileNavBar
|
|
13
|
-
center={<
|
|
13
|
+
center={<div style={{ fontSize: 20, fontWeight: 900 }}>Discover</div>}
|
|
14
14
|
right={<ShareAgentButton mobile />}
|
|
15
15
|
style={mobileHeaderSticky}
|
|
16
16
|
/>
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
|
|
3
1
|
import MobileContentLayout from '@/components/server/MobileNavLayout';
|
|
4
2
|
|
|
5
|
-
import
|
|
3
|
+
import { LayoutProps } from '../type';
|
|
6
4
|
import Header from './Header';
|
|
7
5
|
|
|
8
|
-
const
|
|
6
|
+
const Layout = ({ children, detail }: LayoutProps) => {
|
|
9
7
|
return (
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
<>
|
|
9
|
+
<MobileContentLayout
|
|
10
|
+
gap={16}
|
|
11
|
+
header={<Header />}
|
|
12
|
+
style={{ paddingInline: 16, paddingTop: 8 }}
|
|
13
|
+
>
|
|
14
|
+
{children}
|
|
15
|
+
</MobileContentLayout>
|
|
16
|
+
{detail}
|
|
17
|
+
</>
|
|
14
18
|
);
|
|
15
19
|
};
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
Layout.displayName = 'MobileMarketLayout';
|
|
22
|
+
|
|
23
|
+
export default Layout;
|
|
@@ -3,8 +3,6 @@ import { createStyles } from 'antd-style';
|
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
import { Flexbox } from 'react-layout-kit';
|
|
5
5
|
|
|
6
|
-
import { MetaData } from '@/types/meta';
|
|
7
|
-
|
|
8
6
|
export const useStyles = createStyles(({ css, token }) => ({
|
|
9
7
|
banner: css`
|
|
10
8
|
position: relative;
|
|
@@ -15,25 +13,22 @@ export const useStyles = createStyles(({ css, token }) => ({
|
|
|
15
13
|
margin-bottom: -56px;
|
|
16
14
|
|
|
17
15
|
background: ${token.colorFillSecondary};
|
|
18
|
-
|
|
19
|
-
mask-image: linear-gradient(to bottom, #fff, transparent);
|
|
20
16
|
`,
|
|
21
17
|
bannerImg: css`
|
|
22
18
|
position: absolute;
|
|
23
|
-
|
|
24
|
-
filter: blur(50px) saturate(2);
|
|
19
|
+
filter: blur(40px) saturate(1.5);
|
|
25
20
|
`,
|
|
26
21
|
}));
|
|
27
22
|
|
|
28
23
|
interface AgentCardBannerProps extends DivProps {
|
|
24
|
+
avatar?: string;
|
|
29
25
|
mask?: boolean;
|
|
30
26
|
maskColor?: string;
|
|
31
|
-
meta: MetaData;
|
|
32
27
|
size?: number;
|
|
33
28
|
}
|
|
34
29
|
|
|
35
30
|
const AgentCardBanner = memo<AgentCardBannerProps>(
|
|
36
|
-
({
|
|
31
|
+
({ avatar, className, size = 600, children, ...props }) => {
|
|
37
32
|
const { styles, cx } = useStyles();
|
|
38
33
|
|
|
39
34
|
return (
|
|
@@ -43,7 +38,13 @@ const AgentCardBanner = memo<AgentCardBannerProps>(
|
|
|
43
38
|
justify={'center'}
|
|
44
39
|
{...props}
|
|
45
40
|
>
|
|
46
|
-
<Avatar
|
|
41
|
+
<Avatar
|
|
42
|
+
alt={'banner'}
|
|
43
|
+
avatar={avatar}
|
|
44
|
+
className={styles.bannerImg}
|
|
45
|
+
shape={'square'}
|
|
46
|
+
size={size}
|
|
47
|
+
/>
|
|
47
48
|
{children}
|
|
48
49
|
</Flexbox>
|
|
49
50
|
);
|