From 52a69a1e37d0980fef7aeb13625e95d717806a41 Mon Sep 17 00:00:00 2001 From: EnzoVezzaro Date: Mon, 17 Oct 2022 09:41:39 -0400 Subject: [PATCH] refactor default values (files / links) edit form --- .../FormFields/FilesInput/Info.module.css | 1 + .../@shared/FormFields/FilesInput/Info.tsx | 8 ++-- .../@shared/FormFields/FilesInput/index.tsx | 37 +++---------------- .../Asset/Edit/FormEditMetadata.tsx | 37 +++++++++++++++++-- 4 files changed, 44 insertions(+), 39 deletions(-) diff --git a/src/components/@shared/FormFields/FilesInput/Info.module.css b/src/components/@shared/FormFields/FilesInput/Info.module.css index 990e0ceed..c8687873d 100644 --- a/src/components/@shared/FormFields/FilesInput/Info.module.css +++ b/src/components/@shared/FormFields/FilesInput/Info.module.css @@ -33,6 +33,7 @@ .hideUrl { filter: blur(0.2rem); + user-select: none; } .warning { diff --git a/src/components/@shared/FormFields/FilesInput/Info.tsx b/src/components/@shared/FormFields/FilesInput/Info.tsx index d156ff3b1..6f73d9b90 100644 --- a/src/components/@shared/FormFields/FilesInput/Info.tsx +++ b/src/components/@shared/FormFields/FilesInput/Info.tsx @@ -6,21 +6,21 @@ import { FileInfo as FileInfoData } from '@oceanprotocol/lib' export default function FileInfo({ file, - handleClose, - hideUrl + handleClose }: { file: FileInfoData handleClose(): void - hideUrl?: boolean }): ReactElement { const contentTypeCleaned = file.contentType ? cleanupContentType(file.contentType) : null + const hideUrl = file.type === 'hidden' || false + return (

- {file.url} + {hideUrl ? 'https://oceanprotocol/placeholder' : file.url}