diff --git a/src/components/Sidebars/FileSideBar/FileSidebar.tsx b/src/components/Sidebars/FileSideBar/FileSidebar.tsx index 6f1502549..de5ac5b1d 100644 --- a/src/components/Sidebars/FileSideBar/FileSidebar.tsx +++ b/src/components/Sidebars/FileSideBar/FileSidebar.tsx @@ -2,8 +2,12 @@ import React, { useEffect, useState } from 'react' import { FileInfoNode, FileInfoTree } from 'electron/main/filesystem/types' import { FixedSizeList } from 'react-window' import { isFileNodeDirectory } from '@shared/utils' -import { YStack } from 'tamagui' +import { XStack, YStack } from 'tamagui' +import { HiOutlinePencilAlt } from 'react-icons/hi' +import { VscNewFolder } from 'react-icons/vsc' import { useFileContext } from '@/contexts/FileContext' +import { useModalOpeners } from '@/contexts/ModalContext' +import { useContentContext } from '@/contexts/ContentContext' import FileItemRows from './FileItemRows' const getFilesAndIndentationsForSidebar = ( @@ -34,6 +38,8 @@ const FileSidebar: React.FC = ({ lheight }) => { // const { state, actions } = useThemeManager() const [listHeight, setListHeight] = useState(lheight ?? window.innerHeight - 50) const { vaultFilesTree, expandedDirectories, renameFile, setSelectedDirectory } = useFileContext() + const { setIsNewDirectoryModalOpen } = useModalOpeners() + const { createUntitledNote } = useContentContext() const handleDrop = async (e: React.DragEvent) => { e.preventDefault() @@ -67,6 +73,26 @@ const FileSidebar: React.FC = ({ lheight }) => { const itemCount = filesAndIndentations.length return ( + + createUntitledNote()} + > + + + setIsNewDirectoryModalOpen(true)} + > + + +
= ({ getShortcutDescription }) = const [showVaultSetup, setShowVaultSetup] = useState(false) const { state, actions } = useThemeManager() // State => theme, actions => toggle, set, syncWithSystem - const { isSettingsModalOpen, setIsSettingsModalOpen, setIsNewDirectoryModalOpen } = useModalOpeners() - const { createUntitledNote } = useContentContext() + const { isSettingsModalOpen, setIsSettingsModalOpen } = useModalOpeners() const handleAllInitialSettingsAreReady = () => { setShowVaultSetup(false) @@ -92,44 +90,7 @@ const IconsSidebar: React.FC = ({ getShortcutDescription }) = />
-
createUntitledNote()} - > - - - -
-
setIsNewDirectoryModalOpen(true)} - > - - - -
+ {/* New Note and New Directory actions moved into Files sidebar header */}