File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
react/MuiCozyTheme/ListItem/ListItemFile Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,10 @@ import PropTypes from 'prop-types'
44import { useClient } from 'cozy-client'
55
66import Icon from '../../../Icon'
7- import FileImageLoader from '../../../FileImageLoader'
8- import CardMedia from '../../../CardMedia'
97import FiletypeTextIcon from '../../../Icons/FileTypeText'
8+ import FileImageLoader from '../../../FileImageLoader'
9+ import Thumbnail from '../../../Thumbnail'
10+ import Skeleton from '../../../Skeleton'
1011
1112const ItemIcon = ( { icon, file } ) => {
1213 const client = useClient ( )
@@ -19,9 +20,21 @@ const ItemIcon = ({ icon, file }) => {
1920 file = { file }
2021 linkType = "tiny"
2122 render = { src => {
22- return < CardMedia component = "img" width = { 32 } height = { 32 } image = { src } />
23+ return (
24+ < Thumbnail >
25+ { src ? (
26+ < img src = { src } alt = "" />
27+ ) : (
28+ < Skeleton variant = "rect" animation = "wave" />
29+ ) }
30+ </ Thumbnail >
31+ )
2332 } }
24- renderFallback = { ( ) => < Icon icon = { FiletypeTextIcon } size = { 32 } /> }
33+ renderFallback = { ( ) => (
34+ < Thumbnail >
35+ < Icon icon = { FiletypeTextIcon } />
36+ </ Thumbnail >
37+ ) }
2538 />
2639 )
2740}
You can’t perform that action at this time.
0 commit comments