diff --git a/app/components/editors/p8p_editor_box.js b/app/components/editors/p8p_editor_box.js index 46ffcf6..9f01da4 100644 --- a/app/components/editors/p8p_editor_box.js +++ b/app/components/editors/p8p_editor_box.js @@ -21,6 +21,9 @@ const P8PEditorBox = ({ title, children, onSave }) => { //При нажатии на "Сохранить" const handleSaveClick = (closeEditor = false) => onSave && onSave(closeEditor); + //Флаг отображения кнопок сохранения + const showSaveBar = onSave ? true : false; + //Формирование представления return ( @@ -28,14 +31,16 @@ const P8PEditorBox = ({ title, children, onSave }) => { {children} - - handleSaveClick(false)} title={BUTTONS.APPLY}> - done - - handleSaveClick(true)} title={BUTTONS.SAVE}> - done_all - - + {showSaveBar && ( + + handleSaveClick(false)} title={BUTTONS.APPLY}> + done + + handleSaveClick(true)} title={BUTTONS.SAVE}> + done_all + + + )} ); };