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

Add "Separator" (hr) block to the library. #619

Merged
merged 1 commit into from
May 3, 2017
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: 1 addition & 0 deletions blocks/library/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ import './image';
import './text';
import './list';
import './quote';
import './separator';
21 changes: 21 additions & 0 deletions blocks/library/separator/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Internal dependencies
*/
import './style.scss';
import { registerBlock } from 'api';

registerBlock( 'core/separator', {
title: wp.i18n.__( 'Separator' ),

icon: 'minus',

category: 'common',

edit() {
return <hr className="blocks-separator" />;
},

save() {
return <hr />;
}
} );
4 changes: 4 additions & 0 deletions blocks/library/separator/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.blocks-separator {
border: none;
border-bottom: 2px solid $light-gray-800;
}
4 changes: 4 additions & 0 deletions post-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ window._wpGutenbergPost = {
'<p>I imagine prior to the launch of the iPod, or the iPhone, there were teams saying the same thing: the copy + paste guys are <em>so close</em> to being ready and we know Walt Mossberg is going to ding us for this so let\'s just not ship to the manufacturers in China for just a few more weeks… The Apple teams were probably embarrassed. But <strong>if you\'re not embarrassed when you ship your first version you waited too long</strong>.</p>',
'<!-- /wp:core/text -->',

'<!-- wp:core/separator -->',
'<hr />',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add the classname here too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I should just remove it from the save function waiting until we figure out theme integration properly.

'<!-- /wp:core/separator -->',

'<!-- wp:core/image -->',
'<figure><img src="https://cldup.com/Bc9YxmqFnJ.jpg" /></figure>',
'<!-- /wp:core/image -->',
Expand Down