mirror of
https://github.com/get-drexa/drive.git
synced 2025-11-30 21:41:39 +00:00
fix: root label not applied for non-root dirs
fix breadcrumb root label not correctly displayed when breadcrumb is displaying path for non-root dirs
This commit is contained in:
@@ -30,7 +30,10 @@ export function FilePathBreadcrumb({ rootLabel }: { rootLabel: string }) {
|
|||||||
breadcrumbItems.push(
|
breadcrumbItems.push(
|
||||||
<Fragment key={directory.path[i]?.handle.id}>
|
<Fragment key={directory.path[i]?.handle.id}>
|
||||||
<BreadcrumbSeparator />
|
<BreadcrumbSeparator />
|
||||||
<FilePathBreadcrumbItem component={directory.path[i]!} />
|
<FilePathBreadcrumbItem
|
||||||
|
component={directory.path[i]!}
|
||||||
|
rootLabel={rootLabel}
|
||||||
|
/>
|
||||||
</Fragment>,
|
</Fragment>,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -43,7 +46,10 @@ export function FilePathBreadcrumb({ rootLabel }: { rootLabel: string }) {
|
|||||||
<BreadcrumbPage>{rootLabel}</BreadcrumbPage>
|
<BreadcrumbPage>{rootLabel}</BreadcrumbPage>
|
||||||
</BreadcrumbItem>
|
</BreadcrumbItem>
|
||||||
) : (
|
) : (
|
||||||
<FilePathBreadcrumbItem component={directory.path[0]!} />
|
<FilePathBreadcrumbItem
|
||||||
|
component={directory.path[0]!}
|
||||||
|
rootLabel={rootLabel}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
{breadcrumbItems}
|
{breadcrumbItems}
|
||||||
<BreadcrumbSeparator />
|
<BreadcrumbSeparator />
|
||||||
@@ -55,13 +61,19 @@ export function FilePathBreadcrumb({ rootLabel }: { rootLabel: string }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function FilePathBreadcrumbItem({ component }: { component: PathComponent }) {
|
function FilePathBreadcrumbItem({
|
||||||
|
component,
|
||||||
|
rootLabel,
|
||||||
|
}: {
|
||||||
|
component: PathComponent
|
||||||
|
rootLabel: string
|
||||||
|
}) {
|
||||||
const { isDraggedOver, dropHandlers } = useFileDrop({
|
const { isDraggedOver, dropHandlers } = useFileDrop({
|
||||||
destItem: component.handle as DirectoryHandle,
|
destItem: component.handle as DirectoryHandle,
|
||||||
dragInfoAtom,
|
dragInfoAtom,
|
||||||
})
|
})
|
||||||
|
|
||||||
const dirName = component.name || "All Files"
|
const dirName = component.name || rootLabel
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip open={isDraggedOver}>
|
<Tooltip open={isDraggedOver}>
|
||||||
|
|||||||
Reference in New Issue
Block a user