Skip to content

Commit

Permalink
Issue #27 - Create a simpler blocklist when Show block link toggle is…
Browse files Browse the repository at this point in the history
… off and Show batch commands is On.
  • Loading branch information
bobbingwide committed May 7, 2021
1 parent bb37c5c commit b878302
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions blocks/oik-blocklist/blocklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,20 @@ function BlockListStyled( prefix, showBlockLink, showDescription, showBatch, com
//var blocklist = null;

if ( showBatch ) {
if ( showBlockLink ) {

var blocklist = <pre>
var blocklist = <pre>
rem Blocks {count_blocks}
<br />
{block_types.map((block ) => BlockCreateBlockLink( block, component )) }
<br/>
{block_types.map((block) => BlockCreateBlockLink(block, component))}
</pre>
} else {
var blocklist = <pre>
rem Block {count_blocks }
<br />
{block_types.map( (block) => BlockNoLink( block, component ))}
</pre>
}
} else {
var blocklist =
<dl>
Expand Down Expand Up @@ -182,4 +190,10 @@ function BlockCreateBlockLink( block, component ) {
);
}

function BlockNoLink( block, component ) {
return(
<Fragment>{block.title } - {block.name}<br /></Fragment>
);
}

export { BlockListStyled, BlockListItem };

0 comments on commit b878302

Please sign in to comment.