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

[Mobile] Cover: Add Media Button when only colour is selected #23878

Merged
merged 68 commits into from
Jul 28, 2020
Merged
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
c608052
Create cover block with only colour (from a default palette)
Jul 9, 2020
508f015
Added custom colour swatch
Jul 10, 2020
96b1582
Custom Color picker action
Jul 10, 2020
8c13787
Hide the block settings button
Jul 10, 2020
6783f1b
Add image button
Jul 10, 2020
6e83663
Use noop instead of empty arrow function
Jul 13, 2020
3919a7d
Use default settings colors
Jul 13, 2020
a2eee4b
WIP: Changes Based on design feedback
Jul 13, 2020
83668c7
Merge branch 'master' into rnmobile/23831_Cover_Only_color
Jul 14, 2020
c71346a
Merge branch 'master' into rnmobile/23831_Cover_Only_color
Jul 14, 2020
a41dc37
Merge branch 'rnmobile/23831_Cover_Only_color' into rnmobile/Cover_wi…
Jul 14, 2020
4ea83e7
Merge branch 'rnmobile/Cover_with_custom_color' into rnmobile/CoverAd…
Jul 14, 2020
0cbe0c1
Show palette with both hardcoded and theme colors
Jul 14, 2020
a0cd93b
Customise media placeholder styles only for the cover component
Jul 14, 2020
30d5ccb
Merge branch 'rnmobile/23831_Cover_Only_color' into rnmobile/Cover_wi…
Jul 14, 2020
494356a
Merge branch 'rnmobile/Cover_with_custom_color' into rnmobile/CoverAd…
Jul 14, 2020
7aec919
Pass only modified media-placeholder styles
Jul 15, 2020
a152a4a
Pass only modified color-palette styles
Jul 15, 2020
53d5435
Merge branch 'rnmobile/23831_Cover_Only_color' into rnmobile/Cover_wi…
Jul 15, 2020
787b462
Fixes lint issue
Jul 15, 2020
e285d9c
Merge branch 'rnmobile/Cover_with_custom_color' into rnmobile/CoverAd…
Jul 15, 2020
9929516
Updated color palette height
Jul 16, 2020
485cef9
Updated color palette height
Jul 16, 2020
91ff055
Use only theme colors
Jul 16, 2020
3babed3
Merge branch 'rnmobile/23831_Cover_Only_color' into rnmobile/Cover_wi…
Jul 16, 2020
a6a1f3f
Merge branch 'master' into rnmobile/23831_Cover_Only_color
Jul 17, 2020
97cc951
Fixes Dark mode styling bug
Jul 17, 2020
ecf4147
Merge branch 'rnmobile/23831_Cover_Only_color' into rnmobile/Cover_wi…
Jul 17, 2020
60f248d
Use noop instead of empty arrow functions
Jul 17, 2020
9036c9e
Simplified media-placeholder props
Jul 17, 2020
7d6219f
Removed unnecessary style
Jul 17, 2020
201c7d6
Revert "Removed unnecessary style"
Jul 17, 2020
77b06a8
Merge branch 'rnmobile/23831_tmp' into rnmobile/Cover_with_custom_color
Jul 17, 2020
65fc25e
Merge branch 'rnmobile/23831_tmp' into rnmobile/Cover_with_custom_color
Jul 17, 2020
be77f4f
Fixes style issue
Jul 17, 2020
2bfd357
Added missing callbacks
Jul 17, 2020
e5d0a77
Added bottom label
Jul 17, 2020
56449db
Removes unnecessary function
Jul 17, 2020
8d2237d
Merge branch 'master' into rnmobile/Cover_with_custom_color
Jul 19, 2020
7179432
Apply custom color picker color
Jul 19, 2020
d8fbac9
Removes unused import
Jul 19, 2020
dc664fb
Lint issues and cleanup
Jul 20, 2020
7cd45e1
Merge branch 'rnmobile/Cover_with_custom_color' into rnmobile/CoverAd…
Jul 20, 2020
0a37400
Merge branch 'master' into rnmobile/Cover_with_custom_color
Jul 22, 2020
0a72e9f
Design fixes
Jul 22, 2020
7a4f90d
Renamed prop to declare usage more clearly
Jul 22, 2020
b37c342
Merge branch 'rnmobile/Cover_with_custom_color' into rnmobile/CoverAd…
Jul 22, 2020
8e2c894
Lint Issue
Jul 22, 2020
d75ef73
Merge branch 'rnmobile/Cover_with_custom_color' into rnmobile/CoverAd…
Jul 22, 2020
f9c5f1e
Changed image button design
Jul 23, 2020
5d8b4d9
Show image button only when component is selected
Jul 23, 2020
52b8344
Display correct media picker label
Jul 23, 2020
537211c
PR review fixes
Jul 23, 2020
df25f6b
Extra fixes to avoid inconsistent states
Jul 23, 2020
054a6b5
Lint fix and comment
Jul 23, 2020
852f9a4
Revert "Lint fix and comment"
Jul 24, 2020
f529dae
Revert "Extra fixes to avoid inconsistent states"
Jul 24, 2020
a623b1b
Review changes
Jul 24, 2020
b4ab716
Android hardware button handling
Jul 24, 2020
979e8d4
Merge branch 'master' into rnmobile/Cover_with_custom_color
Jul 24, 2020
a416741
Lint fix
Jul 24, 2020
c307b4c
Merge branch 'rnmobile/Cover_with_custom_color' into rnmobile/CoverAd…
Jul 24, 2020
3b43cc7
Syntactical fix
Jul 24, 2020
8d623a1
Merge branch 'master' into rnmobile/CoverAddImageButton
Jul 24, 2020
1c53bdd
Merge fixes
Jul 24, 2020
25971f0
Merge branch 'master' into rnmobile/CoverAddImageButton
Jul 27, 2020
b4fa6a4
Review fixes
Jul 27, 2020
00f6f1f
layout improvement
Jul 28, 2020
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
Prev Previous commit
Next Next commit
Use default settings colors
Antonis Lilis committed Jul 13, 2020
commit 3919a7d6f99a58710dadd764dd646e367e304099
37 changes: 12 additions & 25 deletions packages/block-library/src/cover/edit.native.js
Original file line number Diff line number Diff line change
@@ -70,38 +70,14 @@ const INNER_BLOCKS_TEMPLATE = [
const COVER_MAX_HEIGHT = 1000;
const COVER_DEFAULT_HEIGHT = 300;

const COVER_DEFAULT_PALETTE = {
colors: [
{
name: __( 'Black' ),
slug: 'black',
color: '#000000',
},
{
name: __( 'White' ),
slug: 'white',
color: '#ffffff',
},
{
name: __( 'Vivid cyan blue' ),
slug: 'vivid-cyan-blue',
color: '#0693e3',
},
{
name: __( 'Pale pink' ),
slug: 'pale-pink',
color: '#f78da7',
},
],
};

const Cover = ( {
attributes,
getStylesFromColorScheme,
isParentSelected,
onFocus,
overlayColor,
setAttributes,
settings,
} ) => {
const {
backgroundType,
@@ -115,6 +91,14 @@ const Cover = ( {
} = attributes;
const CONTAINER_HEIGHT = minHeight || COVER_DEFAULT_HEIGHT;

const COVER_DEFAULT_PALETTE = {
colors: settings.colors.filter( ( c ) =>
[ 'black', 'white', 'vivid-cyan-blue', 'pale-pink' ].includes(
c.slug
)
),
};

const { gradientValue } = __experimentalUseGradient();

const hasBackground = !! (
@@ -406,7 +390,10 @@ export default compose( [

const selectedBlockClientId = getSelectedBlockClientId();

const { getSettings } = select( 'core/block-editor' );

return {
settings: getSettings(),
isParentSelected: selectedBlockClientId === clientId,
};
} ),