From 4bcdbe49649c712346b55ea1eb745700d7937e09 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Tue, 12 May 2020 02:21:25 +0500 Subject: [PATCH] make Notebook dialog fullscreen --- .../src/components/AddNotebookDialog/index.js | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/apps/mobile/src/components/AddNotebookDialog/index.js b/apps/mobile/src/components/AddNotebookDialog/index.js index 67ddbb1d3..ffe4bb056 100644 --- a/apps/mobile/src/components/AddNotebookDialog/index.js +++ b/apps/mobile/src/components/AddNotebookDialog/index.js @@ -127,8 +127,9 @@ export class AddNotebookDialog extends React.Component { description: this.description, id: id, }); - + console.log(t); await db.notebooks.notebook(id).topics.add(...t); + } else { await db.notebooks.add({ title: this.title, @@ -232,10 +233,10 @@ export class AddNotebookDialog extends React.Component { /> - + {toEdit && toEdit.dateCreated ? 'Edit Notebook' @@ -263,18 +264,20 @@ export class AddNotebookDialog extends React.Component { (this.titleRef = ref)} style={{ - padding: pv - 5, + padding: pv - 2, borderWidth: 1.5, borderColor: titleFocused ? colors.accent : colors.nav, paddingHorizontal: ph, borderRadius: 5, + minHeight: 45, fontSize: SIZE.sm, - height: 35, fontFamily: WEIGHT.regular, color: colors.pri, marginTop: 20, marginBottom: 5, }} + numberOfLines={1} + multiline={false} onFocus={() => { this.setState({ titleFocused: true, @@ -298,13 +301,12 @@ export class AddNotebookDialog extends React.Component { (this.descriptionRef = ref)} style={{ - padding: pv - 5, + padding: pv -2 , borderWidth: 1.5, borderColor: descFocused ? colors.accent : colors.nav, paddingHorizontal: ph, borderRadius: 5, - minHeight: 35, - fontSize: SIZE.xs + 1, + fontSize: SIZE.sm, fontFamily: WEIGHT.regular, color: colors.pri, marginTop: 5, @@ -312,6 +314,7 @@ export class AddNotebookDialog extends React.Component { }} textAlignVertical="top" numberOfLines={2} + maxLength={150} onFocus={() => { this.setState({ descFocused: true, @@ -330,7 +333,7 @@ export class AddNotebookDialog extends React.Component { this.topicInputRef.focus(); }} multiline - placeholder="Write a short description about notebook (optional)" + placeholder="Write a short description about your notebook (optional)" placeholderTextColor={colors.icon} /> @@ -368,11 +371,11 @@ export class AddNotebookDialog extends React.Component { }} onSubmitEditing={this.onSubmit} style={{ - padding: pv - 5, + padding: pv - 2, paddingHorizontal: 0, borderRadius: 5, borderWidth: 1.5, - height: 35, + minHeight: 45, fontSize: SIZE.sm, borderColor: topicInputFoused ? colors.accent : colors.nav, fontFamily: WEIGHT.regular, @@ -381,7 +384,7 @@ export class AddNotebookDialog extends React.Component { width: '85%', maxWidth: '85%', }} - placeholder="Add a topic" + placeholder="Add a new topic" placeholderTextColor={colors.icon} /> - Add + {toEdit && toEdit.dateCreated ? 'Save' : 'Add'}