mirror of
https://mirror.skon.top/github.com/langgenius/dify.git
synced 2026-04-30 17:50:29 +08:00
fix: fold indent style
This commit is contained in:
@@ -61,7 +61,7 @@ const FilePickerTreeNode: FC<FilePickerTreeNodeProps> = ({ node, style, dragHand
|
||||
onClick={handleClick}
|
||||
onKeyDown={handleKeyDown}
|
||||
>
|
||||
<TreeGuideLines level={node.level} />
|
||||
<TreeGuideLines level={node.level} lineOffset={0} />
|
||||
<div className="flex min-w-0 flex-1 items-center gap-2 px-3">
|
||||
<div className="flex size-4 shrink-0 items-center justify-center">
|
||||
{isFolder
|
||||
|
||||
@@ -2,13 +2,20 @@
|
||||
|
||||
import * as React from 'react'
|
||||
|
||||
const INDENT_SIZE = 20
|
||||
|
||||
type TreeGuideLinesProps = {
|
||||
level: number
|
||||
indentSize?: number
|
||||
lineOffset?: number
|
||||
}
|
||||
|
||||
const TreeGuideLines: React.FC<TreeGuideLinesProps> = ({ level }) => {
|
||||
const INDENT_SIZE = 20
|
||||
const DEFAULT_LINE_OFFSET = 10
|
||||
|
||||
const TreeGuideLines: React.FC<TreeGuideLinesProps> = ({
|
||||
level,
|
||||
indentSize = INDENT_SIZE,
|
||||
lineOffset = DEFAULT_LINE_OFFSET,
|
||||
}) => {
|
||||
if (level === 0)
|
||||
return null
|
||||
|
||||
@@ -18,7 +25,7 @@ const TreeGuideLines: React.FC<TreeGuideLinesProps> = ({ level }) => {
|
||||
<div
|
||||
key={`guide-${i}`}
|
||||
className="absolute bottom-0 top-0 border-l border-divider-subtle"
|
||||
style={{ left: `${(i + 1) * INDENT_SIZE - 10}px` }}
|
||||
style={{ left: `${(i + 1) * indentSize - lineOffset}px` }}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user