Skip to content

Commit

Permalink
Use the _createBlock_ method to instantiate a _more_ block in our sam…
Browse files Browse the repository at this point in the history
…ple post
  • Loading branch information
maxme committed Apr 18, 2018
1 parent c8f15cb commit 359eae6
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const codeBlockInstance = createBlock( 'core/code', {
content: 'if name == "World":\n return "Hello World"\nelse:\n return "Hello Pony"',
} );

const moreBlockInstance = createBlock( 'core/more', {
customText: undefined,
} );

const initialState: StateType = {
// TODO: get blocks list block state should be externalized (shared with Gutenberg at some point?).
// If not it should be created from a string parsing (commented HTML to json).
Expand Down Expand Up @@ -67,14 +71,7 @@ const initialState: StateType = {
focused: false,
},
{ ...codeBlockInstance, focused: false },
{
uid: '5',
name: 'core/more',
isValid: true,
attributes: { customText: undefined },
innerBlocks: [],
focused: false,
},
{ ...moreBlockInstance, focused: false },
{
uid: '4',
name: 'paragraph',
Expand Down

0 comments on commit 359eae6

Please sign in to comment.