diff --git a/packages/app/src/app/pages/Dashboard/Content/CreateNewSandbox/Modal/index.js b/packages/app/src/app/pages/Dashboard/Content/CreateNewSandbox/Modal/index.js index c1bb2905051..1042f8b2894 100644 --- a/packages/app/src/app/pages/Dashboard/Content/CreateNewSandbox/Modal/index.js +++ b/packages/app/src/app/pages/Dashboard/Content/CreateNewSandbox/Modal/index.js @@ -26,7 +26,6 @@ const usedTemplates = sortBy( const TEMPLATE_BASE_WIDTH = 150; const MAIN_TEMPLATE_BASE_WIDTH = 190; -const SERVER_TEMPLATE_BASE_WIDTH = 150; // 150 export default class Modal extends React.PureComponent { selectTemplate = template => { @@ -39,21 +38,21 @@ export default class Modal extends React.PureComponent { const paddedWidth = width; const mainTemplates = usedTemplates.filter(t => t.main && !t.isServer); const otherTemplates = usedTemplates.filter(t => !t.main && !t.isServer); - const serverTemplates = usedTemplates.filter(t => t.isServer); + const mainServerTemplates = usedTemplates.filter(t => t.main && t.isServer); + const otherServerTemplates = usedTemplates.filter( + t => !t.main && t.isServer + ); const mainTemplatesPerRow = Math.max( 1, paddedWidth / MAIN_TEMPLATE_BASE_WIDTH ); const templatesPerRow = Math.max(1, paddedWidth / TEMPLATE_BASE_WIDTH); - const serverTemplatesPerRow = Math.max( - 1, - paddedWidth / SERVER_TEMPLATE_BASE_WIDTH - ); const mainRows = chunk(mainTemplates, mainTemplatesPerRow); const rows = chunk(otherTemplates, templatesPerRow); - const serverRows = chunk(serverTemplates, serverTemplatesPerRow); + const mainServerRows = chunk(mainServerTemplates, mainTemplatesPerRow); + const serverRows = chunk(otherServerTemplates, templatesPerRow); return ( Client Templates {mainRows.map((ts, i) => ( - // eslint-disable-next-line + // eslint-disable-next-line react/no-array-index-key {ts.map(t => (