优化折叠

This commit is contained in:
IndieKKY
2023-06-02 13:49:22 +08:00
parent 098506be33
commit 1a3ac30ec8
3 changed files with 22 additions and 21 deletions

View File

@@ -191,7 +191,7 @@ const SegmentCard = (props: {
return <div
className={classNames('border border-base-300 bg-base-200/25 rounded flex flex-col m-1.5 p-1.5 gap-1 shadow', showCurrent && 'shadow-primary')}>
<div className='relative flex justify-center min-h-[20px]'>
{segments != null && segments.length > 1 &&
{segments != null && segments.length > 0 &&
<div className='absolute left-0 top-0 bottom-0 text-xs select-none flex-center desc'>
{segment.fold
? <BsPlusSquare className='cursor-pointer' onClick={onFold}/> :
@@ -224,7 +224,7 @@ const SegmentCard = (props: {
needScroll={needScroll && curIdx === segment.startIdx + idx}
last={idx === segment.items.length - 1}
/>)}
{segments != null && segments.length > 1 && <div className='flex justify-center'><a className='link text-xs'
{segments != null && segments.length > 0 && <div className='flex justify-center'><a className='link text-xs'
onClick={onFold}>{segment.items.length}</a>
</div>}
</div>