diff --git a/blocks/oik-blocklist/blocklist.js b/blocks/oik-blocklist/blocklist.js index 6cb476f..19557e6 100644 --- a/blocks/oik-blocklist/blocklist.js +++ b/blocks/oik-blocklist/blocklist.js @@ -8,6 +8,7 @@ const { getBlockType, getBlockTypes } = wp.blocks; const { BlockIcon } = wp.editor; +const Fragment = wp.element.Fragment; import { BlockiconStyled } from '../oik-blockicon/blockicons.js'; import { getNameSpace} from './blockprefix.js'; @@ -24,12 +25,14 @@ function BlockListStyled( prefix, showBlockTypeName, showTitle, showDescription, var block_types = getBlockTypes(); block_types = block_types.filter( namespaceFilter, namespace ); + //block_types = block_types.sortByField( "name"); + block_types = block_types.sort( (a, b) => a.title.localeCompare(b.title)); //console.log( block_types ); return( - + ); @@ -47,10 +50,17 @@ function namespaceFilter( element, index, array ) { function BlockListItem( block ) { /* { block.icon */ /* console.log( block ); */ - return(
  • - - {block.name } {block.title } -
  • ); + return( +
    + + +
    +
    + {block.title } - {block.name }
    + {block.description} +
    +
    + ); } export { BlockListStyled }; \ No newline at end of file