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

Site Title: Remove save button. #19155

Merged
merged 1 commit into from
Dec 16, 2019
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion packages/base-styles/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ $z-layers: (
".wp-block-cover__inner-container": 1, // InnerBlocks area inside cover image block
".wp-block-cover.has-background-dim::before": 1, // Overlay area inside block cover need to be higher than the video background.
".wp-block-cover__video-background": 0, // Video background inside cover block.
".wp-block-site-title__save-button": 1,

// Active pill button
".components-button {:focus or .is-primary}": 1,
Expand Down
1 change: 0 additions & 1 deletion packages/block-library/src/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
@import "./text-columns/editor.scss";
@import "./verse/editor.scss";
@import "./video/editor.scss";
@import "./site-title/editor.scss";

/**
* Import styles from internal editor components used by the blocks.
Expand Down
36 changes: 8 additions & 28 deletions packages/block-library/src/site-title/edit.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,19 @@
/**
* WordPress dependencies
*/
import {
useEntityProp,
__experimentalUseEntitySaving,
} from '@wordpress/core-data';
import { Button } from '@wordpress/components';
import { useEntityProp } from '@wordpress/core-data';
import { __ } from '@wordpress/i18n';
import { RichText } from '@wordpress/block-editor';

export default function SiteTitleEdit() {
const [ title, setTitle ] = useEntityProp( 'root', 'site', 'title' );
const [ isDirty, isSaving, save ] = __experimentalUseEntitySaving(
'root',
'site',
'title'
);
return (
<>
<Button
isPrimary
className="wp-block-site-title__save-button"
disabled={ ! isDirty || ! title }
isBusy={ isSaving }
onClick={ save }
>
{ __( 'Update' ) }
</Button>
<RichText
tagName="h1"
placeholder={ __( 'Site Title' ) }
value={ title }
onChange={ setTitle }
allowedFormats={ [] }
/>
</>
<RichText
tagName="h1"
placeholder={ __( 'Site Title' ) }
value={ title }
onChange={ setTitle }
allowedFormats={ [] }
/>
);
}
6 changes: 0 additions & 6 deletions packages/block-library/src/site-title/editor.scss

This file was deleted.