Disable species picker for species-specific items

This commit is contained in:
Emi Matchu 2021-02-02 16:45:28 -08:00
parent 6c84baca03
commit f699d867e5
2 changed files with 10 additions and 1 deletions

View file

@ -690,6 +690,7 @@ function ItemPageOutfitPreview({ itemId }) {
appearanceId: null,
});
}}
speciesIsDisabled={isProbablySpeciesSpecific}
size="sm"
showPlaceholders
// This is just a UX affordance: while we could handle invalid states

View file

@ -25,6 +25,7 @@ function SpeciesColorPicker({
speciesPlaceholderText = "",
stateMustAlwaysBeValid = false,
isDisabled = false,
speciesIsDisabled = false,
size = "md",
onChange,
}) {
@ -217,7 +218,14 @@ function SpeciesColorPicker({
// We also wait for the valid pairs before enabling, so users can't
// trigger change events we're not ready for.
isLoading={allSpecies.length === 0 || loadingValids}
isDisabled={isDisabled}
isDisabled={isDisabled || speciesIsDisabled}
// Don't fade out in the speciesIsDisabled case; it's more like a
// read-only state.
_disabled={
speciesIsDisabled
? { opacity: "1", cursor: "not-allowed" }
: undefined
}
onChange={onChangeSpecies}
size={size}
valids={valids}