Update layout

This commit is contained in:
2024-10-11 23:57:45 +02:00
parent d29732f5e9
commit 563de5aa2d
5 changed files with 148 additions and 109 deletions

View File

@@ -0,0 +1,39 @@
import React, { useEffect } from 'react';
import { Box } from '@mantine/core';
import FileActions from './FileActions';
import FileTree from './FileTree';
import { useFileList } from '../hooks/useFileList';
import { useGitOperations } from '../hooks/useGitOperations';
import { useSettings } from '../contexts/SettingsContext';
const Sidebar = ({ selectedFile, handleFileSelect }) => {
const { settings } = useSettings();
const { files, loadFileList } = useFileList();
const { handlePull } = useGitOperations(settings.gitEnabled);
useEffect(() => {
loadFileList();
}, [settings.gitEnabled, loadFileList]);
return (
<Box
style={{
width: '25%',
minWidth: '200px',
maxWidth: '300px',
borderRight: '1px solid var(--app-shell-border-color)',
height: '100%',
overflow: 'hidden',
}}
>
<FileActions handlePullChanges={handlePull} selectedFile={selectedFile} />
<FileTree
files={files}
handleFileSelect={handleFileSelect}
selectedFile={selectedFile}
/>
</Box>
);
};
export default Sidebar;