Skip to content

TagSpaces is an offline, open source, document manager with tagging support

polish: add default icons for files and folders (#1369)

Ilian70b0ddf8f708
diff --git a/app/components/FolderContainer.tsx b/app/components/FolderContainer.tsx
index ee61aa82a..a2cdd6e95 100644
--- a/app/components/FolderContainer.tsx
+++ b/app/components/FolderContainer.tsx
@@ -561,12 +561,12 @@ const FolderContainer = (props: Props) => {
Mapique
</ToggleButton>
</Tooltip>
- <Tooltip title="Switch to KanBan perspective">
+ {/* <Tooltip title="Switch to KanBan perspective">
<ToggleButton value={perspectives.KANBAN} aria-label="KanBan">
<KanBanPerspectiveIcon />
KanBan
</ToggleButton>
- </Tooltip>
+ </Tooltip> */}
</ToggleButtonGroup>
)}
</div>
diff --git a/app/perspectives/grid-perspective/components/CellContent.tsx b/app/perspectives/grid-perspective/components/CellContent.tsx
index 334a841a3..b51e1d3c8 100644
--- a/app/perspectives/grid-perspective/components/CellContent.tsx
+++ b/app/perspectives/grid-perspective/components/CellContent.tsx
@@ -134,6 +134,35 @@ const CellContent = (props: Props) => {
</IconButton>
) : null;
+ const entryDefaultIcon = (
+ <svg
+ style={{
+ marginTop: 25,
+ width: '60%',
+ position: 'absolute',
+ top: '50%',
+ left: '50%',
+ transform: 'translate(-50%, -50%)',
+ height: 150
+ }}
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 32 32"
+ width="32"
+ height="32"
+ fill="none"
+ stroke="#bbbbbb22"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width="2"
+ >
+ {fsEntry.isFile ? (
+ <path d="M6 2 L6 30 26 30 26 10 18 2 Z M18 2 L18 10 26 10" />
+ ) : (
+ <path d="M2 26 L30 26 30 7 14 7 10 4 2 4 Z M30 12 L2 12" />
+ )}
+ </svg>
+ );
+
function renderGridCell() {
return (
<div
@@ -149,7 +178,7 @@ const CellContent = (props: Props) => {
height: 150 // fsEntry.isFile ? 150 : 70
}}
>
- {fsEntry.thumbPath && (
+ {fsEntry.thumbPath ? (
<img
alt="thumbnail"
className={classes.gridCellThumb}
@@ -165,6 +194,8 @@ const CellContent = (props: Props) => {
height: 150
}}
/>
+ ) : (
+ entryDefaultIcon
)}
<div id="gridCellTags" className={classes.gridCellTags}>
{showTags && entryTags
diff --git a/package.json b/package.json
index 2fa96dbd9..bc0b8cbf9 100644
--- a/package.json
+++ b/package.json
@@ -247,6 +247,7 @@
"aws-amplify": "^3.3.19",
"aws-sdk": "^2.652.0",
"babel-polyfill": "^6.26.0",
+ "bytesize-icons": "^1.4.0",
"chokidar": "^3.5.1",
"classnames": "^2.2.6",
"clone": "^2.1.2",
diff --git a/yarn.lock b/yarn.lock
index 8c480f5bd..b9764ae2f 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5741,6 +5741,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6"
integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==
+bytesize-icons@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/bytesize-icons/-/bytesize-icons-1.4.0.tgz#d21a4f20852860b899af7a80b0dcf06198b5e563"
+ integrity sha512-Hk4ruH7tAaRJcRPRNUlKFN1crsREksgzA5Fv+12a1HkinVNWCb8QZL5qEbVKfsA/VjRjBHn/TvpooooQn02Tlg==
+
cacache@^10.0.0:
version "10.0.4"
resolved "https://registry.yarnpkg.com/cacache/-/cacache-10.0.4.tgz#6452367999eff9d4188aefd9a14e9d7c6a263460"