Commit b7b3084c authored by Joel's avatar Joel

fix: show op has scrollbar

parent 5a402b5a
...@@ -96,10 +96,10 @@ const Sidebar: FC<ISidebarProps> = ({ ...@@ -96,10 +96,10 @@ const Sidebar: FC<ISidebarProps> = ({
<PencilSquareIcon className="mr-2 h-4 w-4" /> {t('share.chat.newChat')} <PencilSquareIcon className="mr-2 h-4 w-4" /> {t('share.chat.newChat')}
</Button> </Button>
</div> </div>
<div className='flex-grow h-0 overflow-y-auto overflow-x-hidden'> <div className={'flex-grow flex flex-col h-0 overflow-y-auto overflow-x-hidden'}>
{/* pinned list */} {/* pinned list */}
{hasPinned && ( {hasPinned && (
<div className='mt-4 px-4'> <div className={cn('mt-4 px-4', list.length === 0 && 'flex flex-col flex-grow')}>
<div className='mb-1.5 leading-[18px] text-xs text-gray-500 font-medium uppercase'>{t('share.chat.pinnedTitle')}</div> <div className='mb-1.5 leading-[18px] text-xs text-gray-500 font-medium uppercase'>{t('share.chat.pinnedTitle')}</div>
<List <List
className={cn(list.length > 0 ? maxListHeight : 'flex-grow')} className={cn(list.length > 0 ? maxListHeight : 'flex-grow')}
...@@ -119,7 +119,7 @@ const Sidebar: FC<ISidebarProps> = ({ ...@@ -119,7 +119,7 @@ const Sidebar: FC<ISidebarProps> = ({
</div> </div>
)} )}
{/* unpinned list */} {/* unpinned list */}
<div className='mt-4 px-4'> <div className={cn('mt-4 px-4', !hasPinned && 'flex flex-col flex-grow')}>
{(hasPinned && list.length > 0) && ( {(hasPinned && list.length > 0) && (
<div className='mb-1.5 leading-[18px] text-xs text-gray-500 font-medium uppercase'>{t('share.chat.unpinnedTitle')}</div> <div className='mb-1.5 leading-[18px] text-xs text-gray-500 font-medium uppercase'>{t('share.chat.unpinnedTitle')}</div>
)} )}
......
...@@ -65,7 +65,7 @@ const List: FC<IListProps> = ({ ...@@ -65,7 +65,7 @@ const List: FC<IListProps> = ({
return ( return (
<nav <nav
ref={listRef} ref={listRef}
className={cn(className, 'shrink-0 space-y-1 bg-white pb-[60px] overflow-y-auto')} className={cn(className, 'shrink-0 space-y-1 bg-white pb-[85px] overflow-y-auto')}
> >
{list.map((item) => { {list.map((item) => {
const isCurrent = item.id === currentId const isCurrent = item.id === currentId
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment