From 74aa081a2b01325101321f5baffe14b523e9b53b Mon Sep 17 00:00:00 2001 From: Guillermo Puente Date: Thu, 27 Jun 2024 15:16:08 -0400 Subject: [PATCH] feat: sort folders and files alphabetically --- src/components/folder-view.tsx | 3 ++- src/hooks/useDrivesContainer.ts | 8 ++++++-- src/utils/index.ts | 1 + src/utils/tree-items.ts | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 src/utils/tree-items.ts diff --git a/src/components/folder-view.tsx b/src/components/folder-view.tsx index cd58ee18..8e724220 100644 --- a/src/components/folder-view.tsx +++ b/src/components/folder-view.tsx @@ -6,6 +6,7 @@ import { useFileOptions } from 'src/hooks/useFileOptions'; import { useFolderContent } from 'src/hooks/useFolderContent'; import { useFolderOptions } from 'src/hooks/useFolderOptions'; import { useOnDropEvent } from 'src/hooks/useOnDropEvent'; +import { sortTreeItemsByLabel } from 'src/utils'; import { twMerge } from 'tailwind-merge'; import { ContentSection } from './content'; import FileContentView from './file-content-view'; @@ -86,7 +87,7 @@ export const FolderView: React.FC = ({ )} > + a.label.localeCompare(b.label);