diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index 1259bb0..32223e6 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -8,6 +8,7 @@
"name": "papercrate-frontend",
"version": "0.1.0",
"dependencies": {
+ "@tabler/icons-react": "3.11.0",
"axios": "1.7.7",
"react": "18.3.1",
"react-dom": "18.3.1",
@@ -1963,6 +1964,32 @@
"node": ">=14.0.0"
}
},
+ "node_modules/@tabler/icons": {
+ "version": "3.11.0",
+ "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-3.11.0.tgz",
+ "integrity": "sha512-/vZinJNvCYhdAB+RUsyCpanSPuOEKHHIZi4Uu0Bw7ilewHnQhCWUPrT704uHCRli2ROl7spADPmWzAqOganA5A==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/codecalm"
+ }
+ },
+ "node_modules/@tabler/icons-react": {
+ "version": "3.11.0",
+ "resolved": "https://registry.npmjs.org/@tabler/icons-react/-/icons-react-3.11.0.tgz",
+ "integrity": "sha512-xHNBi9mns1slvqos+7LkP3ube4CjWrANMbxMaorzwzO9J/+y1sAEG/sN8CV8FmtpYW/9/gDR+OWCjjLLg0RmAw==",
+ "license": "MIT",
+ "dependencies": {
+ "@tabler/icons": "3.11.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/codecalm"
+ },
+ "peerDependencies": {
+ "react": ">= 16"
+ }
+ },
"node_modules/@types/body-parser": {
"version": "1.19.6",
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.6.tgz",
diff --git a/frontend/package.json b/frontend/package.json
index 41a215a..59af28a 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -9,6 +9,7 @@
"lint": "echo \"No linting configured\""
},
"dependencies": {
+ "@tabler/icons-react": "3.11.0",
"axios": "1.7.7",
"react": "18.3.1",
"react-dom": "18.3.1",
diff --git a/frontend/src/index.jsx b/frontend/src/index.jsx
index 0dadcf1..65ea337 100644
--- a/frontend/src/index.jsx
+++ b/frontend/src/index.jsx
@@ -24,6 +24,14 @@ import './styles.css';
import AssetManager, { getAssetFromVersion, resolveDocumentAssetUrl } from './asset_manager';
import useApiError from './hooks/useApiError';
import SkeuomorphicWorkspace from './skeuomorphic_ws';
+import {
+ IconChevronRight,
+ IconDownload as TablerDownload,
+ IconFolderFilled,
+ IconPencil,
+ IconTagFilled,
+ IconTrash,
+} from '@tabler/icons-react';
const runtimeApiBase =
typeof window !== 'undefined' && window.__PAPERCRATE_API_BASE_URL
@@ -175,150 +183,6 @@ const getTagColorStyle = (hex) => {
};
};
-
-const IconChevronRight = ({ className }) => (
-
-);
-
-const IconTrash = ({ className }) => (
-
-);
-
-const IconDownload = ({ className }) => (
-
-);
-
-const IconEdit = ({ className }) => (
-
-);
-
-const IconFolder = ({ className }) => (
-
-);
-
const createRootNode = () => ({
id: 'root',
name: DEFAULT_FOLDER_NAME,
@@ -386,10 +250,20 @@ const FolderNode = ({
onFolderDragEnd,
draggingFolderId,
}) => {
- const canToggle = node.id === 'root' || node.children.length > 0 || !node.loaded;
- const icon = canToggle ? : null;
- const canDrag = node.id !== 'root';
+ const isRoot = node.id === 'root';
+ const hasChildren = node.children.length > 0;
+ const canToggle = !isRoot && (hasChildren || !node.loaded);
+ const showChevron = !isRoot && hasChildren;
+ const icon = showChevron ? (
+
+ ) : null;
+ const canDrag = !isRoot;
const isDragging = draggingFolderId === node.id;
+ const isExpanded = isRoot ? true : Boolean(node.expanded);
+ const rowClasses = ['folder-row'];
+ if (isSelected) {
+ rowClasses.push('active');
+ }
const handleToggleClick = (event) => {
event.stopPropagation();
@@ -401,7 +275,7 @@ const FolderNode = ({
return (
onSelect(node.id)}
onDragOver={(event) => onDragOver(event, node.id)}
@@ -417,13 +291,22 @@ const FolderNode = ({
}
}}
>
-
- {icon}
+ {!isRoot && (
+
+ {icon}
+
+ )}
+
+
+ {node.name}
- {node.name}
{node.id !== 'root' && (
)}
- {node.expanded && node.children.length > 0 && (
-
+ {isExpanded && node.children.length > 0 && (
+
{renderChildren(node.children, depth + 1)}
)}
@@ -530,6 +413,8 @@ const DocumentsTable = ({
breadcrumbs,
onRefresh,
onShowSkeuoWorkspace = () => {},
+ onRequestCreateFolder = () => {},
+ creatingFolder = false,
subfolders,
documents,
searchResults,
@@ -654,6 +539,13 @@ const DocumentsTable = ({
)}
+
@@ -732,7 +624,11 @@ const DocumentsTable = ({
>
-
+
|
{folder.name} |
@@ -836,7 +732,11 @@ const DocumentsTable = ({
onAuxClick={(event) => event.stopPropagation()}
onContextMenu={(event) => event.stopPropagation()}
>
-
+
Download
) : (
@@ -1222,7 +1122,7 @@ const DetailPanel = ({
aria-label="Edit title"
title="Edit title"
>
-
+
>
)}
@@ -1266,7 +1166,7 @@ const DetailPanel = ({
}
}}
>
-
+
Download