From 0022202b4dcc95f36b65fab0c4e370b7d4f749f5 Mon Sep 17 00:00:00 2001 From: ShimaginAndrey Date: Tue, 15 Jun 2021 16:22:38 +0300 Subject: [PATCH] Fix Bug 48109 --- .../mobile/src/view/add/Add.jsx | 18 ++++--- .../mobile/src/view/add/AddOther.jsx | 51 +++++++++++-------- 2 files changed, 42 insertions(+), 27 deletions(-) diff --git a/apps/documenteditor/mobile/src/view/add/Add.jsx b/apps/documenteditor/mobile/src/view/add/Add.jsx index 7e490ea58..c09a2690a 100644 --- a/apps/documenteditor/mobile/src/view/add/Add.jsx +++ b/apps/documenteditor/mobile/src/view/add/Add.jsx @@ -76,30 +76,36 @@ const AddLayoutContent = ({ tabs }) => { ) }; -const AddTabs = props => { +const AddTabs = inject("storeFocusObjects")(observer(({storeFocusObjects, showPanels, style, inPopover}) => { const { t } = useTranslation(); const _t = t('Add', {returnObjects: true}); - const showPanels = props.showPanels; const tabs = []; - if (!showPanels) { + const options = storeFocusObjects.settings; + if (!showPanels && options.indexOf('text') > -1) { tabs.push({ caption: _t.textTable, id: 'add-table', icon: 'icon-add-table', component: }); + } + if(!showPanels) { tabs.push({ caption: _t.textShape, id: 'add-shape', icon: 'icon-add-shape', component: }); + } + if(!showPanels) { tabs.push({ caption: _t.textImage, id: 'add-image', icon: 'icon-add-image', component: }); + } + if(!showPanels) { tabs.push({ caption: _t.textOther, id: 'add-other', @@ -115,14 +121,14 @@ const AddTabs = props => { }); } return ( - + - + ) -}; +})); class AddView extends Component { constructor(props) { diff --git a/apps/documenteditor/mobile/src/view/add/AddOther.jsx b/apps/documenteditor/mobile/src/view/add/AddOther.jsx index f32b48ae0..687bb0c07 100644 --- a/apps/documenteditor/mobile/src/view/add/AddOther.jsx +++ b/apps/documenteditor/mobile/src/view/add/AddOther.jsx @@ -153,46 +153,55 @@ const PageFootnote = props => { const AddOther = props => { const { t } = useTranslation(); const _t = t('Add', {returnObjects: true}); + + const storeFocusObjects = props.storeFocusObjects; + let isShape = storeFocusObjects.settings.indexOf('shape') > -1, + isText = storeFocusObjects.settings.indexOf('text') > -1, + isChart = storeFocusObjects.settings.indexOf('chart') > -1; + return ( - { + {isText && { props.closeModal(); Common.Notifications.trigger('addcomment'); }}> - - } + {isText && - + } - - - - - - + {(isShape || isChart) ? null : + + + + } + {(isShape || isChart) ? null : + + + } ) }; -const AddOtherContainer = inject("storeComments")(observer(AddOther)); +const AddOtherContainer = inject("storeComments","storeFocusObjects")(observer(AddOther)); export {AddOtherContainer as AddOther, PageNumber as PageAddNumber,