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

Update pattern creation modal in library #51946

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Changes from all commits
Commits
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
14 changes: 5 additions & 9 deletions packages/edit-site/src/components/create-pattern-modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function CreatePatternModal( {
onError,
} ) {
const [ name, setName ] = useState( '' );
const [ syncType, setSyncType ] = useState( SYNC_TYPES.full );
const [ syncType, setSyncType ] = useState( SYNC_TYPES.unsynced );
const [ isSubmitting, setIsSubmitting ] = useState( false );

const onSyncChange = () => {
Expand Down Expand Up @@ -77,8 +77,6 @@ export default function CreatePatternModal( {
onRequestClose={ closeModal }
overlayClassName="edit-site-create-pattern-modal"
>
<p>{ __( 'Turn this block into a pattern to reuse later' ) }</p>

<form
onSubmit={ async ( event ) => {
event.preventDefault();
Expand All @@ -100,13 +98,11 @@ export default function CreatePatternModal( {
__nextHasNoMarginBottom
/>
<ToggleControl
label={ __( 'Synced' ) }
label={ __( 'Keep all pattern instances in sync' ) }
onChange={ onSyncChange }
help={
syncType === SYNC_TYPES.full
? __( 'Content is synced' )
: __( 'Content is not synced' )
}
help={ __(
'Editing the original pattern will also update anywhere the pattern is used.'
) }
aaronrobertshaw marked this conversation as resolved.
Show resolved Hide resolved
checked={ syncType === SYNC_TYPES.full }
/>
<HStack justify="right">
Expand Down