From 61998a2c04bab3bfbd8e1a0e526e106a2be67c5a Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Fri, 30 Apr 2021 16:29:41 +0300 Subject: [PATCH] [mobile] Add hide navbar when sheet-modal is opened --- apps/common/mobile/resources/less/common.less | 12 ++++++++++++ apps/documenteditor/mobile/src/page/main.jsx | 11 +++++++++-- apps/presentationeditor/mobile/src/page/main.jsx | 14 +++++++++++--- apps/spreadsheeteditor/mobile/src/page/main.jsx | 12 ++++++++++-- 4 files changed, 42 insertions(+), 7 deletions(-) diff --git a/apps/common/mobile/resources/less/common.less b/apps/common/mobile/resources/less/common.less index 0878be6ca..4c178c708 100644 --- a/apps/common/mobile/resources/less/common.less +++ b/apps/common/mobile/resources/less/common.less @@ -32,6 +32,18 @@ } } +.navbar-hidden { + transform: translate3d(0, calc(-1 * (var(--f7-navbar-height) + var(--f7-subnavbar-height))), 0); +} + +.navbar-hidden+.page>.page-content, .navbar-hidden+.page-content { + padding-top: 0; +} + +.page.editor>.page-content { + transition: padding-top .3s ease-in; +} + .subnavbar { .subnavbar-inner { padding: 0; diff --git a/apps/documenteditor/mobile/src/page/main.jsx b/apps/documenteditor/mobile/src/page/main.jsx index 2a32a5103..33f49fe57 100644 --- a/apps/documenteditor/mobile/src/page/main.jsx +++ b/apps/documenteditor/mobile/src/page/main.jsx @@ -44,6 +44,10 @@ class MainPage extends Component { collaborationPage: showOpts }; }); + + if ((opts === 'edit' || opts === 'coauth') && Device.phone) { + f7.navbar.hide('.main-navbar'); + } }; handleOptionsViewClosed = opts => { @@ -57,7 +61,10 @@ class MainPage extends Component { return {settingsVisible: false}; else if ( opts == 'coauth' ) return {collaborationVisible: false}; - }) + }); + if ((opts === 'edit' || opts === 'coauth') && Device.phone) { + f7.navbar.show('.main-navbar'); + } })(); }; @@ -66,7 +73,7 @@ class MainPage extends Component { const config = appOptions.config; const showLogo = !(appOptions.canBrandingExt && (config.customization && (config.customization.loaderName || config.customization.loaderLogo))); return ( - + {/* Top Navbar */} {showLogo &&
} diff --git a/apps/presentationeditor/mobile/src/page/main.jsx b/apps/presentationeditor/mobile/src/page/main.jsx index c7f0400e4..0fa477c96 100644 --- a/apps/presentationeditor/mobile/src/page/main.jsx +++ b/apps/presentationeditor/mobile/src/page/main.jsx @@ -1,6 +1,7 @@ import React, { Component, Fragment } from 'react'; -import { Page, View, Navbar, Subnavbar, Icon } from 'framework7-react'; +import { f7, Page, View, Navbar, Subnavbar, Icon } from 'framework7-react'; import { observer, inject } from "mobx-react"; +import { Device } from '../../../../common/mobile/utils/device'; import EditOptions from '../view/edit/Edit'; import AddOptions from '../view/add/Add'; @@ -44,6 +45,10 @@ class MainPage extends Component { else if ( opts == 'preview' ) return {previewVisible: true}; }); + + if ((opts === 'edit' || opts === 'coauth') && Device.phone) { + f7.navbar.hide('.main-navbar'); + } }; handleOptionsViewClosed = opts => { @@ -59,7 +64,10 @@ class MainPage extends Component { return {collaborationVisible: false} else if ( opts == 'preview' ) return {previewVisible: false}; - }) + }); + if ((opts === 'edit' || opts === 'coauth') && Device.phone) { + f7.navbar.show('.main-navbar'); + } })(); }; @@ -71,7 +79,7 @@ class MainPage extends Component { return ( {!this.state.previewVisible ? null : } - + {/* Top Navbar */} {showLogo &&
} diff --git a/apps/spreadsheeteditor/mobile/src/page/main.jsx b/apps/spreadsheeteditor/mobile/src/page/main.jsx index 356e4859b..69efb93a8 100644 --- a/apps/spreadsheeteditor/mobile/src/page/main.jsx +++ b/apps/spreadsheeteditor/mobile/src/page/main.jsx @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import { Page, View, Navbar, Subnavbar, Icon } from 'framework7-react'; import { observer, inject } from "mobx-react"; +import { Device } from '../../../../common/mobile/utils/device'; import Settings from '../view/settings/Settings'; import CollaborationView from '../../../../common/mobile/lib/view/collaboration/Collaboration.jsx' @@ -43,6 +44,10 @@ class MainPage extends Component { else if ( opts == 'coauth' ) return {collaborationVisible: true}; }); + + if ((opts === 'edit' || opts === 'coauth') && Device.phone) { + f7.navbar.hide('.main-navbar'); + } }; handleOptionsViewClosed = opts => { @@ -56,7 +61,10 @@ class MainPage extends Component { return {settingsVisible: false}; else if ( opts == 'coauth' ) return {collaborationVisible: false}; - }) + }); + if ((opts === 'edit' || opts === 'coauth') && Device.phone) { + f7.navbar.show('.main-navbar'); + } })(); }; @@ -65,7 +73,7 @@ class MainPage extends Component { const config = appOptions.config; const showLogo = !(appOptions.canBrandingExt && (config.customization && (config.customization.loaderName || config.customization.loaderLogo))); return ( - + {/* Top Navbar */} {showLogo &&
}