From f257e08e7c5a832707214f345115e7fb5933645e Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Fri, 26 May 2017 01:19:00 +0300 Subject: [PATCH] added App options --- src/components/App.js | 4 ++-- src/lib/render.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/App.js b/src/components/App.js index 113b773b..d7d495a7 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -8,7 +8,7 @@ const Comments = () => ( ) -const App = ({children, menu, showAuthor}) => ( +const App = ({children, menu, showAuthor, menuPadding}) => (
@@ -19,7 +19,7 @@ const App = ({children, menu, showAuthor}) => (
-
+
{children}
diff --git a/src/lib/render.js b/src/lib/render.js index c4bb80bc..4d24b8d1 100644 --- a/src/lib/render.js +++ b/src/lib/render.js @@ -16,6 +16,7 @@ const config = require('../config') const defaultOptions = { commentsEnabled: false, showAuthor: false, + menuPadding: true, } function isActive(path, menuItem) { @@ -69,17 +70,18 @@ const getTitle = meta => 'title' in meta const isHtml = data => typeof data === 'string' async function render(path, data, meta, options = {}) { + const renderOptions = {...defaultOptions, ...options} + const component = isHtml(data) ? getHtml(data) : data const menu = buildMenu(path, menuModel) - const content = renderApp({...options, menu, component}) + const content = renderApp({...renderOptions, menu, component}) const source = await readFile(config.viewMain, 'utf-8') const template = handlebars.compile(source) - const renderOptions = {...defaultOptions, ...options} const metaData = { ...meta, description: 'Сайт Шлиссельбургской художественной школы',