mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 16:04:23 +00:00
Update layout
This commit is contained in:
39
frontend/src/components/Sidebar.js
Normal file
39
frontend/src/components/Sidebar.js
Normal 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;
|
||||
Reference in New Issue
Block a user