diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json index 4988d8b44..6a19b5450 100644 --- a/apps/presentationeditor/mobile/locale/en.json +++ b/apps/presentationeditor/mobile/locale/en.json @@ -49,6 +49,12 @@ "textDisableAllMacrosWithNotification": "Disable all macros with notification", "textEnableAll": "Enable All", "textEnableAllMacrosWithoutNotification": "Enable all macros without notification" + }, + "Add": { + "textSlide": "Slide", + "textShape": "Shape", + "textImage": "Image", + "textOther": "Other" } } } \ No newline at end of file diff --git a/apps/presentationeditor/mobile/src/controller/add/AddShape.jsx b/apps/presentationeditor/mobile/src/controller/add/AddShape.jsx new file mode 100644 index 000000000..bf649dc1d --- /dev/null +++ b/apps/presentationeditor/mobile/src/controller/add/AddShape.jsx @@ -0,0 +1,20 @@ +import React, {Component} from 'react'; +import { f7 } from 'framework7-react'; +import {Device} from '../../../../../common/mobile/utils/device'; +import {observer, inject} from "mobx-react"; + +import { AddShape } from '../../view/add/AddShape'; + +class AddShapeController extends Component { + constructor (props) { + super(props); + } + render () { + return ( + + ) + } +} + +export default AddShapeController; \ No newline at end of file diff --git a/apps/presentationeditor/mobile/src/controller/add/AddSlide.jsx b/apps/presentationeditor/mobile/src/controller/add/AddSlide.jsx new file mode 100644 index 000000000..5723596ce --- /dev/null +++ b/apps/presentationeditor/mobile/src/controller/add/AddSlide.jsx @@ -0,0 +1,20 @@ +import React, {Component} from 'react'; +import { f7 } from 'framework7-react'; +import {Device} from '../../../../../common/mobile/utils/device'; +import {observer, inject} from "mobx-react"; + +import { AddSlide } from '../../view/add/AddSlide'; + +class AddSlideController extends Component { + constructor (props) { + super(props); + } + render () { + return ( + + ) + } +} + +export default AddSlideController; \ No newline at end of file diff --git a/apps/presentationeditor/mobile/src/less/icons-ios.less b/apps/presentationeditor/mobile/src/less/icons-ios.less index 60e822a37..b29d6067f 100644 --- a/apps/presentationeditor/mobile/src/less/icons-ios.less +++ b/apps/presentationeditor/mobile/src/less/icons-ios.less @@ -563,7 +563,7 @@ } } - .active { + .tab-link-active { i.icon { &.icon-add-slide { width: 24px; diff --git a/apps/presentationeditor/mobile/src/page/main.jsx b/apps/presentationeditor/mobile/src/page/main.jsx index 34f6e04ae..35e780a6f 100644 --- a/apps/presentationeditor/mobile/src/page/main.jsx +++ b/apps/presentationeditor/mobile/src/page/main.jsx @@ -2,6 +2,7 @@ import React, { Component } from 'react'; import { Page, View, Navbar, NavLeft, NavRight, Link, Icon } from 'framework7-react'; // import EditOptions from '../view/edit/Edit'; +import AddOptions from '../view/add/Add'; import Settings from '../view/settings/Settings'; import CollaborationView from '../../../../common/mobile/lib/view/Collaboration.jsx' @@ -10,6 +11,7 @@ export default class MainPage extends Component { super(props); this.state = { editOptionsVisible: false, + addOptionsVisible: false, settingsVisible: false, collaborationVisible: false, }; @@ -19,11 +21,11 @@ export default class MainPage extends Component { this.setState(state => { if ( opts == 'edit' ) return {editOptionsVisible: true}; - else - if ( opts == 'settings' ) + else if ( opts == 'add' ) + return {addOptionsVisible: true}; + else if ( opts == 'settings' ) return {settingsVisible: true}; - else - if ( opts == 'coauth' ) + else if ( opts == 'coauth' ) return {collaborationVisible: true} }); }; @@ -33,11 +35,11 @@ export default class MainPage extends Component { await 1 && this.setState(state => { if ( opts == 'edit' ) return {editOptionsVisible: false}; - else - if ( opts == 'settings' ) + else if ( opts == 'add' ) + return {addOptionsVisible: false}; + else if ( opts == 'settings' ) return {settingsVisible: false}; - else - if ( opts == 'coauth' ) + else if ( opts == 'coauth' ) return {collaborationVisible: false} }) })(); @@ -55,6 +57,7 @@ export default class MainPage extends Component { this.handleClickToOpenOptions('edit')}> + this.handleClickToOpenOptions('add')}> this.handleClickToOpenOptions('coauth')}> this.handleClickToOpenOptions('settings')}> @@ -65,6 +68,10 @@ export default class MainPage extends Component { {/*!this.state.editOptionsVisible ? null :*/} {/**/} {/*}*/} + { + !this.state.addOptionsVisible ? null : + + } { !this.state.settingsVisible ? null : diff --git a/apps/presentationeditor/mobile/src/view/add/Add.jsx b/apps/presentationeditor/mobile/src/view/add/Add.jsx new file mode 100644 index 000000000..d8de0afec --- /dev/null +++ b/apps/presentationeditor/mobile/src/view/add/Add.jsx @@ -0,0 +1,123 @@ +import React, {Component, useEffect} from 'react'; +import {View,Page,Navbar,NavRight,Link,Popup,Popover,Icon,Tabs,Tab} from 'framework7-react'; +import { useTranslation } from 'react-i18next'; +import {f7} from 'framework7-react'; +import { observer, inject } from "mobx-react"; +import {Device} from '../../../../../common/mobile/utils/device'; + +import AddSlideController from "../../controller/add/AddSlide"; +import AddShapeController from "../../controller/add/AddShape"; +//import AddImageController from "../../controller/add/AddImage"; +//import AddOtherController from "../../controller/add/AddOther"; + +const routes = [ + +]; + +const AddLayoutNavbar = ({ tabs, inPopover }) => { + const isAndroid = Device.android; + return ( + +
+ {tabs.map((item, index) => + + + )} + {isAndroid && } +
+ { !inPopover && } +
+ ) +}; + +const AddLayoutContent = ({ tabs }) => { + return ( + + {tabs.map((item, index) => + + {item.component} + + )} + + ) +}; + +const AddTabs = props => { + const { t } = useTranslation(); + const _t = t('Add', {returnObjects: true}); + const tabs = []; + tabs.push({ + caption: _t.textSlide, + id: 'add-slide', + icon: 'icon-add-slide', + component: + }); + tabs.push({ + caption: _t.textShape, + id: 'add-shape', + icon: 'icon-add-shape', + component: + }); + /*tabs.push({ + caption: _t.textImage, + id: 'add-image', + icon: 'icon-add-image', + component: + }); + tabs.push({ + caption: _t.textOther, + id: 'add-other', + icon: 'icon-add-other', + component: + });*/ + return ( + + + + + + + ) +}; + +class AddView extends Component { + constructor(props) { + super(props); + + this.onoptionclick = this.onoptionclick.bind(this); + } + onoptionclick(page){ + this.$f7.views.current.router.navigate(page); + } + render() { + const show_popover = this.props.usePopover; + return ( + show_popover ? + this.props.onclosed()}> + + : + this.props.onclosed()}> + + + ) + } +} + +const Add = props => { + useEffect(() => { + if ( Device.phone ) + f7.popup.open('.add-popup'); + else f7.popover.open('#add-popover', '#btn-add'); + + return () => { + // component will unmount + } + }); + const onviewclosed = () => { + if ( props.onclosed ) + props.onclosed(); + }; + return +}; + +export default Add; \ No newline at end of file diff --git a/apps/presentationeditor/mobile/src/view/add/AddShape.jsx b/apps/presentationeditor/mobile/src/view/add/AddShape.jsx new file mode 100644 index 000000000..bf408d896 --- /dev/null +++ b/apps/presentationeditor/mobile/src/view/add/AddShape.jsx @@ -0,0 +1,15 @@ +import React, {Fragment, useState} from 'react'; +import {observer, inject} from "mobx-react"; +import {Page, Navbar, List, ListItem, ListButton, Row, BlockTitle, Range, Toggle, Icon} from 'framework7-react'; +import { useTranslation } from 'react-i18next'; +import {Device} from '../../../../../common/mobile/utils/device'; + +const AddShape = props => { + return ( + + + + ) +}; + +export {AddShape}; \ No newline at end of file diff --git a/apps/presentationeditor/mobile/src/view/add/AddSlide.jsx b/apps/presentationeditor/mobile/src/view/add/AddSlide.jsx new file mode 100644 index 000000000..3a4daa85c --- /dev/null +++ b/apps/presentationeditor/mobile/src/view/add/AddSlide.jsx @@ -0,0 +1,15 @@ +import React, {Fragment, useState} from 'react'; +import {observer, inject} from "mobx-react"; +import {Page, Navbar, List, ListItem, ListButton, Row, BlockTitle, Range, Toggle, Icon} from 'framework7-react'; +import { useTranslation } from 'react-i18next'; +import {Device} from '../../../../../common/mobile/utils/device'; + +const AddSlide = props => { + return ( + + + + ) +}; + +export {AddSlide}; \ No newline at end of file