mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
removed upload redux store
This commit is contained in:
parent
140e36b6b7
commit
95b92b643f
38 changed files with 398 additions and 691 deletions
51
src/constants/uploads/index.ts
Normal file
51
src/constants/uploads/index.ts
Normal file
|
@ -0,0 +1,51 @@
|
|||
import { IFile } from '~/redux/types';
|
||||
|
||||
export const EMPTY_FILE: IFile = {
|
||||
id: undefined,
|
||||
user_id: undefined,
|
||||
node_id: undefined,
|
||||
|
||||
name: '',
|
||||
orig_name: '',
|
||||
path: '',
|
||||
full_path: '',
|
||||
url: '',
|
||||
size: 0,
|
||||
type: undefined,
|
||||
mime: '',
|
||||
};
|
||||
|
||||
// for targeted cancellation
|
||||
export enum UploadSubject {
|
||||
Editor = 'editor',
|
||||
Comment = 'comment',
|
||||
Avatar = 'avatar',
|
||||
}
|
||||
|
||||
export enum UploadTarget {
|
||||
Nodes = 'nodes',
|
||||
Comments = 'comments',
|
||||
Profiles = 'profiles',
|
||||
Others = 'other',
|
||||
}
|
||||
|
||||
export enum UploadType {
|
||||
Image = 'image',
|
||||
Audio = 'audio',
|
||||
Video = 'video',
|
||||
Other = 'other',
|
||||
}
|
||||
|
||||
export const FILE_MIMES: Record<UploadType, string[]> = {
|
||||
[UploadType.Video]: [],
|
||||
[UploadType.Image]: ['image/jpeg', 'image/jpg', 'image/png'],
|
||||
[UploadType.Audio]: ['audio/mpeg3', 'audio/mpeg', 'audio/mp3'],
|
||||
[UploadType.Other]: [],
|
||||
};
|
||||
|
||||
export const COMMENT_FILE_TYPES = [
|
||||
...FILE_MIMES[UploadType.Image],
|
||||
...FILE_MIMES[UploadType.Audio],
|
||||
];
|
||||
|
||||
export const IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/jpg'];
|
Loading…
Add table
Add a link
Reference in a new issue