Skip to content

Commit

Permalink
feat: Add disabled prop to SwitchCell component (#50560)
Browse files Browse the repository at this point in the history
  • Loading branch information
Siobhan Bamber authored May 12, 2023
1 parent 0bf1e79 commit 07b87a1
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { __, _x, sprintf } from '@wordpress/i18n';
import Cell from './cell';

export default function BottomSheetSwitchCell( props ) {
const { value, onValueChange, ...cellProps } = props;
const { value, onValueChange, disabled, ...cellProps } = props;

const onPress = () => {
onValueChange( ! value );
Expand Down Expand Up @@ -60,8 +60,13 @@ export default function BottomSheetSwitchCell( props ) {
onPress={ onPress }
editable={ false }
value={ '' }
disabled={ disabled }
>
<Switch value={ value } onValueChange={ onValueChange } />
<Switch
value={ value }
onValueChange={ onValueChange }
disabled={ disabled }
/>
</Cell>
);
}

1 comment on commit 07b87a1

@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 07b87a1.
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/4958842221
📝 Reported issues:

Please sign in to comment.