diff --git a/packages/@dcl/inspector/src/components/AssetPreview/AssetPreview.css b/packages/@dcl/inspector/src/components/AssetPreview/AssetPreview.css index 5d5d285fe..edd0d7ad3 100644 --- a/packages/@dcl/inspector/src/components/AssetPreview/AssetPreview.css +++ b/packages/@dcl/inspector/src/components/AssetPreview/AssetPreview.css @@ -3,3 +3,7 @@ align-items: center; justify-content: center; } + +.AssetPreview canvas { + width: 100%; +} diff --git a/packages/@dcl/inspector/src/components/AssetPreview/AssetPreview.tsx b/packages/@dcl/inspector/src/components/AssetPreview/AssetPreview.tsx index d301c1d4e..fdca09d11 100644 --- a/packages/@dcl/inspector/src/components/AssetPreview/AssetPreview.tsx +++ b/packages/@dcl/inspector/src/components/AssetPreview/AssetPreview.tsx @@ -8,28 +8,72 @@ import { toWearableWithBlobs } from './utils' import { Props } from './types' import './AssetPreview.css' +import { useRef } from 'react' -export function AssetPreview({ value, onScreenshot }: Props) { - const onLoad = React.useCallback(() => { - const wp = WearablePreview.createController(value.name) - void wp.scene.getScreenshot(1024, 1024).then(($) => onScreenshot($)) - }, []) +const WIDTH = 300 +const HEIGHT = 300 +export function AssetPreview({ value, onScreenshot }: Props) { return (