Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: add `Audios` tab in attachments dialog

Abdullah Atta055c647698da
diff --git a/apps/web/src/components/icons/index.tsx b/apps/web/src/components/icons/index.tsx
index 5516f580e..a754554c9 100644
--- a/apps/web/src/components/icons/index.tsx
+++ b/apps/web/src/components/icons/index.tsx
@@ -212,7 +212,8 @@ import {
mdiCalendarBlank,
mdiFormatListBulleted,
mdiLink,
- mdiWindowClose
+ mdiWindowClose,
+ mdiFileMusicOutline
} from "@mdi/js";
import { useTheme } from "@emotion/react";
import { Theme } from "@notesnook/theme";
@@ -516,6 +517,7 @@ export const FilePDF = createIcon(
);
export const FileDocument = createIcon(mdiFileDocumentOutline);
export const FileVideo = createIcon(mdiFileVideoOutline);
+export const FileAudio = createIcon(mdiFileMusicOutline);
export const FileGeneral = createIcon(mdiFileOutline);
export const FileWebClip = createIcon(mdiWeb);
export const Unlink = createIcon(mdiLinkOff);
diff --git a/apps/web/src/dialogs/attachments-dialog.tsx b/apps/web/src/dialogs/attachments-dialog.tsx
index d40525aaa..3a2a7f293 100644
--- a/apps/web/src/dialogs/attachments-dialog.tsx
+++ b/apps/web/src/dialogs/attachments-dialog.tsx
@@ -37,6 +37,7 @@ import {
Close,
DoubleCheckmark,
Download,
+ FileAudio,
FileDocument,
FileGeneral,
FileImage,
@@ -111,7 +112,8 @@ function AttachmentsDialog({ onClose }: AttachmentsDialogProps) {
images: 0,
orphaned: 0,
uploads: 0,
- videos: 0
+ videos: 0,
+ audio: 0
});
const [selected, setSelected] = useState<string[]>([]);
const [sortBy, setSortBy] = useState<SortOptions>({
@@ -375,7 +377,14 @@ function AttachmentRow(
);
}
-type Route = "all" | "images" | "documents" | "videos" | "uploads" | "orphaned";
+type Route =
+ | "all"
+ | "images"
+ | "documents"
+ | "videos"
+ | "audio"
+ | "uploads"
+ | "orphaned";
const routes: { id: Route; icon: Icon; title: string }[] = [
{
@@ -398,6 +407,11 @@ const routes: { id: Route; icon: Icon; title: string }[] = [
icon: FileVideo,
title: "Videos"
},
+ {
+ id: "audio",
+ icon: FileAudio,
+ title: "Audios"
+ },
{
id: "uploads",
icon: Uploading,
@@ -525,6 +539,7 @@ async function getCounts(): Promise<Record<Route, number>> {
documents: await db.attachments.documents.count(),
images: await db.attachments.images.count(),
videos: await db.attachments.videos.count(),
+ audio: await db.attachments.audios.count(),
uploads: await db.attachments.pending.count(),
orphaned: await db.attachments.orphaned.count()
};
@@ -541,5 +556,7 @@ function filterAttachments(route: Route) {
? db.attachments.documents
: route === "orphaned"
? db.attachments.orphaned
+ : route === "audio"
+ ? db.attachments.audios
: db.attachments.pending;
}