Commit 25440279 authored by Joel's avatar Joel

feat: current item support operation

parent 28b793f7
...@@ -56,16 +56,14 @@ export default function AppNavItem({ ...@@ -56,16 +56,14 @@ export default function AppNavItem({
<div className='overflow-hidden text-ellipsis whitespace-nowrap'>{name}</div> <div className='overflow-hidden text-ellipsis whitespace-nowrap'>{name}</div>
</div> </div>
{ {
!isSelected && ( <div className={cn(s.opBtn, 'shrink-0')} onClick={e => e.stopPropagation()}>
<div className={cn(s.opBtn, 'shrink-0')} onClick={e => e.stopPropagation()}> <ItemOperation
<ItemOperation isPinned={isPinned}
isPinned={isPinned} togglePin={togglePin}
togglePin={togglePin} isShowDelete={!uninstallable && !isSelected}
isShowDelete={!uninstallable} onDelete={() => onDelete(id)}
onDelete={() => onDelete(id)} />
/> </div>
</div>
)
} }
</div> </div>
) )
......
...@@ -95,18 +95,14 @@ const List: FC<IListProps> = ({ ...@@ -95,18 +95,14 @@ const List: FC<IListProps> = ({
<span>{item.name}</span> <span>{item.name}</span>
</div> </div>
{ <div className={cn(s.opBtn, 'shrink-0')} onClick={e => e.stopPropagation()}>
!isCurrent && ( <ItemOperation
<div className={cn(s.opBtn, 'shrink-0')} onClick={e => e.stopPropagation()}> isPinned={isPinned}
<ItemOperation togglePin={() => onPinChanged(item.id)}
isPinned={isPinned} isShowDelete
togglePin={() => onPinChanged(item.id)} onDelete={() => onDelete(item.id)}
isShowDelete />
onDelete={() => onDelete(item.id)} </div>
/>
</div>
)
}
</div> </div>
) )
})} })}
......
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