Skip to content

Commit

Permalink
Computes the usingFallback prop value to be used by ImageSelect compo…
Browse files Browse the repository at this point in the history
…nent
  • Loading branch information
pls78 committed Jan 15, 2025
1 parent caeb780 commit c3250c1
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ class SocialMetadataPreviewForm extends Component {
recommendedReplacementVariables,
imageWarnings,
imageUrl,
imageFallbackUrl,
imageAltText,
idSuffix,
} = this.props;
Expand All @@ -243,6 +244,7 @@ class SocialMetadataPreviewForm extends Component {
isActive={ activeField === "image" }
isHovered={ hoveredField === "image" }
imageUrl={ imageUrl }
usingFallback={ ! imageUrl && imageFallbackUrl !== "" }
imageAltText={ imageAltText }
hasPreview={ ! isPremium }
imageUrlInputId={ join( [ lowerCaseSocialMediumName, "url-input", idSuffix ] ) }
Expand Down Expand Up @@ -311,6 +313,7 @@ SocialMetadataPreviewForm.propTypes = {
recommendedReplacementVariables: PropTypes.arrayOf( PropTypes.string ),
imageWarnings: PropTypes.array,
imageUrl: PropTypes.string,
imageFallbackUrl: PropTypes.string,
imageAltText: PropTypes.string,
titleInputPlaceholder: PropTypes.string,
descriptionInputPlaceholder: PropTypes.string,
Expand All @@ -328,6 +331,7 @@ SocialMetadataPreviewForm.defaultProps = {
onSelect: () => {},
onReplacementVariableSearchChange: null,
imageUrl: "",
imageFallbackUrl: "",
imageAltText: "",
titleInputPlaceholder: "",
descriptionInputPlaceholder: "",
Expand Down

0 comments on commit c3250c1

Please sign in to comment.