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

[RNMobile] Introduce grouping in the block settings inspector #17703

Merged
Merged
8 changes: 5 additions & 3 deletions packages/block-library/src/image/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,15 @@ class ImageEdit extends React.Component {
label={ __( 'Alt Text' ) }
value={ alt || '' }
valuePlaceholder={ __( 'None' ) }
separatorType={ 'fullWidth' }
onChange={ this.updateAlt }
separatorType={ 'none' }
onChangeValue={ this.updateAlt }
/>
</PanelBody>
<PanelBody>
<TextControl
label={ __( 'Clear All Settings' ) }
labelStyle={ styles.clearSettingsButton }
separatorType={ 'none' }
separatorType={ 'doubleFullWidth' }
lukewalczak marked this conversation as resolved.
Show resolved Hide resolved
onPress={ this.onClearSettings }
/>
</PanelBody>
Expand Down
5 changes: 5 additions & 0 deletions packages/components/src/mobile/bottom-sheet/cell.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class BottomSheetCell extends Component {
const cellLabelCenteredStyle = getStylesFromColorScheme( styles.cellLabelCentered, styles.cellTextDark );
const defaultLabelStyle = showValue || icon !== undefined ? cellLabelStyle : cellLabelCenteredStyle;
const drawSeparator = ( separatorType && separatorType !== 'none' ) || separatorStyle === undefined;
const drawDoubleSeparator = drawSeparator && separatorType === 'doubleFullWidth';

const onCellPress = () => {
if ( isValueEditable ) {
Expand Down Expand Up @@ -87,6 +88,7 @@ class BottomSheetCell extends Component {
case 'leftMargin':
return leftMarginStyle;
case 'fullWidth':
case 'doubleFullWidth':
return defaultSeparatorStyle;
case 'none':
return undefined;
Expand Down Expand Up @@ -165,6 +167,9 @@ class BottomSheetCell extends Component {
onPress={ onCellPress }
style={ { ...styles.clipToBounds, ...style } }
>
{ drawDoubleSeparator && (
<View style={ separatorStyle() } />
) }
<View style={ styles.cellContainer }>
<View style={ styles.cellRowContainer }>
{ icon && (
Expand Down
11 changes: 8 additions & 3 deletions packages/components/src/panel/body.native.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
/**
* External dependencies
*/
import { View } from 'react-native';
import { Text, View } from 'react-native';

/**
* WordPress dependencies
*/
import { Component } from '@wordpress/element';
/**
* Internal dependencies
*/
import styles from './body.scss';

export class PanelBody extends Component {
constructor( ) {
Expand All @@ -15,9 +19,10 @@ export class PanelBody extends Component {
}

render() {
const { children } = this.props;
const { children, title } = this.props;
return (
<View >
<View style={ styles.section }>
{ title && <Text style={ styles.sectionHeader }>{ title.toUpperCase() }</Text> }
lukewalczak marked this conversation as resolved.
Show resolved Hide resolved
{ children }
</View>
);
Expand Down
8 changes: 8 additions & 0 deletions packages/components/src/panel/body.native.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.sectionHeader {
color: $dark-gray-500;
padding-bottom: 8px;
}

.section {
padding: 8px 0;
}