mirror of
https://github.com/get-drexa/drive.git
synced 2026-02-02 16:11:17 +00:00
fix: >1 path breadcrumb not displaying root label
This commit is contained in:
@@ -52,9 +52,9 @@ export function DirectoryPathBreadcrumb({
|
|||||||
|
|
||||||
const breadcrumbItems: React.ReactNode[] = [
|
const breadcrumbItems: React.ReactNode[] = [
|
||||||
<FilePathBreadcrumbItem
|
<FilePathBreadcrumbItem
|
||||||
key={directory.path[0].id}
|
key={directory.path[0]!.id}
|
||||||
segment={directory.path[0]}
|
segment={directory.path[0]!}
|
||||||
rootLabel={rootLabel}
|
label={rootLabel}
|
||||||
directoryUrlFn={directoryUrlFn}
|
directoryUrlFn={directoryUrlFn}
|
||||||
fileDragInfoAtom={fileDragInfoAtom}
|
fileDragInfoAtom={fileDragInfoAtom}
|
||||||
/>,
|
/>,
|
||||||
@@ -65,7 +65,6 @@ export function DirectoryPathBreadcrumb({
|
|||||||
<BreadcrumbSeparator />
|
<BreadcrumbSeparator />
|
||||||
<FilePathBreadcrumbItem
|
<FilePathBreadcrumbItem
|
||||||
segment={directory.path[i]!}
|
segment={directory.path[i]!}
|
||||||
rootLabel={rootLabel}
|
|
||||||
directoryUrlFn={directoryUrlFn}
|
directoryUrlFn={directoryUrlFn}
|
||||||
fileDragInfoAtom={fileDragInfoAtom}
|
fileDragInfoAtom={fileDragInfoAtom}
|
||||||
/>
|
/>
|
||||||
@@ -88,12 +87,12 @@ export function DirectoryPathBreadcrumb({
|
|||||||
|
|
||||||
function FilePathBreadcrumbItem({
|
function FilePathBreadcrumbItem({
|
||||||
segment,
|
segment,
|
||||||
rootLabel,
|
label,
|
||||||
directoryUrlFn,
|
directoryUrlFn,
|
||||||
fileDragInfoAtom,
|
fileDragInfoAtom,
|
||||||
}: {
|
}: {
|
||||||
segment: PathSegment
|
segment: PathSegment
|
||||||
rootLabel: string
|
label?: string
|
||||||
directoryUrlFn: (directoryId: string) => string
|
directoryUrlFn: (directoryId: string) => string
|
||||||
fileDragInfoAtom: PrimitiveAtom<FileDragInfo | null>
|
fileDragInfoAtom: PrimitiveAtom<FileDragInfo | null>
|
||||||
}) {
|
}) {
|
||||||
@@ -102,7 +101,7 @@ function FilePathBreadcrumbItem({
|
|||||||
dragInfoAtom: fileDragInfoAtom,
|
dragInfoAtom: fileDragInfoAtom,
|
||||||
})
|
})
|
||||||
|
|
||||||
const dirName = segment.name || rootLabel
|
const dirName = label || segment.name
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip open={isDraggedOver}>
|
<Tooltip open={isDraggedOver}>
|
||||||
|
|||||||
Reference in New Issue
Block a user