|
|
@@ -103,7 +103,7 @@ export function useDragSideBar() {
|
|
|
const barWidth = shouldNarrow
|
|
|
? NARROW_SIDEBAR_WIDTH
|
|
|
: limit(config.sidebarWidth ?? DEFAULT_SIDEBAR_WIDTH);
|
|
|
- const sideBarWidth = isMobileScreen ? "100vw" : `${barWidth}px`;
|
|
|
+ const sideBarWidth = isMobileScreen ? "60vw" : `${barWidth}px`;
|
|
|
document.documentElement.style.setProperty("--sidebar-width", sideBarWidth);
|
|
|
}, [config.sidebarWidth, isMobileScreen, shouldNarrow]);
|
|
|
|
|
|
@@ -529,8 +529,20 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
|
|
|
const [drawerType, setDrawerType] = useState<'all' | 'collect'>('all');
|
|
|
|
|
|
+ const closeSidebar = () => {
|
|
|
+ globalStore.setShowMenu(false);
|
|
|
+ };
|
|
|
+
|
|
|
return (
|
|
|
<>
|
|
|
+ {
|
|
|
+ isMobileScreen && globalStore.showMenu && (
|
|
|
+ <div
|
|
|
+ className={styles["sidebar-overlay"]}
|
|
|
+ onClick={closeSidebar}
|
|
|
+ />
|
|
|
+ )
|
|
|
+ }
|
|
|
{
|
|
|
globalStore.showMenu &&
|
|
|
<SideBarContainer
|
|
|
@@ -546,7 +558,7 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
}
|
|
|
<SideBarHeader
|
|
|
title={getType() === 'bigModel' ?
|
|
|
- <div style={{ display: 'flex', alignItems: 'center' }}>
|
|
|
+ <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
|
|
{
|
|
|
isMobileScreen && <div>
|
|
|
<Button
|
|
|
@@ -558,22 +570,17 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
/>
|
|
|
</div>
|
|
|
}
|
|
|
- 问答历史
|
|
|
+ <img style={{ height: 32 }} src={faviconSrc.src} />
|
|
|
+ <span>建科•小智</span>
|
|
|
</div>
|
|
|
:
|
|
|
''
|
|
|
}
|
|
|
- logo={getType() === 'bigModel' ? <img style={{ height: 40 }} src={faviconSrc.src} /> : ''}
|
|
|
+ logo={getType() === 'bigModel' ? null : ''}
|
|
|
>
|
|
|
- <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 10, gap: 8 }}>
|
|
|
+ <div className={styles["sidebar-action-group"]}>
|
|
|
<Button
|
|
|
- style={{
|
|
|
- width: '48%',
|
|
|
- height: 36,
|
|
|
- borderRadius: 6,
|
|
|
- fontSize: 14,
|
|
|
- fontWeight: 500
|
|
|
- }}
|
|
|
+ className={styles["sidebar-action-button"]}
|
|
|
icon={<HomeOutlined />}
|
|
|
onClick={() => {
|
|
|
navigate({ pathname: '/' });
|
|
|
@@ -582,13 +589,7 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
回到首页
|
|
|
</Button>
|
|
|
<Button
|
|
|
- style={{
|
|
|
- width: '48%',
|
|
|
- height: 36,
|
|
|
- borderRadius: 6,
|
|
|
- fontSize: 14,
|
|
|
- fontWeight: 500
|
|
|
- }}
|
|
|
+ className={styles["sidebar-action-button"]}
|
|
|
icon={<PlusOutlined />}
|
|
|
onClick={async () => {
|
|
|
chatStore.clearSessions();
|
|
|
@@ -596,7 +597,7 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
value.appId = globalStore.selectedAppId;
|
|
|
});
|
|
|
if (isMobileScreen) {
|
|
|
- globalStore.setShowMenu(false);
|
|
|
+ closeSidebar();
|
|
|
}
|
|
|
if (getType() === 'bigModel') {
|
|
|
navigate({ pathname: '/newChat' });
|
|
|
@@ -617,15 +618,9 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
新建对话
|
|
|
</Button>
|
|
|
</div>
|
|
|
- <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 10, gap: 8 }}>
|
|
|
+ <div className={styles["sidebar-action-group"]}>
|
|
|
<Button
|
|
|
- style={{
|
|
|
- width: '48%',
|
|
|
- height: 36,
|
|
|
- borderRadius: 6,
|
|
|
- fontSize: 14,
|
|
|
- fontWeight: 500
|
|
|
- }}
|
|
|
+ className={styles["sidebar-action-button"]}
|
|
|
icon={<AppstoreOutlined />}
|
|
|
onClick={() => {
|
|
|
setDrawerType('all');
|
|
|
@@ -635,13 +630,7 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
我的应用
|
|
|
</Button>
|
|
|
<Button
|
|
|
- style={{
|
|
|
- width: '48%',
|
|
|
- height: 36,
|
|
|
- borderRadius: 6,
|
|
|
- fontSize: 14,
|
|
|
- fontWeight: 500
|
|
|
- }}
|
|
|
+ className={styles["sidebar-action-button"]}
|
|
|
icon={<StarOutlined />}
|
|
|
onClick={() => {
|
|
|
setDrawerType('collect');
|
|
|
@@ -652,6 +641,13 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
</Button>
|
|
|
</div>
|
|
|
</SideBarHeader>
|
|
|
+ <div style={{
|
|
|
+ fontSize: 12,
|
|
|
+ color: '#999999',
|
|
|
+ padding: '8px 0 4px',
|
|
|
+ }}>
|
|
|
+ 问答历史
|
|
|
+ </div>
|
|
|
<Menu
|
|
|
style={{ border: 'none' }}
|
|
|
onClick={async (info) => {
|
|
|
@@ -660,7 +656,7 @@ export const SideBar = (props: { className?: string }) => {
|
|
|
const props = info.item.props;
|
|
|
const { showMenu, chatMode, appId } = props;
|
|
|
if (isMobileScreen) {
|
|
|
- globalStore.setShowMenu(false);
|
|
|
+ closeSidebar();
|
|
|
}
|
|
|
let url = ``;
|
|
|
if (getType() === 'bigModel') {
|