mirror of
https://github.com/usememos/memos.git
synced 2025-02-15 19:00:46 +01:00
feat: add more resource cover icon (#1413)
* stash: file upload * feat: add style button * feat: add style of list * feat: add checkbox for list * feat: support file upload by drag * feat: beautify the ui * feat: support file upload * stash * fix: the resource is incorrectly when upload multiple files * feat: beautify the ui * chore: reduce unused line * stash * chore: deleted unused line * chore: deleted unused line * chore * chore: change the function declare * feat: support to prompt file is too large * feat:drop prompt to cover all element * fix: eslint * fix: the name of i18n * chore: refactor the import deps * feat: beautify the ui * feat: support the style of button * feat: beautify the switch ui * chore: refactor the component * chore: refactor the resource item dropdown * feat: use memo to reduce unused computing in drop * feat: use memo to reduce the calc of resource list * chore:change name * Update web/src/locales/en.json Co-authored-by: boojack <stevenlgtm@gmail.com> * chore: the import of deps * fix: the window size of fecting data * feat: support to save the state of style * remove pnpm-lock * merge main * chore: simpify the statement * fix: delete conflict marker * feat: add i18n for select * feat:support dark mode * eslint * feat: add more file icon * feat: delete the storage of resource style * Update web/src/components/ResourceCover.tsx Co-authored-by: boojack <stevenlgtm@gmail.com> --------- Co-authored-by: boojack <stevenlgtm@gmail.com>
This commit is contained in:
parent
17ca97ebd1
commit
adf01ed511
@ -19,10 +19,14 @@ const getResourceType = (resource: Resource) => {
|
||||
return "application/epub+zip";
|
||||
} else if (resource.type.startsWith("application/pdf")) {
|
||||
return "application/pdf";
|
||||
} else if (resource.type.startsWith("application/vnd.openxmlformats-officedocument.wordprocessingml.document")) {
|
||||
return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
||||
} else if (resource.type.startsWith("application/msword")) {
|
||||
} else if (resource.type.includes("word")) {
|
||||
return "application/msword";
|
||||
} else if (resource.type.includes("excel")) {
|
||||
return "application/msexcel";
|
||||
} else if (resource.type.startsWith("application/zip")) {
|
||||
return "application/zip";
|
||||
} else if (resource.type.startsWith("application/x-java-archive")) {
|
||||
return "application/x-java-archive";
|
||||
} else {
|
||||
return "application/octet-stream";
|
||||
}
|
||||
@ -43,10 +47,14 @@ const ResourceCover = ({ resource }: ResourceCoverProps) => {
|
||||
return <Icon.Book className="resource-cover" />;
|
||||
case "application/pdf":
|
||||
return <Icon.Book className="resource-cover" />;
|
||||
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
|
||||
return <Icon.FileEdit className="resource-cover" />;
|
||||
case "application/msword":
|
||||
return <Icon.FileEdit className="resource-cover" />;
|
||||
case "application/msexcel":
|
||||
return <Icon.SheetIcon className="resource-cover" />;
|
||||
case "application/zip":
|
||||
return <Icon.FileArchiveIcon className="resource-cover" />;
|
||||
case "application/x-java-archive":
|
||||
return <Icon.BinaryIcon className="resource-cover" />;
|
||||
default:
|
||||
return <Icon.File className="resource-cover" />;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user