diff --git a/src/components/FileCard.svelte b/src/components/FileCard.svelte index 2395548..27d5688 100644 --- a/src/components/FileCard.svelte +++ b/src/components/FileCard.svelte @@ -61,6 +61,12 @@ + { + e.preventDefault(); + dispatch("details", file); + }}>Details { e.preventDefault(); diff --git a/src/components/FileDetailsModal.svelte b/src/components/FileDetailsModal.svelte new file mode 100644 index 0000000..72a90da --- /dev/null +++ b/src/components/FileDetailsModal.svelte @@ -0,0 +1,54 @@ + + + +

+ sha256: {file.sha256} +
+ Size: {formatBytes(file.size)} +
+ Type: {file.type || "Unknown"} +
+ URL: + {getBlobURL(file)} +

+ + {#if $drives.length > 0} +
+

Drives:

+
    + {#each $drives as drive} +
  • {getDriveName(drive)} by
  • + {/each} +
+
+ {/if} + {#if $files.length > 0} +
+

Published Files:

+ +
+ {/if} +
diff --git a/src/pages/Drive.svelte b/src/pages/Drive.svelte index 45e9d41..91db903 100644 --- a/src/pages/Drive.svelte +++ b/src/pages/Drive.svelte @@ -29,6 +29,7 @@ import { signEventTemplate } from "../services/ndk"; import { servers } from "../services/servers"; import { readFileSystemFile, getAllFileEntriesInTree, readFileSystemDirectory } from "../helpers/file-system"; + import BlobDetailsModal from "../components/FileDetailsModal.svelte"; export let params: Record = {}; const naddr = params["naddr"]; @@ -39,6 +40,8 @@ $: tree = drive ? getFileTree(drive) : {}; $: subTree = getFolder(tree, parsePath(parsed.get("path"))); + let detailsModal = false; + let detailsFile: TreeFile | null = null; let confirmDelete = false; let selected: string[] = []; function toggleSelect(e: CustomEvent) { @@ -248,6 +251,10 @@ selected = [e.detail]; confirmDelete = true; }} + on:details={(e) => { + detailsFile = e.detail; + detailsModal = true; + }} /> {/each} @@ -262,3 +269,7 @@ {#if renameModal} {/if} + +{#if detailsModal && detailsFile} + +{/if}