diff --git a/frontend/src/components/FileExplorer.tsx b/frontend/src/components/FileExplorer.tsx index 12e4547..797d68a 100644 --- a/frontend/src/components/FileExplorer.tsx +++ b/frontend/src/components/FileExplorer.tsx @@ -1901,6 +1901,8 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) { onRename={(oldPath, newName, newPath) => { setEditingFile(prev => prev ? { ...prev, name: newName, path: newPath } : null); }} + theme={theme as 'light' | 'dark'} + toggleTheme={toggleTheme} /> ) : (appMode === 'docs' || appMode === 'slides') && activeSection === 'files' ? ( Blank + - {/* Recent Documents */}
diff --git a/frontend/src/components/OnlyOfficeEditor.tsx b/frontend/src/components/OnlyOfficeEditor.tsx index ac6c10e..3dbf295 100644 --- a/frontend/src/components/OnlyOfficeEditor.tsx +++ b/frontend/src/components/OnlyOfficeEditor.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useState, useRef } from 'react'; import { DocumentEditor } from '@onlyoffice/document-editor-react'; +import { Sun, Moon } from 'lucide-react'; import api from '@/lib/api'; interface FileItem { @@ -18,9 +19,11 @@ interface OnlyOfficeEditorProps { type: 'word' | 'cell' | 'slide'; onClose: () => void; onRename?: (oldPath: string, newName: string, newPath: string) => void; + theme: 'light' | 'dark'; + toggleTheme: () => void; } -export default function OnlyOfficeEditor({ file, type, onClose, onRename }: OnlyOfficeEditorProps) { +export default function OnlyOfficeEditor({ file, type, onClose, onRename, theme, toggleTheme }: OnlyOfficeEditorProps) { const [downloadToken, setDownloadToken] = useState(null); const [loadError, setLoadError] = useState(null); const [config, setConfig] = useState(null); @@ -103,6 +106,7 @@ export default function OnlyOfficeEditor({ file, type, onClose, onRename }: Only mode: 'edit', customization: { forcesave: true, + uiTheme: theme === 'dark' ? 'id-dark' : 'id-light', goback: { url: '', } @@ -123,13 +127,13 @@ export default function OnlyOfficeEditor({ file, type, onClose, onRename }: Only setConfig(baseConfig); }); - }, [downloadToken, file, type]); + }, [downloadToken, file, type, theme]); if (!config) { return (
Loading Editor...
- {loadError &&
Error: {loadError}
} + {loadError &&
Error: {loadError}
}
); } @@ -146,8 +150,8 @@ export default function OnlyOfficeEditor({ file, type, onClose, onRename }: Only }; return ( -
-
+
+
{isRenaming ? ( ) : ( @@ -173,18 +177,28 @@ export default function OnlyOfficeEditor({ file, type, onClose, onRename }: Only } }, 50); }} - className="font-medium text-sm text-gray-700 hover:text-blue-600 hover:underline cursor-pointer transition-colors truncate max-w-[500px]" + className="font-medium text-sm text-gray-700 dark:text-gray-200 hover:text-blue-600 dark:hover:text-blue-400 hover:underline cursor-pointer transition-colors truncate max-w-[500px]" title="Click to rename" > {baseName} )} - +
+ + +
{loadError ? (