mirror of
https://github.com/get-drexa/drive.git
synced 2025-12-01 05:51:39 +00:00
feat: tailor root breadcrumb label
in all files page, the root breadcrumb label says "All Files", and "Trash" in trash page
This commit is contained in:
@@ -22,7 +22,7 @@ import { cn } from "../../lib/utils"
|
||||
import { DirectoryPageContext } from "./context"
|
||||
import { dragInfoAtom } from "./state"
|
||||
|
||||
export function FilePathBreadcrumb() {
|
||||
export function FilePathBreadcrumb({ rootLabel }: { rootLabel: string }) {
|
||||
const { rootDirectory, directory } = useContext(DirectoryPageContext)
|
||||
|
||||
const breadcrumbItems: React.ReactNode[] = []
|
||||
@@ -40,7 +40,7 @@ export function FilePathBreadcrumb() {
|
||||
<BreadcrumbList>
|
||||
{rootDirectory._id === directory._id ? (
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbPage>All Files</BreadcrumbPage>
|
||||
<BreadcrumbPage>{rootLabel}</BreadcrumbPage>
|
||||
</BreadcrumbItem>
|
||||
) : (
|
||||
<FilePathBreadcrumbItem component={directory.path[0]!} />
|
||||
|
||||
@@ -126,7 +126,7 @@ function RouteComponent() {
|
||||
value={{ rootDirectory, directory, directoryContent }}
|
||||
>
|
||||
<header className="flex py-2 shrink-0 items-center gap-2 border-b px-4 w-full">
|
||||
<FilePathBreadcrumb />
|
||||
<FilePathBreadcrumb rootLabel="All Files" />
|
||||
<div className="ml-auto flex flex-row gap-2">
|
||||
<NewDirectoryItemDropdown />
|
||||
<UploadFileButton />
|
||||
|
||||
@@ -92,7 +92,7 @@ function RouteComponent() {
|
||||
value={{ rootDirectory, directory, directoryContent }}
|
||||
>
|
||||
<header className="flex py-2 shrink-0 items-center gap-2 border-b px-4 w-full">
|
||||
<FilePathBreadcrumb />
|
||||
<FilePathBreadcrumb rootLabel="Trash" />
|
||||
<div className="ml-auto flex flex-row gap-2">
|
||||
<EmptyTrashButton />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user