forked from lobehub/lobe-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b1e8b82
commit 776c407
Showing
63 changed files
with
661 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
import { useResponsive } from 'antd-style'; | ||
import { memo } from 'react'; | ||
|
||
import Desktop from './Desktop'; | ||
import Mobile from './Mobile'; | ||
import PC from './PC'; | ||
|
||
const Header = memo(() => { | ||
const { mobile } = useResponsive(); | ||
const Render = mobile ? Mobile : Desktop; | ||
|
||
if (mobile) return <Mobile />; | ||
|
||
return <PC />; | ||
return <Render />; | ||
}); | ||
|
||
export default Header; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { DraggablePanelBody } from '@lobehub/ui'; | ||
import { createStyles } from 'antd-style'; | ||
import { ReactNode, memo } from 'react'; | ||
|
||
import FolderPanel from '@/features/FolderPanel'; | ||
|
||
import Header from './Header'; | ||
|
||
const useStyles = createStyles(({ stylish }) => stylish.noScrollbar); | ||
|
||
const Sessions = memo<{ children: ReactNode }>(({ children }) => { | ||
const { styles } = useStyles(); | ||
|
||
return ( | ||
<FolderPanel> | ||
<Header /> | ||
<DraggablePanelBody className={styles} style={{ padding: 0 }}> | ||
{children} | ||
</DraggablePanelBody> | ||
</FolderPanel> | ||
); | ||
}); | ||
|
||
export default Sessions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { ActionIcon, Logo, MobileNavBar } from '@lobehub/ui'; | ||
import { createStyles } from 'antd-style'; | ||
import { MessageSquarePlus, Settings2 } from 'lucide-react'; | ||
import Router from 'next/router'; | ||
import { memo } from 'react'; | ||
|
||
import AvatarWithUpload from '@/features/AvatarWithUpload'; | ||
import { useSessionStore } from '@/store/session'; | ||
|
||
export const useStyles = createStyles(({ css, token }) => ({ | ||
logo: css` | ||
fill: ${token.colorText}; | ||
`, | ||
top: css` | ||
position: sticky; | ||
top: 0; | ||
`, | ||
})); | ||
|
||
const Header = memo(() => { | ||
const [createSession] = useSessionStore((s) => [s.createSession]); | ||
|
||
return ( | ||
<MobileNavBar | ||
center={<Logo type={'text'} />} | ||
left={<AvatarWithUpload size={28} style={{ marginLeft: 8 }} />} | ||
right={ | ||
<> | ||
<ActionIcon icon={MessageSquarePlus} onClick={createSession} /> | ||
<ActionIcon | ||
icon={Settings2} | ||
onClick={() => { | ||
Router.push({ pathname: `/settings` }); | ||
}} | ||
/> | ||
</> | ||
} | ||
/> | ||
); | ||
}); | ||
|
||
export default Header; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { useResponsive } from 'antd-style'; | ||
import { memo } from 'react'; | ||
|
||
import Desktop from './Desktop'; | ||
import Mobile from './Mobile'; | ||
|
||
const Header = memo(() => { | ||
const { mobile } = useResponsive(); | ||
const Render = mobile ? Mobile : Desktop; | ||
|
||
return <Render />; | ||
}); | ||
|
||
export default Header; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { SearchBar } from '@lobehub/ui'; | ||
import { ReactNode, memo } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { useSessionStore } from '@/store/session'; | ||
|
||
const Sessions = memo<{ children: ReactNode }>(({ children }) => { | ||
const { t } = useTranslation('common'); | ||
const [keywords] = useSessionStore((s) => [s.searchKeywords, s.createSession]); | ||
return ( | ||
<> | ||
<div style={{ padding: '8px 16px' }}> | ||
<SearchBar | ||
allowClear | ||
onChange={(e) => useSessionStore.setState({ searchKeywords: e.target.value })} | ||
placeholder={t('searchAgentPlaceholder')} | ||
type={'block'} | ||
value={keywords} | ||
/> | ||
</div> | ||
{children} | ||
</> | ||
); | ||
}); | ||
|
||
export default Sessions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.