From b6274193d59fae272f5c8d3d38117a99d85858b7 Mon Sep 17 00:00:00 2001 From: Matchu Date: Wed, 28 Apr 2021 16:16:15 -0700 Subject: [PATCH] Hide outfit thumbnail in wardrobe after loading Oops, it was possible after saving an outfit to get into a state where we would show the `` behind the outfit even after it was saved, and then removing items would look weird until auto-saving caught up. We had used the `backdrop` property because we wanted smoother partial load-ins, but for now I'm just fixing this by switching it to `placeholder`, which already has the right loading-only behavior. This was also the only call site for `backdrop`, so I've removed it! --- .../WardrobePage/WardrobePreviewAndControls.js | 7 +------ src/app/components/OutfitPreview.js | 15 --------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/app/WardrobePage/WardrobePreviewAndControls.js b/src/app/WardrobePage/WardrobePreviewAndControls.js index 9f6f7f0..a304dba 100644 --- a/src/app/WardrobePage/WardrobePreviewAndControls.js +++ b/src/app/WardrobePage/WardrobePreviewAndControls.js @@ -29,7 +29,7 @@ function WardrobePreviewAndControls({ appearanceId: outfitState.appearanceId, wornItemIds: outfitState.wornItemIds, onChangeHasAnimations: setHasAnimations, - backdrop: , + placeholder: , "data-test-id": "wardrobe-outfit-preview", }); @@ -59,11 +59,6 @@ function WardrobePreviewAndControls({ * outfit thumbnail instantly while everything else loads. But on direct * navigation, this does nothing, and we just wait for the preview to load in * like usual! - * - * We even use it as our "backdrop", so the thumbnail actually _always_ renders - * if possible. This makes loading look even smoother, by letting individual - * layers load in on top of the thumbnail. - * TODO: Can this become a perf problem on WIP outfits? */ function OutfitThumbnailIfCached({ outfitId }) { const { data } = useQuery( diff --git a/src/app/components/OutfitPreview.js b/src/app/components/OutfitPreview.js index b43834d..b05ba78 100644 --- a/src/app/components/OutfitPreview.js +++ b/src/app/components/OutfitPreview.js @@ -49,7 +49,6 @@ export function useOutfitPreview({ appearanceId = null, isLoading = false, placeholder = null, - backdrop = null, loadingDelayMs, spinnerVariant, onChangeHasAnimations = null, @@ -98,7 +97,6 @@ export function useOutfitPreview({ loading={isLoading || loading || loading2} visibleLayers={loadedLayers} placeholder={placeholder} - backdrop={backdrop} loadingDelayMs={loadingDelayMs} spinnerVariant={spinnerVariant} onChangeHasAnimations={onChangeHasAnimations} @@ -120,7 +118,6 @@ export function OutfitLayers({ loading, visibleLayers, placeholder = null, - backdrop = null, loadingDelayMs = 500, spinnerVariant = "overlay", doTransitions = false, @@ -185,18 +182,6 @@ export function OutfitLayers({ data-loading={loading ? true : undefined} {...props} > - {backdrop && ( - - - {backdrop} - - - )} {placeholder && (