Skip to content

Commit 34f31af

Browse files
committed
fix comments
1 parent 7745fb4 commit 34f31af

File tree

8 files changed

+30
-17
lines changed

8 files changed

+30
-17
lines changed

packages/@dcl/inspector/src/components/AssetPreview/AssetPreview.css

-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,3 @@
1111
.AssetPreview .GltfPreview.hidden {
1212
visibility: hidden;
1313
}
14-
15-
.AssetPreview > .loading {
16-
position: absolute;
17-
}

packages/@dcl/inspector/src/components/AssetPreview/AssetPreview.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { AiFillSound } from 'react-icons/ai'
66
import { IoVideocamOutline } from 'react-icons/io5'
77
import { FaFile } from 'react-icons/fa'
88

9-
import { Loading } from '../Loading'
109
import { toWearableWithBlobs } from './utils'
1110
import { Props } from './types'
1211

@@ -61,13 +60,12 @@ function GltfPreview({ value, resources, onScreenshot, onLoad }: Props) {
6160
id={value.name}
6261
blob={toWearableWithBlobs(value, resources)}
6362
disableAutoRotate
64-
background="#3c3c3c"
63+
disableBackground
6564
projection={PreviewProjection.ORTHOGRAPHIC}
6665
camera={PreviewCamera.STATIC}
6766
onLoad={handleLoad}
6867
/>
6968
</div>
70-
{loading && <Loading dimmer={false} />}
7169
</>
7270
)
7371
}

packages/@dcl/inspector/src/components/Assets/Assets.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
padding-left: 8px;
1818
display: flex;
1919
background: var(--tree-bg-color);
20-
height: 60px;
20+
padding: 5px 0;
2121
position: relative;
2222
align-items: center;
2323
justify-content: center;

packages/@dcl/inspector/src/components/CreateCustomAsset/CreateCustomAsset.css

+7
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,15 @@
3232
}
3333

3434
.CreateCustomAsset .preview-container .AssetPreview {
35+
display: none;
36+
}
37+
38+
.CreateCustomAsset .preview-container .thumbnail {
3539
width: 100%;
3640
height: 100%;
41+
background-color: var(--background-gray);
42+
background-size: cover;
43+
background-position: center;
3744
}
3845

3946
.CreateCustomAsset .loader-container {

packages/@dcl/inspector/src/components/CreateCustomAsset/CreateCustomAsset.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ const CreateCustomAsset: React.FC = () => {
112112
<div className="file-container">
113113
{previewFile && resources !== null ? (
114114
<div className="preview-container">
115-
{isGeneratingThumbnail && (
115+
{isGeneratingThumbnail && !thumbnail ? (
116116
<div className="loader-container">
117117
<Loader active size="small" />
118118
</div>
119-
)}
119+
) : <div className="thumbnail" style={{ backgroundImage: `url(${thumbnail})` }}></div>}
120120
<AssetPreview value={previewFile} resources={resources} onScreenshot={handleScreenshot} />
121121
</div>
122122
) : (

packages/@dcl/inspector/src/components/ImportAsset/ImportAsset.css

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.ImportAssetModalOverlay {
2+
z-index: 2;
3+
}
4+
15
.ImportAsset {
26
height: 100%;
37
}

packages/@dcl/inspector/src/components/ImportAsset/Slider/Slider.css

+13-7
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,26 @@
3838
.Slider .asset > div {
3939
display: flex;
4040
flex-direction: column;
41-
margin: 10px 10px 5px 10px;
41+
margin: 10px;
4242
width: 150px;
4343
}
4444

45-
.Slider .asset > div .AssetPreview {
45+
.Slider .asset .loading {
46+
position: relative;
47+
}
48+
49+
.Slider .asset .AssetPreview {
50+
display: none;
51+
}
52+
53+
.Slider .asset .thumbnail,
54+
.Slider .asset .loading {
4655
margin-bottom: 12px;
4756
width: 150px;
4857
height: 150px;
4958
background-color: var(--background-gray);
50-
}
51-
52-
.Slider .asset > div .AssetPreview > svg {
53-
width: 60%;
54-
height: 60%;
59+
background-size: cover;
60+
background-position: center;
5561
}
5662

5763
.Slider .asset .name-error {

packages/@dcl/inspector/src/components/ImportAsset/Slider/Slider.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import cx from 'classnames'
55
import { AssetPreview } from '../../AssetPreview'
66
import { Button } from '../../Button'
77
import { Input } from '../../Input'
8+
import { Loading } from '../../Loading'
89

910
import { getAssetSize, getAssetResources, determineAssetType, formatFileName } from '../utils'
1011

@@ -110,6 +111,7 @@ export function Slider({ assets, onSubmit, isNameValid }: PropTypes) {
110111
<div className={cx('asset', { active: slide === i })} key={i}>
111112
<div>
112113
<AssetPreview value={$.blob} resources={getAssetResources($)} onScreenshot={handleScreenshot($)} />
114+
{screenshots[$.blob.name] ? <div className="thumbnail" style={{ backgroundImage: `url(${screenshots[$.blob.name]})` }}></div> : <Loading dimmer={false} />}
113115
<Input value={$.name} onChange={handleNameChange(i)} />
114116
{!isNameUnique($) && <span className="name-error">Filename already exists</span>}
115117
</div>

0 commit comments

Comments
 (0)