diff --git a/src/app/WardrobePage/support/ItemLayerSupportModal.js b/src/app/WardrobePage/support/AppearanceLayerSupportModal.js similarity index 89% rename from src/app/WardrobePage/support/ItemLayerSupportModal.js rename to src/app/WardrobePage/support/AppearanceLayerSupportModal.js index 363bc45..00bcca9 100644 --- a/src/app/WardrobePage/support/ItemLayerSupportModal.js +++ b/src/app/WardrobePage/support/AppearanceLayerSupportModal.js @@ -27,7 +27,7 @@ import { } from "@chakra-ui/react"; import { ChevronRightIcon, ExternalLinkIcon } from "@chakra-ui/icons"; -import ItemLayerSupportUploadModal from "./ItemLayerSupportUploadModal"; +import AppearanceLayerSupportUploadModal from "./AppearanceLayerSupportUploadModal"; import Metadata, { MetadataLabel, MetadataValue } from "./Metadata"; import { OutfitLayers } from "../../components/OutfitPreview"; import SpeciesColorPicker from "../../components/SpeciesColorPicker"; @@ -37,19 +37,19 @@ import useOutfitAppearance, { import useSupport from "./useSupport"; /** - * ItemLayerSupportModal offers Support info and tools for a specific item + * AppearanceLayerSupportModal offers Support info and tools for a specific item * appearance layer. Open it by clicking a layer from ItemSupportDrawer. */ -function ItemLayerSupportModal({ +function AppearanceLayerSupportModal({ item, - itemLayer, + layer, outfitState, // speciesId, colorId, pose isOpen, onClose, }) { - const [selectedBodyId, setSelectedBodyId] = React.useState(itemLayer.bodyId); + const [selectedBodyId, setSelectedBodyId] = React.useState(layer.bodyId); const [selectedKnownGlitches, setSelectedKnownGlitches] = React.useState( - itemLayer.knownGlitches + layer.knownGlitches ); const [previewBiology, setPreviewBiology] = React.useState({ @@ -121,7 +121,7 @@ function ItemLayerSupportModal({ `, { variables: { - layerId: itemLayer.id, + layerId: layer.id, bodyId: selectedBodyId, knownGlitches: selectedKnownGlitches, supportSecret, @@ -134,7 +134,7 @@ function ItemLayerSupportModal({ onClose(); toast({ status: "success", - title: `Saved layer ${itemLayer.id}: ${item.name}`, + title: `Saved layer ${layer.id}: ${item.name}`, }); }, } @@ -145,7 +145,7 @@ function ItemLayerSupportModal({ // the GraphQL request for non-Support users. We could also just try // loading them, but, ehhh… const [newManifestUrl, oldManifestUrl] = convertSwfUrlToPossibleManifestUrls( - itemLayer.swfUrl + layer.swfUrl ); return ( @@ -153,18 +153,18 @@ function ItemLayerSupportModal({ - Layer {itemLayer.id}: {item.name} + Layer {layer.id}: {item.name} DTI ID: - {itemLayer.id} + {layer.id} Neopets ID: - {itemLayer.remoteId} + {layer.remoteId} Zone: - {itemLayer.zone.label} ({itemLayer.zone.id}) + {layer.zone.label} ({layer.zone.id}) Assets: @@ -189,12 +189,12 @@ function ItemLayerSupportModal({ - {itemLayer.canvasMovieLibraryUrl ? ( + {layer.canvasMovieLibraryUrl ? ( )} - {itemLayer.svgUrl ? ( + {layer.svgUrl ? ( )} - {itemLayer.imageUrl ? ( + {layer.imageUrl ? ( - setUploadModalIsOpen(false)} /> @@ -261,9 +261,9 @@ function ItemLayerSupportModal({ - - - @@ -310,9 +310,9 @@ function ItemLayerSupportModal({ ); } -function ItemLayerSupportPetCompatibilityFields({ +function AppearanceLayerSupportPetCompatibilityFields({ item, - itemLayer, + layer, outfitState, selectedBodyId, previewBiology, @@ -386,7 +386,7 @@ function ItemLayerSupportPetCompatibilityFields({ > - Remove Layer {itemLayer.id} ({itemLayer.zone.label}) from{" "} - {item.name}? + Remove Layer {layer.id} ({layer.zone.label}) from {item.name}? - This will permanently-ish remove Layer {itemLayer.id} ( - {itemLayer.zone.label}) from this item. + This will permanently-ish remove Layer {layer.id} ( + {layer.zone.label}) from this item. If you remove a correct layer by mistake, re-modeling should fix @@ -563,8 +562,7 @@ function ItemLayerSupportModalRemoveButton({ before proceeding! - Are you sure you want to remove Layer {itemLayer.id} from this - item? + Are you sure you want to remove Layer {layer.id} from this item? @@ -625,4 +623,4 @@ function convertSwfUrlToPossibleManifestUrls(swfUrl) { ]; } -export default ItemLayerSupportModal; +export default AppearanceLayerSupportModal; diff --git a/src/app/WardrobePage/support/ItemLayerSupportUploadModal.js b/src/app/WardrobePage/support/AppearanceLayerSupportUploadModal.js similarity index 96% rename from src/app/WardrobePage/support/ItemLayerSupportUploadModal.js rename to src/app/WardrobePage/support/AppearanceLayerSupportUploadModal.js index 8609e16..80e1f88 100644 --- a/src/app/WardrobePage/support/ItemLayerSupportUploadModal.js +++ b/src/app/WardrobePage/support/AppearanceLayerSupportUploadModal.js @@ -19,11 +19,11 @@ import { safeImageUrl } from "../../util"; import useSupport from "./useSupport"; /** - * ItemLayerSupportUploadModal helps Support users create and upload PNGs for + * AppearanceLayerSupportUploadModal helps Support users create and upload PNGs for * broken appearance layers. Useful when the auto-converters are struggling, * e.g. the SWF uses a color filter our server-side Flash player can't support! */ -function ItemLayerSupportUploadModal({ item, itemLayer, isOpen, onClose }) { +function AppearanceLayerSupportUploadModal({ item, layer, isOpen, onClose }) { const [step, setStep] = React.useState(1); const [imageOnBlackUrl, setImageOnBlackUrl] = React.useState(null); const [imageOnWhiteUrl, setImageOnWhiteUrl] = React.useState(null); @@ -93,7 +93,7 @@ function ItemLayerSupportUploadModal({ item, itemLayer, isOpen, onClose }) { setIsUploading(true); setUploadError(null); try { - const res = await fetch(`/api/uploadLayerImage?layerId=${itemLayer.id}`, { + const res = await fetch(`/api/uploadLayerImage?layerId=${layer.id}`, { method: "POST", headers: { "DTI-Support-Secret": supportSecret, @@ -122,7 +122,7 @@ function ItemLayerSupportUploadModal({ item, itemLayer, isOpen, onClose }) { // update, but not these!) Ultimately the eviction is the only // reliable method I found :/ apolloClient.cache.evict({ - id: `AppearanceLayer:${itemLayer.id}`, + id: `AppearanceLayer:${layer.id}`, fieldName: "imageUrl", }); } catch (e) { @@ -132,7 +132,7 @@ function ItemLayerSupportUploadModal({ item, itemLayer, isOpen, onClose }) { }, [ imageWithAlphaBlob, supportSecret, - itemLayer.id, + layer.id, toast, onClose, apolloClient.cache, @@ -163,14 +163,14 @@ function ItemLayerSupportUploadModal({ item, itemLayer, isOpen, onClose }) { textAlign="center" > {(step === 1 || step === 2) && ( - )} {step === 3 && ( - @@ -250,15 +250,15 @@ function ItemLayerSupportScreenshotStep({ itemLayer, step, onUpload }) { Chrome help - ); } -function ItemLayerSupportReviewStep({ +function AppearanceLayerSupportReviewStep({ imageWithAlphaUrl, numWarnings, conflictMode, @@ -326,7 +326,7 @@ function ItemLayerSupportReviewStep({ ); } -function ItemLayerSupportFlashPlayer({ swfUrl, backgroundColor }) { +function AppearanceLayerSupportFlashPlayer({ swfUrl, backgroundColor }) { const [isVisible, setIsVisible] = React.useState(null); const regionRef = React.useRef(null); @@ -631,4 +631,4 @@ function computeSaturation(r, g, b) { return s; } -export default ItemLayerSupportUploadModal; +export default AppearanceLayerSupportUploadModal; diff --git a/src/app/WardrobePage/support/ItemSupportAppearanceLayer.js b/src/app/WardrobePage/support/ItemSupportAppearanceLayer.js index 1d4ddfc..9812223 100644 --- a/src/app/WardrobePage/support/ItemSupportAppearanceLayer.js +++ b/src/app/WardrobePage/support/ItemSupportAppearanceLayer.js @@ -2,7 +2,7 @@ import * as React from "react"; import { ClassNames } from "@emotion/react"; import { Box, useColorModeValue, useDisclosure } from "@chakra-ui/react"; import { EditIcon } from "@chakra-ui/icons"; -import ItemLayerSupportModal from "./ItemLayerSupportModal"; +import AppearanceLayerSupportModal from "./AppearanceLayerSupportModal"; import { OutfitLayers } from "../../components/OutfitPreview"; function ItemSupportAppearanceLayer({ @@ -83,9 +83,9 @@ function ItemSupportAppearanceLayer({ Neopets ID: {itemLayer.remoteId} DTI ID: {itemLayer.id} -