From 41cca42fda90013f923af3e86d8d00259f97a472 Mon Sep 17 00:00:00 2001 From: Anthony Geourjon <anthony.geourjon@tetras-libre.fr> Date: Wed, 8 Mar 2023 18:42:03 +0100 Subject: [PATCH] Thumbnail dumb working --- src/components/AnnotationManifestsItem.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/components/AnnotationManifestsItem.js b/src/components/AnnotationManifestsItem.js index ff7db0289..501fa3187 100644 --- a/src/components/AnnotationManifestsItem.js +++ b/src/components/AnnotationManifestsItem.js @@ -18,11 +18,15 @@ export class AnnotationManifestsItem extends Component { super(props); this.handleOpenManifestSideToSide = this.handleOpenManifestSideToSide.bind(this); - /* const { + } + + /** */ + componentDidMount() { + const { fetchManifest, manifestId, ready, isFetching, error, provider, - } = props; + } = this.props; - if (!ready && !error && !isFetching && provider !== 'file') fetchManifest(manifestId); */ + if (!ready && !error && !isFetching && provider !== 'file') fetchManifest(manifestId); } /** */ @@ -35,13 +39,22 @@ export class AnnotationManifestsItem extends Component { /** */ render() { const { - classes, t, language, manifestId, + classes, t, language, manifestId, thumbnail } = this.props; return ( <Typography> <Card className={classes.root}> <CardActionArea> + { + thumbnail && ( + <CardMedia + component="img" + height="140" + image={[thumbnail]} + alt="green iguana" + /> + )} <CardContent> <Typography> { manifestId } -- GitLab