diff --git a/src/features/Resources/Modals/PreviewResource.tsx b/src/features/Resources/Modals/PreviewResource.tsx index fbdf711..3b4860b 100755 --- a/src/features/Resources/Modals/PreviewResource.tsx +++ b/src/features/Resources/Modals/PreviewResource.tsx @@ -61,8 +61,7 @@ export default function PreviewResource( { resData, cdn } ) { const setImgPreview = () => { let previewUrl = resourceData?.previews?.[0]?.dam_url || resourceData?.previews?.[0] || resourceData?.files?.[0]?.dam_url || 'noimg.png'; if(!previewUrl.includes('@@@dam:@image')) previewUrl = 'noimg.png' - const previewSize = previewUrl === 'noimg.png' ? '' : '/medium'; - setPreview(MainService().render(previewUrl + previewSize)); + setPreview(MainService().render(previewUrl)); if (previewUrl === 'noimg.png') { setPreview(window.location.protocol + "//" + window.location.host+"/noimg.png"); } diff --git a/src/features/Resources/Modals/ViewResource.tsx b/src/features/Resources/Modals/ViewResource.tsx index 566a834..d236e13 100755 --- a/src/features/Resources/Modals/ViewResource.tsx +++ b/src/features/Resources/Modals/ViewResource.tsx @@ -19,15 +19,18 @@ import { selectWorkspacesData } from '../../../appSlice'; const useStyles = makeStyles((theme: Theme) => createStyles({ imgView: { - height: '400px', - display: 'block', - backgroundRepeat: 'no-repeat', - backgroundPosition: 'top', - backgroundSize: 'cover', - border: '1px solid #e1e1e1', - borderRadius: 5, - marginBottom: 15 - }, + height: '400px', + width: '100%', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + backgroundRepeat: 'no-repeat', + backgroundPosition: 'center', + backgroundSize: 'contain', + border: '1px solid #e1e1e1', + borderRadius: 5, + marginBottom: 15, + }, mediaPlayer: { width: '100%' }, @@ -75,8 +78,8 @@ export default function ViewResource( { resData } ) { - let preview = render(resData, 'medium') - + let preview = render(resData, '') + let previewVideo = render(resData,"") const closeModal = () => { let element: HTMLElement = document.getElementsByClassName('MuiBackdrop-root')[0] as HTMLElement; element.click(); @@ -164,7 +167,12 @@ export default function ViewResource( { resData } ) { {resourceData !== null && ( <> -
+ {resourceData.type === 'image' && ( +
+ )} + {resourceData.type === 'video' && ( + + )}