[DE mobile] Hide options in toolbar for view mode

This commit is contained in:
JuliaSvinareva 2021-04-13 15:37:31 +03:00
parent 30b08d1dbb
commit cd1aa44b5c
2 changed files with 10 additions and 7 deletions

View file

@ -174,6 +174,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview')(prop
return ( return (
<ToolbarView openOptions={props.openOptions} <ToolbarView openOptions={props.openOptions}
isEdit={appOptions.isEdit}
docTitle={docTitle} docTitle={docTitle}
isShowBack={isShowBack} isShowBack={isShowBack}
onBack={onBack} onBack={onBack}

View file

@ -9,18 +9,20 @@ const ToolbarView = props => {
<Fragment> <Fragment>
<NavLeft> <NavLeft>
{props.isShowBack && <Link className={`btn-doc-back${props.disabledControls && ' disabled'}`} icon='icon-back' onClick={props.onBack}></Link>} {props.isShowBack && <Link className={`btn-doc-back${props.disabledControls && ' disabled'}`} icon='icon-back' onClick={props.onBack}></Link>}
<Link icon='icon-undo' className={!props.isCanUndo && 'disabled'} onClick={props.onUndo}></Link> {props.isEdit && EditorUIController.getUndoRedo({
<Link icon='icon-redo' className={!props.isCanRedo && 'disabled'} onClick={props.onRedo}></Link> disabledUndo: !props.isCanUndo,
disabledRedo: !props.isCanRedo,
onUndoClick: props.onUndo,
onRedoClick: props.onRedo
})}
</NavLeft> </NavLeft>
{!Device.phone && <NavTitle>{props.docTitle}</NavTitle>} {!Device.phone && <NavTitle>{props.docTitle}</NavTitle>}
<NavRight> <NavRight>
{ {props.isEdit && EditorUIController.getToolbarOptions({
EditorUIController.getToolbarOptions({
disabled: disableEditBtn || props.disabledControls, disabled: disableEditBtn || props.disabledControls,
onEditClick: e => props.openOptions('edit'), onEditClick: e => props.openOptions('edit'),
onAddClick: e => props.openOptions('add'), onAddClick: e => props.openOptions('add')
}) })}
}
{ Device.phone ? null : <Link className={props.disabledControls && 'disabled'} icon='icon-search' searchbarEnable='.searchbar' href={false}></Link> } { Device.phone ? null : <Link className={props.disabledControls && 'disabled'} icon='icon-search' searchbarEnable='.searchbar' href={false}></Link> }
{props.displayCollaboration && <Link className={props.disabledControls && 'disabled'} id='btn-coauth' href={false} icon='icon-collaboration' onClick={e => props.openOptions('coauth')}></Link>} {props.displayCollaboration && <Link className={props.disabledControls && 'disabled'} id='btn-coauth' href={false} icon='icon-collaboration' onClick={e => props.openOptions('coauth')}></Link>}
<Link className={(props.disabledSettings || props.disabledControls) && 'disabled'} id='btn-settings' icon='icon-settings' href={false} onClick={e => props.openOptions('settings')}></Link> <Link className={(props.disabledSettings || props.disabledControls) && 'disabled'} id='btn-settings' icon='icon-settings' href={false} onClick={e => props.openOptions('settings')}></Link>