Commit f571d7e7 authored by StyleZhang's avatar StyleZhang

fix: notion-page-selector

parent fa3522dc
......@@ -39,11 +39,13 @@ const recursivePushInParentDescendants = (
const parentId = current.parent_id
const pageId = current.page_id
if (!parentId || !pageId)
return
if (parentId !== 'root') {
if (!listTreeMap[parentId]) {
const children = new Set([pageId])
const descendants = new Set([pageId, leafItem.page_id])
listTreeMap[parentId] = {
...pagesMap[parentId],
children,
......@@ -85,15 +87,21 @@ const Item = memo(({ index, style, data }: ListChildComponentProps<{
const breadCrumbs = ancestors.length ? [...ancestors, current.page_name] : [current.page_name]
const renderArrow = () => {
return hasChild
? (
if (hasChild) {
return (
<div
className={cn(s.arrow, current.expand && s['arrow-expand'], 'shrink-0 mr-1 w-5 h-5 hover:bg-gray-200 rounded-md')}
style={{ marginLeft: current.deepth * 8 }}
onClick={() => handleToggle(index)}
/>
)
: (
}
if (current.parent_id === 'root') {
return (
<div></div>
)
}
return (
<div className='shrink-0 mr-1 w-5 h-5' style={{ marginLeft: current.deepth * 8 }} />
)
}
......
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