Skip to content

Commit

Permalink
Rename blocks setup function
Browse files Browse the repository at this point in the history
  • Loading branch information
renatho committed Jan 12, 2021
1 parent 4ddc76e commit 19ed087
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions assets/blocks/blocks-setup.js
Expand Up @@ -2,7 +2,12 @@ import { registerBlockType, updateCategory } from '@wordpress/blocks';

import { SenseiIcon } from '../icons';

const blocksSetup = ( blocks ) => {
/**
* Register Sensei blocks.
*
* @param {*} blocks
*/
const registerSenseiBlocks = ( blocks ) => {
updateCategory( 'sensei-lms', {
icon: SenseiIcon( { width: '20', height: '20' } ),
} );
Expand All @@ -13,4 +18,4 @@ const blocksSetup = ( blocks ) => {
} );
};

export default blocksSetup;
export default registerSenseiBlocks;
4 changes: 2 additions & 2 deletions assets/blocks/course-blocks.js
@@ -1,4 +1,4 @@
import blocksSetup from './blocks-setup';
import registerSenseiBlocks from './blocks-setup';
import TakeCourseButtonBlock from './take-course';
import ContactTeacherButton from './contact-teacher';
import CourseProgressBlock from './course-progress';
Expand All @@ -8,7 +8,7 @@ import {
CourseOutlineModuleBlock,
} from './course-outline';

blocksSetup( [
registerSenseiBlocks( [
CourseOutlineBlock,
CourseOutlineModuleBlock,
CourseOutlineLessonBlock,
Expand Down

0 comments on commit 19ed087

Please sign in to comment.