From e9ff853b81bc8851988096206ca767f2da9843cd Mon Sep 17 00:00:00 2001
From: florian <>
Date: Sat, 27 Jul 2024 19:51:38 +0200
Subject: [PATCH] chore: more upload improvements
---
package.json | 38 +-
src/components/BlobList/BlobList.tsx | 16 +-
.../FileEventEditor/FileEventEditor.tsx | 536 +++++++++---------
src/components/FileEventEditor/dvm.ts | 4 +-
.../FileEventEditor/usePublishing.ts | 20 +-
src/components/Layout/Layout.tsx | 4 +-
src/components/MimeTypeIcon.tsx | 12 +
src/components/ServerList/Server.tsx | 12 +-
src/components/ServerList/ServerList.css | 12 +-
src/components/UploadFileSelection.tsx | 10 +-
src/main.tsx | 5 +-
src/pages/Transfer.tsx | 2 +-
src/pages/Upload.tsx | 159 +++++-
src/utils/blossom.ts | 7 +-
src/utils/utils.ts | 6 +
15 files changed, 496 insertions(+), 347 deletions(-)
create mode 100644 src/components/MimeTypeIcon.tsx
diff --git a/package.json b/package.json
index 2b691c8..f64d7a1 100644
--- a/package.json
+++ b/package.json
@@ -12,47 +12,47 @@
"analyze": "vite-bundle-visualizer"
},
"dependencies": {
- "@heroicons/react": "^2.1.4",
+ "@heroicons/react": "^2.1.5",
"@noble/hashes": "^1.4.0",
"@nostr-dev-kit/ndk": "^2.8.2",
"@nostr-dev-kit/ndk-cache-dexie": "^2.4.2",
- "@tanstack/react-query": "^5.50.1",
- "@tanstack/react-query-devtools": "^5.50.1",
+ "@tanstack/react-query": "^5.51.15",
+ "@tanstack/react-query-devtools": "^5.51.15",
"add": "^2.0.6",
"axios": "^1.7.2",
"blossom-client-sdk": "^0.9.0",
"blurhash": "^2.0.5",
- "dayjs": "^1.11.11",
+ "dayjs": "^1.11.12",
"id3js": "^2.1.1",
"lodash": "^4.17.21",
- "nostr-tools": "^2.7.0",
- "p-limit": "^6.0.0",
+ "nostr-tools": "^2.7.1",
+ "p-limit": "^6.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-pdf": "^9.1.0",
- "react-router-dom": "^6.24.1"
+ "react-router-dom": "^6.25.1"
},
"devDependencies": {
- "@tanstack/eslint-plugin-query": "^5.50.1",
- "@types/lodash": "^4.17.6",
+ "@tanstack/eslint-plugin-query": "^5.51.15",
+ "@types/lodash": "^4.17.7",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
- "@typescript-eslint/eslint-plugin": "^7.15.0",
- "@typescript-eslint/parser": "^7.15.0",
+ "@typescript-eslint/eslint-plugin": "^7.17.0",
+ "@typescript-eslint/parser": "^7.17.0",
"@vitejs/plugin-react-swc": "^3.7.0",
"autoprefixer": "^10.4.19",
"daisyui": "latest",
- "eslint": "^8.56.0",
+ "eslint": "^9.8.0",
"eslint-plugin-react-hooks": "^4.6.2",
- "eslint-plugin-react-refresh": "^0.4.7",
- "postcss": "^8.4.39",
- "prettier": "^3.3.2",
- "tailwindcss": "^3.4.4",
- "typescript": "^5.5.3",
- "vite": "^5.3.3",
+ "eslint-plugin-react-refresh": "^0.4.9",
+ "postcss": "^8.4.40",
+ "prettier": "^3.3.3",
+ "tailwindcss": "^3.4.7",
+ "typescript": "^5.5.4",
+ "vite": "^5.3.5",
"vite-bundle-visualizer": "^1.2.1"
},
"optionalDependencies": {
- "@rollup/rollup-linux-x64-gnu": "4.18.0"
+ "@rollup/rollup-linux-x64-gnu": "4.19.1"
}
}
diff --git a/src/components/BlobList/BlobList.tsx b/src/components/BlobList/BlobList.tsx
index f6550eb..91679af 100644
--- a/src/components/BlobList/BlobList.tsx
+++ b/src/components/BlobList/BlobList.tsx
@@ -2,13 +2,9 @@ import { useState, useMemo } from 'react';
import { BlobDescriptor } from 'blossom-client-sdk';
import {
ClipboardDocumentIcon,
- DocumentIcon,
ExclamationTriangleIcon,
- FilmIcon,
FolderIcon,
FolderPlusIcon,
- MusicalNoteIcon,
- PhotoIcon,
PlusIcon,
TrashIcon,
XMarkIcon,
@@ -24,6 +20,7 @@ import BlobListTypeMenu, { ListMode } from './BlobListTypeMenu';
import useFileMetaEventsByHash from '../../utils/useFileMetaEvents';
import './BlobList.css';
import { useBlobSelection } from './useBlobSelection';
+import MimeTypeIcon from '../MimeTypeIcon';
type BlobListProps = {
blobs: BlobDescriptor[];
@@ -75,15 +72,6 @@ const BlobList = ({ blobs, onDelete, title, className = '' }: BlobListProps) =>
);
- const getMimeTypeIcon = (type: string | undefined) => {
- if (!type) return