From 2e59e6cfff804bc3d8635790d8236a3e2a14fb29 Mon Sep 17 00:00:00 2001 From: Orka Arnest CRUZE Date: Fri, 25 Oct 2024 17:05:38 +0200 Subject: [PATCH] feat: toujours afficher le bouton ajout vignette quand il n'y en a pas encore #525 --- .../pages/datasheet/DatasheetView/DatasheetThumbnail.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/entrepot/pages/datasheet/DatasheetView/DatasheetThumbnail.tsx b/assets/entrepot/pages/datasheet/DatasheetView/DatasheetThumbnail.tsx index a5403570..8e3b3fc1 100644 --- a/assets/entrepot/pages/datasheet/DatasheetView/DatasheetThumbnail.tsx +++ b/assets/entrepot/pages/datasheet/DatasheetView/DatasheetThumbnail.tsx @@ -2,6 +2,7 @@ import { fr } from "@codegouvfr/react-dsfr"; import Alert from "@codegouvfr/react-dsfr/Alert"; import Button from "@codegouvfr/react-dsfr/Button"; import { createModal, ModalProps } from "@codegouvfr/react-dsfr/Modal"; +import { cx } from "@codegouvfr/react-dsfr/tools/cx"; import { Upload } from "@codegouvfr/react-dsfr/Upload"; import { yupResolver } from "@hookform/resolvers/yup"; import { useMutation, useQueryClient } from "@tanstack/react-query"; @@ -23,7 +24,6 @@ import api from "../../../api"; import "../../../../sass/components/buttons.scss"; -import { cx } from "@codegouvfr/react-dsfr/tools/cx"; import placeholder1x1 from "../../../../img/placeholder.1x1.png"; const addThumbnailModal = createModal({ @@ -209,7 +209,7 @@ const DatasheetThumbnail: FC = ({ datastoreId, datashee loading="lazy" src={datasheet?.thumbnail?.url === undefined ? placeholder1x1 : datasheet?.thumbnail?.url} /> - {thumbnailIsHovered && ( + {(datasheet?.thumbnail?._id === undefined || thumbnailIsHovered) && (