mirror of
https://github.com/strapi/strapi.git
synced 2025-09-22 06:50:51 +00:00
style
This commit is contained in:
parent
d2fc652c17
commit
f32197d983
@ -67,6 +67,7 @@ const MediaPreviewFile = styled(MediaPreviewItem)`
|
||||
span {
|
||||
display: block;
|
||||
padding: 0 3px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
i {
|
||||
position: absolute;
|
||||
|
@ -17,7 +17,12 @@ function MediaPreviewList({ hoverable, files }) {
|
||||
const getFileType = fileName => fileName.split('.').slice(-1)[0];
|
||||
|
||||
const renderImage = image => {
|
||||
const { name, url } = image;
|
||||
const { name, size, url } = image;
|
||||
|
||||
// TODO !! - Specific UI for size > 200MB
|
||||
if (size > 200) {
|
||||
return renderFile(image);
|
||||
}
|
||||
|
||||
return (
|
||||
<MediaPreviewImage className={hoverable ? 'hoverable' : ''}>
|
||||
@ -30,13 +35,13 @@ function MediaPreviewList({ hoverable, files }) {
|
||||
};
|
||||
|
||||
const renderFile = file => {
|
||||
const { ext, name } = file;
|
||||
const { name } = file;
|
||||
const fileType = getFileType(name);
|
||||
|
||||
return (
|
||||
<MediaPreviewFile className={hoverable ? 'hoverable' : ''}>
|
||||
<div>
|
||||
<span>{ext}</span>
|
||||
<span>{fileType}</span>
|
||||
<i className={`fa fa-file-${fileType}-o`} />
|
||||
</div>
|
||||
<span>{name}</span>
|
||||
@ -88,7 +93,7 @@ function MediaPreviewList({ hoverable, files }) {
|
||||
}
|
||||
|
||||
MediaPreviewList.default = {
|
||||
hoverable: false,
|
||||
hoverable: true,
|
||||
files: null,
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user