forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mobile - Cover block - Fixes color settings and placeholder visibility (
WordPress#37372) * Mobile - Cover block: Fixes setting a color, gradient. It also adds compatibility for resetting the overlay color to the default one and fixes a case where the placeholder would be visible after creating the block and clearing its overlay color/media. * Mobile - Cover block: Show add media button if there's a background or if there's one inner block present * Mobile - Cover block - Update tests: Adds test cases for setting the overlay solid and gradient color, as well as resetting the overlay color. * Mobile - Cover - Add tests to check changing between solid and gradient colors
- Loading branch information
Gerardo Pacheco
authored
Dec 17, 2021
1 parent
a92586c
commit 77a8622
Showing
8 changed files
with
371 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/block-library/src/cover/test/__snapshots__/edit.native.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`color settings clears the selected overlay color and mantains the inner blocks 1`] = ` | ||
"<!-- wp:cover --> | ||
<div class=\\"wp-block-cover\\"><span aria-hidden=\\"true\\" class=\\"has-background-dim-100 wp-block-cover__gradient-background has-background-dim\\"></span><div class=\\"wp-block-cover__inner-container\\"><!-- wp:paragraph {\\"align\\":\\"center\\",\\"placeholder\\":\\"Write title…\\"} --> | ||
<p class=\\"has-text-align-center\\"></p> | ||
<!-- /wp:paragraph --></div></div> | ||
<!-- /wp:cover -->" | ||
`; | ||
exports[`color settings sets a color for the overlay background when the placeholder is visible 1`] = ` | ||
"<!-- wp:cover {\\"overlayColor\\":\\"vivid-red\\"} --> | ||
<div class=\\"wp-block-cover\\"><span aria-hidden=\\"true\\" class=\\"has-vivid-red-background-color has-background-dim-100 wp-block-cover__gradient-background has-background-dim\\"></span><div class=\\"wp-block-cover__inner-container\\"><!-- wp:paragraph {\\"align\\":\\"center\\",\\"placeholder\\":\\"Write title…\\"} --> | ||
<p class=\\"has-text-align-center\\"></p> | ||
<!-- /wp:paragraph --></div></div> | ||
<!-- /wp:cover -->" | ||
`; | ||
exports[`color settings sets a gradient overlay background when a solid background was already selected 1`] = ` | ||
"<!-- wp:cover {\\"gradient\\":\\"light-green-cyan-to-vivid-green-cyan\\"} --> | ||
<div class=\\"wp-block-cover\\"><span aria-hidden=\\"true\\" class=\\"has-background-dim-100 wp-block-cover__gradient-background has-light-green-cyan-to-vivid-green-cyan-gradient-background has-background-dim has-background-gradient has-light-green-cyan-to-vivid-green-cyan-gradient-background\\"></span><div class=\\"wp-block-cover__inner-container\\"><!-- wp:paragraph {\\"align\\":\\"center\\",\\"placeholder\\":\\"Write title…\\"} --> | ||
<p class=\\"has-text-align-center\\"></p> | ||
<!-- /wp:paragraph --></div></div> | ||
<!-- /wp:cover -->" | ||
`; | ||
exports[`color settings toggles between solid colors and gradients 1`] = ` | ||
"<!-- wp:cover {\\"gradient\\":\\"light-green-cyan-to-vivid-green-cyan\\"} --> | ||
<div class=\\"wp-block-cover\\"><span aria-hidden=\\"true\\" class=\\"has-background-dim-100 wp-block-cover__gradient-background has-light-green-cyan-to-vivid-green-cyan-gradient-background has-background-dim has-background-gradient has-light-green-cyan-to-vivid-green-cyan-gradient-background\\"></span><div class=\\"wp-block-cover__inner-container\\"><!-- wp:paragraph {\\"align\\":\\"center\\",\\"placeholder\\":\\"Write title…\\"} --> | ||
<p class=\\"has-text-align-center\\"></p> | ||
<!-- /wp:paragraph --></div></div> | ||
<!-- /wp:cover -->" | ||
`; |
Oops, something went wrong.