Skip to content

Commit

Permalink
[RNMobile] Synced Patterns: Ensure title is always visible (#55399)
Browse files Browse the repository at this point in the history
Ensure the title section of Synced Patterns is visible within the editor when a block-based theme is used with a background that contrasts the device's dark/light mode.
  • Loading branch information
Siobhan Bamber authored Oct 20, 2023
1 parent fb7c9c5 commit 4afae15
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
29 changes: 16 additions & 13 deletions packages/block-library/src/block/edit-title.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Text, View } from 'react-native';
/**
* WordPress dependencies
*/
import { Icon } from '@wordpress/components';
import { Icon, useGlobalStyles } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { withPreferredColorScheme } from '@wordpress/compose';
import { help, lock } from '@wordpress/icons';
Expand All @@ -17,18 +17,21 @@ import { help, lock } from '@wordpress/icons';
import styles from './editor.scss';

function EditTitle( { getStylesFromColorScheme, title } ) {
const lockIconStyle = getStylesFromColorScheme(
styles.lockIcon,
styles.lockIconDark
);
const titleStyle = getStylesFromColorScheme(
styles.title,
styles.titleDark
);
const infoIconStyle = getStylesFromColorScheme(
styles.infoIcon,
styles.infoIconDark
);
const globalStyles = useGlobalStyles();
const baseColors = globalStyles?.baseColors?.color;

const lockIconStyle = [
getStylesFromColorScheme( styles.lockIcon, styles.lockIconDark ),
baseColors && { color: baseColors.text },
];
const titleStyle = [
getStylesFromColorScheme( styles.title, styles.titleDark ),
baseColors && { color: baseColors.text },
];
const infoIconStyle = [
getStylesFromColorScheme( styles.infoIcon, styles.infoIconDark ),
baseColors && { color: baseColors.text },
];
const separatorStyle = getStylesFromColorScheme(
styles.separator,
styles.separatorDark
Expand Down
1 change: 1 addition & 0 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ For each user feature we should also add a importance categorization label to i
-->

## Unreleased
- [*] Synced Patterns: Fix visibility of heading section when used with block based themes in dark mode [#55399]
- [*] Classic block: Add option to convert to blocks [#55461]

## 1.106.0
Expand Down

1 comment on commit 4afae15

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 4afae15.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6588079001
📝 Reported issues:

Please sign in to comment.