add mkv filetype and use switch
This commit is contained in:
parent
2e55399f53
commit
c61fb12463
1
src/assets/fileTypes/mkv.svg
Normal file
1
src/assets/fileTypes/mkv.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg version="1.1" id="prefix__Layer_1" xmlns="http://www.w3.org/2000/svg" x="0" y="0" viewBox="0 0 56 56" xml:space="preserve"><style>.prefix__st2{fill:#c8bdb8}.prefix__st4{fill:#fff}</style><path d="M36.985 0H7.963C7.155 0 6.5.655 6.5 1.926V55c0 .345.655 1 1.463 1h40.074c.808 0 1.463-.655 1.463-1V12.978c0-.696-.093-.92-.257-1.085L37.607.257A.884.884 0 0036.985 0z" fill="#e9e9e0"/><path d="M48.037 56H7.963A1.463 1.463 0 016.5 54.537V39h43v15.537c0 .808-.655 1.463-1.463 1.463z" fill="#ef4048"/><path class="prefix__st2" d="M24.5 28a1 1 0 01-1-1V13a1.001 1.001 0 011.538-.844l11 7a1.003 1.003 0 01-.001 1.688l-11 7c-.163.103-.35.156-.537.156zm1-13.179v10.357L33.637 20 25.5 14.821z"/><path class="prefix__st2" d="M28.5 35c-8.271 0-15-6.729-15-15s6.729-15 15-15 15 6.729 15 15-6.729 15-15 15zm0-28c-7.168 0-13 5.832-13 13s5.832 13 13 13 13-5.832 13-13-5.832-13-13-13z"/><path fill="#d9d7ca" d="M37.5.151V12h11.849z"/><g><path class="prefix__st4" d="M21.396 42.818h1.482V53h-1.544v-7.625l.078.447-2.778 5.764h-1.102l-2.778-5.623.078-.588V53h-1.544V42.818h1.482l3.313 6.723 3.313-6.723zM25.672 42.818h1.583V53h-1.583V42.818zm1.242 5.714l4.983-5.714h1.947l-7.163 7.856.233-2.142zm1.877-.966l1.25-1.044L34.316 53h-1.939l-3.586-5.434zM35.016 42.818h1.724l2.708 7.983 2.708-7.983h1.724L40.2 53h-1.506l-3.678-10.182z"/></g></svg>
|
After Width: | Height: | Size: 1.3 KiB |
@ -20,6 +20,7 @@ import JPG from '../assets/fileTypes/jpg.svg'
|
|||||||
import JS from '../assets/fileTypes/js.svg'
|
import JS from '../assets/fileTypes/js.svg'
|
||||||
import json from '../assets/fileTypes/json.svg'
|
import json from '../assets/fileTypes/json.svg'
|
||||||
import MP3 from '../assets/fileTypes/mp3.svg'
|
import MP3 from '../assets/fileTypes/mp3.svg'
|
||||||
|
import MKV from '../assets/fileTypes/mkv.svg'
|
||||||
import MP4 from '../assets/fileTypes/mp4.svg'
|
import MP4 from '../assets/fileTypes/mp4.svg'
|
||||||
import PDF from '../assets/fileTypes/pdf.svg'
|
import PDF from '../assets/fileTypes/pdf.svg'
|
||||||
import PNG from '../assets/fileTypes/png.svg'
|
import PNG from '../assets/fileTypes/png.svg'
|
||||||
@ -267,32 +268,35 @@ class FileBrowser extends Component {
|
|||||||
if (type === "inode/directory") return <img src={Folder} alt="folder" width="20px" height="20px" />
|
if (type === "inode/directory") return <img src={Folder} alt="folder" width="20px" height="20px" />
|
||||||
|
|
||||||
const ext = path.extname(filename).toLowerCase().substring(1)
|
const ext = path.extname(filename).toLowerCase().substring(1)
|
||||||
if (ext === "aac") return <img src={AAC} alt="aac" width="20px" height="20px" />
|
|
||||||
if (ext === "avi") return <img src={AVI} alt="avi" width="20px" height="20px" />
|
|
||||||
if (ext === "css") return <img src={CSS} alt="css" width="20px" height="20px" />
|
|
||||||
if (/^docx?$/.test(ext)) return <img src={DOC} alt="doc" width="20px" height="20px" />
|
|
||||||
if (ext === "exe") return <img src={EXE} alt="exe" width="20px" height="20px" />
|
|
||||||
if (ext === "flac") return <img src={FLAC} alt="flac" width="20px" height="20px" />
|
|
||||||
if (ext === "gif") return <img src={GIF} alt="gif" width="20px" height="20px" />
|
|
||||||
if (ext === "html") return <img src={HTML} alt="html" width="20px" height="20px" />
|
|
||||||
if (/^jpe?g$/.test(ext)) return <img src={JPG} alt="jpg" width="20px" height="20px" />
|
|
||||||
if (ext === "js") return <img src={JS} alt="js" width="20px" height="20px" />
|
|
||||||
if (ext === "json") return <img src={json} alt="json" width="20px" height="20px" />
|
|
||||||
if (ext === "mp3") return <img src={MP3} alt="mp3" width="20px" height="20px" />
|
|
||||||
if (ext === "mp4") return <img src={MP4} alt="mp4" width="20px" height="20px" />
|
|
||||||
if (ext === "pdf") return <img src={PDF} alt="pdf" width="20px" height="20px" />
|
|
||||||
if (ext === "png") return <img src={PNG} alt="png" width="20px" height="20px" />
|
|
||||||
if (ext === "rar") return <img src={RAR} alt="rar" width="20px" height="20px" />
|
|
||||||
if (ext === "7z") return <img src={Sevenzip} alt="7z" width="20px" height="20px" />
|
|
||||||
if (ext === "svg") return <img src={SVG} alt="svg" width="20px" height="20px" />
|
|
||||||
if (ext === "tiff") return <img src={TIFF} alt="tiff" width="20px" height="20px" />
|
|
||||||
if (ext === "txt") return <img src={TXT} alt="txt" width="20px" height="20px" />
|
|
||||||
if (ext === "wav") return <img src={WAV} alt="wav" width="20px" height="20px" />
|
|
||||||
if (ext === "wma") return <img src={WMA} alt="wma" width="20px" height="20px" />
|
|
||||||
if (ext === "xml") return <img src={XML} alt="xml" width="20px" height="20px" />
|
|
||||||
if (ext === "zip") return <img src={ZIP} alt="zip" width="20px" height="20px" />
|
|
||||||
|
|
||||||
return <img src={Other} alt="text" width="20px" height="20px" />
|
switch (ext) {
|
||||||
|
case "aac": return <img src={AAC} alt="aac" width="20px" height="20px" />;
|
||||||
|
case "avi": return <img src={AVI} alt="avi" width="20px" height="20px" />;
|
||||||
|
case "css": return <img src={CSS} alt="css" width="20px" height="20px" />;
|
||||||
|
case /^docx?$/.test(ext): return <img src={DOC} alt="doc" width="20px" height="20px" />;
|
||||||
|
case "exe": return <img src={EXE} alt="exe" width="20px" height="20px" />;
|
||||||
|
case "flac": return <img src={FLAC} alt="flac" width="20px" height="20px" />;
|
||||||
|
case "gif": return <img src={GIF} alt="gif" width="20px" height="20px" />;
|
||||||
|
case "html": return <img src={HTML} alt="html" width="20px" height="20px" />;
|
||||||
|
case /^jpe?g$/.test(ext): return <img src={JPG} alt="jpg" width="20px" height="20px" />;
|
||||||
|
case "js": return <img src={JS} alt="js" width="20px" height="20px" />;
|
||||||
|
case "json": return <img src={json} alt="json" width="20px" height="20px" />;
|
||||||
|
case "mp3": return <img src={MP3} alt="mp3" width="20px" height="20px" />;
|
||||||
|
case "mkv": return <img src={MKV} alt="mkv" width="20px" height="20px" />;
|
||||||
|
case "mp4": return <img src={MP4} alt="mp4" width="20px" height="20px" />;
|
||||||
|
case "pdf": return <img src={PDF} alt="pdf" width="20px" height="20px" />;
|
||||||
|
case "png": return <img src={PNG} alt="png" width="20px" height="20px" />;
|
||||||
|
case "rar": return <img src={RAR} alt="rar" width="20px" height="20px" />;
|
||||||
|
case "7z": return <img src={Sevenzip} alt="7z" width="20px" height="20px" />;
|
||||||
|
case "svg": return <img src={SVG} alt="svg" width="20px" height="20px" />;
|
||||||
|
case "tiff": return <img src={TIFF} alt="tiff" width="20px" height="20px" />;
|
||||||
|
case "txt": return <img src={TXT} alt="txt" width="20px" height="20px" />;
|
||||||
|
case "wav": return <img src={WAV} alt="wav" width="20px" height="20px" />;
|
||||||
|
case "wma": return <img src={WMA} alt="wma" width="20px" height="20px" />;
|
||||||
|
case "xml": return <img src={XML} alt="xml" width="20px" height="20px" />;
|
||||||
|
case "zip": return <img src={ZIP} alt="zip" width="20px" height="20px" />;
|
||||||
|
default: return <img src={Other} alt="text" width="20px" height="20px" />;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// after the user clicks on a folder
|
// after the user clicks on a folder
|
||||||
|
Loading…
x
Reference in New Issue
Block a user