Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Clayton committed Sep 19, 2024
1 parent c08c58b commit 4360a42
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions libs/blocks/library-config/library-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { createTag } from '../../utils/utils.js';

const LIBRARY_PATH = '/docs/library/library.json';

async function loadBlocks(content, list, query, type) {
async function loadBlocks({ content, list, query, type }) {
const { default: blocks } = await import('./lists/blocks.js');
blocks(content, list, query, type);
}

async function loadTemplates(content, list, query, type) {
async function loadTemplates({ content, list, query, type }) {
const { default: templates } = await import('./lists/templates.js');
templates(content, list, query, type);
}
Expand All @@ -32,7 +32,7 @@ async function loadPersonalization(content, list) {
personalization(content, list);
}

function addSearch(content, list, type) {
function addSearch({ content, list, type }) {
const skLibrary = list.closest('.sk-library');
const header = skLibrary.querySelector('.sk-library-header');
let search = skLibrary.querySelector('.sk-library-search');
Expand All @@ -51,10 +51,10 @@ function addSearch(content, list, type) {

switch (type) {
case 'blocks':
loadBlocks(content, list, query, type);
loadBlocks({ content, list, query, type });
break;
case 'templates':
loadTemplates(content, list, query, type);
loadTemplates({ content, list, query, type });
break;
default:
}
Expand All @@ -66,10 +66,10 @@ function addSearch(content, list, type) {

switch (type) {
case 'blocks':
loadBlocks(content, list, query, type);
loadBlocks({ content, list, query, type });
break;
case 'templates':
loadTemplates(content, list, query, type);
loadTemplates({ content, list, query, type });
break;
default:
}
Expand All @@ -87,12 +87,12 @@ async function loadList(type, content, list) {
const query = list.closest('.sk-library').querySelector('.sk-library-search-input')?.value;
switch (type) {
case 'blocks':
addSearch(content, list, type);
loadBlocks(content, list, query, type);
addSearch({ content, list, type });
loadBlocks({ content, list, query, type });
break;
case 'templates':
addSearch(content, list, type);
loadTemplates(content, list, query, type);
addSearch({ content, list, type });
loadTemplates({ content, list, query, type });
break;
case 'placeholders':
loadPlaceholders(content, list);
Expand Down

0 comments on commit 4360a42

Please sign in to comment.