Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

optimize ActionSheet

ammarahm-ed194f967cc539
diff --git a/apps/mobile/src/components/ActionSheetComponent/index.js b/apps/mobile/src/components/ActionSheetComponent/index.js
index 850bb5ce1..60ac35935 100644
--- a/apps/mobile/src/components/ActionSheetComponent/index.js
+++ b/apps/mobile/src/components/ActionSheetComponent/index.js
@@ -134,7 +134,7 @@ export const ActionSheetComponent = ({
Navigation.setRoutesToUpdate([
Navigation.routeNames.NotesPage,
Navigation.routeNames.Favorites,
- Navigation.routeNames.Notes
+ Navigation.routeNames.Notes,
]);
}
}
@@ -192,7 +192,6 @@ export const ActionSheetComponent = ({
func: async () => {
close();
if (note.locked) {
-
await sleep(300);
openVault({
deleteNote: true,
@@ -275,7 +274,6 @@ export const ActionSheetComponent = ({
: 'Notebook restored from trash',
type: 'success',
});
-
},
},
{
@@ -334,7 +332,6 @@ export const ActionSheetComponent = ({
await db.notebooks.notebook(note.id).pin();
}
localRefresh(item.type);
-
},
close: false,
check: true,
@@ -359,7 +356,6 @@ export const ActionSheetComponent = ({
forced: true,
});
localRefresh(item.type, true);
-
},
close: false,
check: true,
@@ -391,7 +387,6 @@ export const ActionSheetComponent = ({
setIsPinnedToMenu(db.settings.isPinned(note.id));
dispatch({type: Actions.MENU_PINS});
} catch (e) {}
-
},
close: false,
check: true,
@@ -401,7 +396,7 @@ export const ActionSheetComponent = ({
},
];
- const _renderRowItem = (rowItem) =>
+ const _renderRowItem = rowItem =>
rowItems.includes(rowItem.name) ? (
<TouchableOpacity
onPress={rowItem.func}
@@ -432,7 +427,7 @@ export const ActionSheetComponent = ({
</TouchableOpacity>
) : null;
- const _renderColumnItem = (item) =>
+ const _renderColumnItem = item =>
(note.id && columnItems.includes(item.name)) ||
(item.name === 'Dark Mode' && columnItems.includes(item.name)) ? (
<TouchableOpacity
@@ -450,7 +445,7 @@ export const ActionSheetComponent = ({
alignItems: 'flex-end',
paddingHorizontal: 12,
paddingVertical: pv,
- height:50
+ height: 50,
}}>
<View
style={{
@@ -461,7 +456,7 @@ export const ActionSheetComponent = ({
style={{
width: 30,
}}
- name={ item.icon}
+ name={item.icon}
color={item.color || colors.accent}
size={SIZE.md + 2}
/>
@@ -503,7 +498,7 @@ export const ActionSheetComponent = ({
} else {
db.vault
.add(note.id)
- .then((r) => {
+ .then(r => {
let n = db.notes.note(note.id).data;
if (n.locked) {
close();
@@ -514,7 +509,7 @@ export const ActionSheetComponent = ({
});
localRefresh(note.type);
})
- .catch(async (e) => {
+ .catch(async e => {
switch (e.message) {
case db.vault.ERRORS.noVault:
close('novault');
@@ -573,16 +568,17 @@ export const ActionSheetComponent = ({
style={{
paddingHorizontal: 12,
alignItems: 'center',
- marginVertical: 10,
+ marginTop:5,
+ marginBottom:10
}}>
<Heading size={SIZE.md}>{note?.title.replace('\n', '')}</Heading>
<Paragraph
numberOfLines={2}
style={{
- width: '100%',
+ width: '80%',
textAlign: 'center',
- maxWidth: '100%',
+ maxWidth: '80%',
}}>
{note.type === 'notebook' && note.description
? note.description
@@ -627,7 +623,7 @@ export const ActionSheetComponent = ({
.slice()
.sort((a, b) => a.dateEdited - b.dateEdited)
.slice(0, 6)
- .map((topic) => (
+ .map(topic => (
<View
key={topic.id}
style={{
diff --git a/apps/mobile/src/components/DialogManager/index.js b/apps/mobile/src/components/DialogManager/index.js
index ec192db89..cca4b3c82 100644
--- a/apps/mobile/src/components/DialogManager/index.js
+++ b/apps/mobile/src/components/DialogManager/index.js
@@ -24,7 +24,7 @@ import {
eShowGetPremium,
eThemeUpdated,
} from '../../utils/Events';
-import { sleep } from '../../utils/TimeUtils';
+import {sleep} from '../../utils/TimeUtils';
import {EditorSettings} from '../../views/Editor/EditorSettings';
import {ActionSheetComponent} from '../ActionSheetComponent';
import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';
@@ -82,7 +82,7 @@ export class DialogManager extends Component {
);
}
- _showActionSheet = (data) => {
+ _showActionSheet = data => {
this.setState(
{
actionSheetData: data,
@@ -108,7 +108,7 @@ export class DialogManager extends Component {
// this.moveNoteDialog.close();
};
- loadNote = (i) => {
+ loadNote = i => {
if (i && i.type === 'new') {
this.setState({
item: {},
@@ -125,7 +125,7 @@ export class DialogManager extends Component {
console.log(item);
this.addTopicsDialog.open({
notebookId: item?.type !== 'topic' ? item.id : item.notebookId,
- toEdit:item?.type === 'topic' ? item : null,
+ toEdit: item?.type === 'topic' ? item : null,
});
};
@@ -185,7 +185,7 @@ export class DialogManager extends Component {
eUnSubscribeEvent(eClosePremiumDialog, this.hidePremiumDialog);
}
- showPremiumDialog = (prompoInfo) => {
+ showPremiumDialog = prompoInfo => {
this.premiumDialog.open(prompoInfo);
};
@@ -201,10 +201,10 @@ export class DialogManager extends Component {
//this.loginDialog.close();
};
- showAddNotebook = (data) => {
+ showAddNotebook = data => {
this.setState(
{
- item: data.item ? data.item : data.type === "notebook" ? data : {},
+ item: data.item ? data.item : data.type === 'notebook' ? data : {},
},
() => {
this.addNotebooksDialog.open();
@@ -215,7 +215,7 @@ export class DialogManager extends Component {
this.addNotebooksDialog.close();
};
- _showSimpleDialog = (data) => {
+ _showSimpleDialog = data => {
this.setState(
{
simpleDialog: data,
@@ -225,7 +225,7 @@ export class DialogManager extends Component {
},
);
};
- _hideSimpleDialog = (data) => {
+ _hideSimpleDialog = data => {
this.simpleDialog?.hide();
};
@@ -322,7 +322,7 @@ export class DialogManager extends Component {
}}>
<ActionSheetComponent
item={item}
- setWillRefresh={(value) => {
+ setWillRefresh={value => {
this.willRefresh = true;
}}
getRef={() => this.actionSheet}
@@ -333,7 +333,7 @@ export class DialogManager extends Component {
}
rowItems={actionSheetData.rowItems}
columnItems={actionSheetData.columnItems}
- close={(value) => {
+ close={value => {
if (value) {
this.show = value;
}
@@ -344,13 +344,13 @@ export class DialogManager extends Component {
)}
<Dialog
- ref={(ref) => (this.simpleDialog = ref)}
+ ref={ref => (this.simpleDialog = ref)}
item={item}
colors={colors}
template={simpleDialog}
/>
<AddTopicDialog
- ref={(ref) => (this.addTopicsDialog = ref)}
+ ref={ref => (this.addTopicsDialog = ref)}
close={() => {
this.setState({
item: {},
@@ -359,12 +359,12 @@ export class DialogManager extends Component {
colors={colors}
/>
<AddNotebookDialog
- ref={(ref) => (this.addNotebooksDialog = ref)}
+ ref={ref => (this.addNotebooksDialog = ref)}
toEdit={item}
colors={colors}
/>
<PremiumDialog
- ref={(ref) => (this.premiumDialog = ref)}
+ ref={ref => (this.premiumDialog = ref)}
colors={colors}
/>
<LoginDialog colors={colors} />
@@ -379,9 +379,9 @@ export class DialogManager extends Component {
<VaultDialog colors={colors} />
<MoveNoteDialog colors={colors} />
<SortDialog colors={colors} />
-
+
<UpdateDialog />
- <RateDialog/>
+ <RateDialog />
</>
);
}