style: compact new folder

This commit is contained in:
Jing Hua 2023-04-07 17:52:03 +08:00
parent 8f2b6dfdb8
commit 51f2385b75
4 changed files with 7 additions and 8 deletions

View file

@ -2,7 +2,6 @@ import React, { useEffect, useRef, useState } from 'react';
import useStore from '@store/store'; import useStore from '@store/store';
import { shallow } from 'zustand/shallow'; import { shallow } from 'zustand/shallow';
import NewFolder from './NewFolder';
import ChatFolder from './ChatFolder'; import ChatFolder from './ChatFolder';
import ChatHistory from './ChatHistory'; import ChatHistory from './ChatHistory';
import ChatSearch from './ChatSearch'; import ChatSearch from './ChatSearch';
@ -164,7 +163,6 @@ const ChatHistoryList = () => {
onDragLeave={handleDragLeave} onDragLeave={handleDragLeave}
onDragEnd={handleDragEnd} onDragEnd={handleDragEnd}
> >
<NewFolder />
<ChatSearch filter={filter} setFilter={setFilter} /> <ChatSearch filter={filter} setFilter={setFilter} />
<div className='flex flex-col gap-2 text-gray-100 text-sm'> <div className='flex flex-col gap-2 text-gray-100 text-sm'>
{Object.keys(chatFolders).map((folderId) => ( {Object.keys(chatFolders).map((folderId) => (

View file

@ -3,6 +3,7 @@ import React, { useEffect, useRef } from 'react';
import useStore from '@store/store'; import useStore from '@store/store';
import NewChat from './NewChat'; import NewChat from './NewChat';
import NewFolder from './NewFolder';
import ChatHistoryList from './ChatHistoryList'; import ChatHistoryList from './ChatHistoryList';
import MenuOptions from './MenuOptions'; import MenuOptions from './MenuOptions';
@ -38,7 +39,10 @@ const Menu = () => {
<div className='flex h-full min-h-0 flex-col'> <div className='flex h-full min-h-0 flex-col'>
<div className='flex h-full w-full flex-1 items-start border-white/20'> <div className='flex h-full w-full flex-1 items-start border-white/20'>
<nav className='flex h-full flex-1 flex-col space-y-1 px-2 pt-2'> <nav className='flex h-full flex-1 flex-col space-y-1 px-2 pt-2'>
<NewChat /> <div className='flex gap-2'>
<NewChat />
<NewFolder />
</div>
<ChatHistoryList /> <ChatHistoryList />
<MenuOptions /> <MenuOptions />
</nav> </nav>

View file

@ -13,7 +13,7 @@ const NewChat = ({ folder }: { folder?: string }) => {
return ( return (
<a <a
className={`flex items-center max-md:hidden rounded-md hover:bg-gray-500/10 transition-all duration-200 text-white text-sm flex-shrink-0 ${ className={`flex flex-1 items-center max-md:hidden rounded-md hover:bg-gray-500/10 transition-all duration-200 text-white text-sm flex-shrink-0 ${
generating generating
? 'cursor-not-allowed opacity-40' ? 'cursor-not-allowed opacity-40'
: 'cursor-pointer opacity-100' : 'cursor-pointer opacity-100'

View file

@ -52,10 +52,7 @@ const NewFolder = () => {
if (!generating) addFolder(); if (!generating) addFolder();
}} }}
> >
<NewFolderIcon />{' '} <NewFolderIcon />
<span className='hidden md:inline-flex text-white text-sm'>
{t('newFolder')}
</span>
</a> </a>
); );
}; };