Skip to content

Commit

Permalink
Mobile: Resolves #1044: Add create sub-notebook feature (#7728)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosngo committed Feb 8, 2023
1 parent c90865c commit f5fc1f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/app-mobile/components/screens/folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
13 changes: 13 additions & 0 deletions packages/app-mobile/components/side-menu-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => {
Expand Down

0 comments on commit f5fc1f2

Please sign in to comment.