feat: Show all topics on drag start

- Enforce the drag and drop functionality to show all topics on drag start.
This commit is contained in:
kangfenmao 2024-09-08 22:35:34 +08:00
parent bd194ff955
commit 500e91977c

View File

@ -100,9 +100,12 @@ const Topics: FC<Props> = ({ assistant: _assistant, activeTopic, setActiveTopic
return ( return (
<Container> <Container>
<DragableList <DragableList
list={take(assistant.topics, showAll ? assistant.topics.length : 15)} list={take(assistant.topics, showAll ? assistant.topics.length : 14)}
onUpdate={updateTopics} onUpdate={updateTopics}
onDragStart={() => setDraging(true)} onDragStart={() => {
setShowAll(true)
setDraging(true)
}}
onDragEnd={() => setDraging(false)}> onDragEnd={() => setDraging(false)}>
{(topic) => { {(topic) => {
const isActive = topic.id === activeTopic?.id const isActive = topic.id === activeTopic?.id