diff --git a/apps/app/components/icons/attachment-icon.tsx b/apps/app/components/icons/attachment-icon.tsx index 59c32ea60..88fbd781e 100644 --- a/apps/app/components/icons/attachment-icon.tsx +++ b/apps/app/components/icons/attachment-icon.tsx @@ -1,6 +1,8 @@ import { + AudioIcon, CssIcon, CsvIcon, + DefaultIcon, DocIcon, FigmaIcon, HtmlIcon, @@ -11,6 +13,7 @@ import { SheetIcon, SvgIcon, TxtIcon, + VideoIcon, } from "components/icons"; export const getFileIcon = (fileType: string) => { @@ -39,8 +42,18 @@ export const getFileIcon = (fileType: string) => { return ; case "svg": return ; + case "mp3": + return ; + case "wav": + return ; + case "mp4": + return ; + case "wmv": + return ; + case "mkv": + return ; default: - return ; + return ; } }; diff --git a/apps/app/components/icons/audio-file-icon.tsx b/apps/app/components/icons/audio-file-icon.tsx new file mode 100644 index 000000000..6aff5d7a4 --- /dev/null +++ b/apps/app/components/icons/audio-file-icon.tsx @@ -0,0 +1,9 @@ +import React from "react"; +import Image from "next/image"; + +import type { Props } from "./types"; +import AudioFileIcon from "public/attachment/audio-icon.png"; + +export const AudioIcon: React.FC = ({ width, height }) => ( + AudioFileIcon +); diff --git a/apps/app/components/icons/default-file-icon.tsx b/apps/app/components/icons/default-file-icon.tsx new file mode 100644 index 000000000..5323d8e07 --- /dev/null +++ b/apps/app/components/icons/default-file-icon.tsx @@ -0,0 +1,9 @@ +import React from "react"; +import Image from "next/image"; + +import type { Props } from "./types"; +import DefaultFileIcon from "public/attachment/default-icon.png"; + +export const DefaultIcon: React.FC = ({ width, height }) => ( + DefaultFileIcon +); diff --git a/apps/app/components/icons/index.ts b/apps/app/components/icons/index.ts index cd83cb5c6..0c2f045b6 100644 --- a/apps/app/components/icons/index.ts +++ b/apps/app/components/icons/index.ts @@ -69,4 +69,7 @@ export * from "./img-file-icon"; export * from "./png-file-icon"; export * from "./jpg-file-icon"; export * from "./svg-file-icon"; -export * from "./txt-file-icon"; \ No newline at end of file +export * from "./txt-file-icon"; +export * from "./default-file-icon"; +export * from "./video-file-icon"; +export * from "./audio-file-icon"; \ No newline at end of file diff --git a/apps/app/components/icons/video-file-icon.tsx b/apps/app/components/icons/video-file-icon.tsx new file mode 100644 index 000000000..8deb7a80b --- /dev/null +++ b/apps/app/components/icons/video-file-icon.tsx @@ -0,0 +1,9 @@ +import React from "react"; +import Image from "next/image"; + +import type { Props } from "./types"; +import VideoFileIcon from "public/attachment/video-icon.png"; + +export const VideoIcon: React.FC = ({ width, height }) => ( + VideoFileIcon +); diff --git a/apps/app/components/issues/attachment-upload.tsx b/apps/app/components/issues/attachment-upload.tsx index 487981f7e..a9fb0e137 100644 --- a/apps/app/components/issues/attachment-upload.tsx +++ b/apps/app/components/issues/attachment-upload.tsx @@ -26,7 +26,6 @@ export const IssueAttachmentUpload = () => { const { setToastAlert } = useToast(); const onDrop = useCallback((acceptedFiles: File[]) => { - setIsLoading(true); if (!acceptedFiles[0] || !workspaceSlug) return; const formData = new FormData(); @@ -38,7 +37,7 @@ export const IssueAttachmentUpload = () => { size: acceptedFiles[0].size, }) ); - + setIsLoading(true); issuesService .uploadIssueAttachment( workspaceSlug as string, @@ -88,12 +87,13 @@ export const IssueAttachmentUpload = () => { {isDragActive ? (

Drop here...

+ ) : fileError ? ( +

{fileError}

) : isLoading ? (

Uploading....

) : (

Drag & Drop or Click to add new file

)} - {fileError &&

{fileError}

}
); diff --git a/apps/app/public/attachment/audio-icon.png b/apps/app/public/attachment/audio-icon.png new file mode 100644 index 000000000..a3e551ea7 Binary files /dev/null and b/apps/app/public/attachment/audio-icon.png differ diff --git a/apps/app/public/attachment/default-icon.png b/apps/app/public/attachment/default-icon.png new file mode 100644 index 000000000..eb1ea5175 Binary files /dev/null and b/apps/app/public/attachment/default-icon.png differ diff --git a/apps/app/public/attachment/video-icon.png b/apps/app/public/attachment/video-icon.png new file mode 100644 index 000000000..510838d91 Binary files /dev/null and b/apps/app/public/attachment/video-icon.png differ