Skip to content

Commit

Permalink
Site Title: Remove save button. (#19155)
Browse files Browse the repository at this point in the history
  • Loading branch information
epiqueras authored Dec 16, 2019
1 parent ab8af23 commit 846afa7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 36 deletions.
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.

0 comments on commit 846afa7

Please sign in to comment.