Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover: Improve disabled media buttons check for placeholder #29858

Merged
merged 1 commit into from
Mar 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/block-library/src/cover/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ function mediaPosition( { x, y } ) {
}

function CoverPlaceholder( {
coverUrl,
hasBackground = false,
children,
noticeUI,
noticeOperations,
Expand All @@ -261,7 +261,7 @@ function CoverPlaceholder( {
accept="image/*,video/*"
allowedTypes={ ALLOWED_MEDIA_TYPES }
notices={ noticeUI }
disableMediaButtons={ !! coverUrl }
disableMediaButtons={ hasBackground }
onError={ ( message ) => {
removeAllNotices();
createErrorNotice( message );
Expand Down Expand Up @@ -644,7 +644,7 @@ function CoverEdit( {
) }
{ isBlogUrl && <Spinner /> }
<CoverPlaceholder
coverUrl={ url }
hasBackground={ hasBackground }
noticeUI={ noticeUI }
onSelectMedia={ onSelectMedia }
noticeOperations={ noticeOperations }
Expand Down