From f5fc1f2f22abaa792f524a6b9c4fefb1039825b4 Mon Sep 17 00:00:00 2001 From: Carlos Date: Wed, 8 Feb 2023 22:34:29 +0800 Subject: [PATCH] Mobile: Resolves #1044: Add create sub-notebook feature (#7728) --- packages/app-mobile/components/screens/folder.js | 4 ++++ .../app-mobile/components/side-menu-content.tsx | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/packages/app-mobile/components/screens/folder.js b/packages/app-mobile/components/screens/folder.js index 5dc8a2b90..d95ce5031 100644 --- a/packages/app-mobile/components/screens/folder.js +++ b/packages/app-mobile/components/screens/folder.js @@ -63,6 +63,10 @@ class FolderScreenComponent extends BaseScreenComponent { async saveFolderButton_press() { let folder = Object.assign({}, this.state.folder); + if (this.props.navigation.state.parentFolderId) { + folder.parent_id = this.props.navigation.state.parentFolderId; + } + try { folder = await Folder.save(folder, { userSideValidation: true }); } catch (error) { diff --git a/packages/app-mobile/components/side-menu-content.tsx b/packages/app-mobile/components/side-menu-content.tsx index ba02636b8..77c758c62 100644 --- a/packages/app-mobile/components/side-menu-content.tsx +++ b/packages/app-mobile/components/side-menu-content.tsx @@ -138,6 +138,19 @@ const SideMenuContentComponent = (props: Props) => { '', _('Notebook: %s', folder.title), [ + { + text: _('New sub-notebook'), + onPress: () => { + props.dispatch({ type: 'SIDE_MENU_CLOSE' }); + + props.dispatch({ + type: 'NAV_GO', + routeName: 'Folder', + folderId: null, + parentFolderId: folder.id, + }); + }, + }, { text: _('Rename'), onPress: () => {