Skip to content

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

minor fixes

ammarahm-ed377b192f8a33
diff --git a/apps/mobile/src/components/ActionSheetComponent/index.js b/apps/mobile/src/components/ActionSheetComponent/index.js
index 67015fb04..3bb2d99a6 100644
--- a/apps/mobile/src/components/ActionSheetComponent/index.js
+++ b/apps/mobile/src/components/ActionSheetComponent/index.js
@@ -184,7 +184,7 @@ export const ActionSheetComponent = ({
},
{
name: 'Share',
- icon: 'share-2',
+ icon: 'share-variant',
func: () => {
if (note.locked) {
close('unlock_share');
@@ -202,7 +202,7 @@ export const ActionSheetComponent = ({
},
{
name: 'Export',
- icon: 'external-link',
+ icon: 'export',
func: () => {
close();
},
@@ -501,7 +501,7 @@ export const ActionSheetComponent = ({
width: '100%',
paddingHorizontal: 0,
}}>
- {!note.id ? (
+ {!note.id && !note.dateCreated ? (
<Text
style={{
width: '100%',
@@ -626,7 +626,7 @@ export const ActionSheetComponent = ({
</View>
)}
- {note.id ? (
+ {note.id || note.dateCreated ? (
<View
style={{
width: '100%',
@@ -657,7 +657,7 @@ export const ActionSheetComponent = ({
</View>
) : null}
- {hasTags && note.id ? (
+ {hasTags && (note.id || note.dateCreated) ? (
<View
style={{
marginHorizontal: 12,
diff --git a/apps/mobile/src/components/AddTopicDialog/index.js b/apps/mobile/src/components/AddTopicDialog/index.js
index 94f5c76a1..ddd1364b0 100644
--- a/apps/mobile/src/components/AddTopicDialog/index.js
+++ b/apps/mobile/src/components/AddTopicDialog/index.js
@@ -24,9 +24,8 @@ export class AddTopicDialog extends React.Component {
if (!this.title)
return ToastEvent.show('Title is required', 'error', 3000, () => {}, '');
- await db.notebooks.notebook(this.props.notebookID).topics.add(this.title);
-
- eSendEvent(eOnNewTopicAdded);
+ await db.notebooks.notebook(this.props.notebookID).topics.add(this.title),
+ eSendEvent(eOnNewTopicAdded);
ToastEvent.show('New topic added', 'success', 3000, () => {}, '');
this.close();
};
diff --git a/apps/mobile/src/components/DialogManager/index.js b/apps/mobile/src/components/DialogManager/index.js
index f6a7873f2..0299cc34e 100644
--- a/apps/mobile/src/components/DialogManager/index.js
+++ b/apps/mobile/src/components/DialogManager/index.js
@@ -101,7 +101,7 @@ export const TEMPLATE_DELETE = type => {
positiveText: 'Delete',
negativeText: 'Cancel',
action: dialogActions.ACTION_DELETE,
- icon: 'trash',
+ icon: 'delete',
};
};
@@ -112,7 +112,7 @@ export const TEMPLATE_TRASH = type => {
positiveText: 'Restore',
negativeText: 'Delete',
action: dialogActions.ACTION_TRASH,
- icon: 'trash',
+ icon: 'delete-restore',
};
};
@@ -123,7 +123,7 @@ export const TEMPLATE_EXIT_FULLSCREEN = () => {
positiveText: 'Exit',
negativeText: 'Cancel',
action: dialogActions.ACTION_EXIT_FULLSCREEN,
- icon: 'x',
+ icon: 'close',
};
};
@@ -134,7 +134,7 @@ export const TEMPLATE_EXIT = type => {
positiveText: `Close`,
negativeText: 'Cancel',
action: dialogActions.ACTION_EXIT,
- icon: 'x',
+ icon: 'close',
};
};
@@ -147,14 +147,14 @@ export const TEMPLATE_INFO = dateCreated => {
noButtons: true,
noTitle: true,
action: dialogActions.ACTION_CLOSE,
- icon: 'info',
+ icon: 'information-outline',
};
};
export const TEMPLATE_EMPTY_TRASH = {
title: 'Empty Trash',
paragraph: 'Are you sure you want to clear the trash?',
- icon: 'trash',
+ icon: 'delete-outline',
positiveText: 'Clear',
negativeText: 'Cancel',
action: dialogActions.ACTION_EMPTY_TRASH,
diff --git a/apps/mobile/src/components/Menu/index.js b/apps/mobile/src/components/Menu/index.js
index 234bc35f6..a4563b1cc 100644
--- a/apps/mobile/src/components/Menu/index.js
+++ b/apps/mobile/src/components/Menu/index.js
@@ -29,7 +29,7 @@ import {ACTIONS} from '../../provider/actions';
import {eSendEvent} from '../../services/eventManager';
import {eOpenModalMenu, eSendSideMenuOverlayRef} from '../../services/events';
import NavigationService from '../../services/NavigationService';
-import {timeSince} from '../../utils/utils';
+import {timeSince, getElevation} from '../../utils/utils';
export const Menu = ({
close = () => {},
@@ -540,7 +540,7 @@ export const Menu = ({
))}
</View>
- {user && user.username ? (
+ {!user && !user.username ? (
<View
style={{
width: '100%',
@@ -562,6 +562,8 @@ export const Menu = ({
onPress={async () => {
//await db.sync();
console.log(await db.sync(), 'SYNCED');
+ dispatch({type: ACTIONS.NOTES});
+ dispatch({type: ACTIONS.PINNED});
}}
style={{
fontFamily: WEIGHT.regular,
@@ -619,19 +621,23 @@ export const Menu = ({
}}
activeOpacity={opacity / 2}
style={{
+ ...getElevation(2),
paddingVertical: pv + 5,
- paddingHorizontal: noTextMode ? 0 : 12,
width: '100%',
justifyContent: noTextMode ? 'center' : 'flex-start',
alignItems: 'center',
flexDirection: 'row',
+ backgroundColor: colors.accent,
+ borderRadius: 5,
+ paddingHorizontal: 6,
}}>
<Icon
style={{
minWidth: 40,
+ textAlign: 'left',
}}
- name="log-in"
- color={colors.accent}
+ name="login"
+ color="white"
size={SIZE.lg}
/>
@@ -639,10 +645,10 @@ export const Menu = ({
<Text
style={{
fontFamily: WEIGHT.regular,
- color: colors.accent,
+ color: 'white',
fontSize: SIZE.md,
}}>
- {' '}Login
+ Login
</Text>
)}
</TouchableOpacity>
diff --git a/apps/mobile/src/components/NoteItem/index.js b/apps/mobile/src/components/NoteItem/index.js
index ae3ae8342..11b55ec7c 100644
--- a/apps/mobile/src/components/NoteItem/index.js
+++ b/apps/mobile/src/components/NoteItem/index.js
@@ -276,7 +276,7 @@ export default class NoteItem extends React.Component {
isTrash ? [] : ['Pin', 'Favorite', 'Add to Vault'],
);
}}>
- <Icon name="more-horizontal" size={SIZE.lg} color={colors.icon} />
+ <Icon name="dots-horizontal" size={SIZE.lg} color={colors.icon} />
</TouchableOpacity>
</View>
</View>
diff --git a/apps/mobile/src/components/NotebookItem/index.js b/apps/mobile/src/components/NotebookItem/index.js
index b0dd982c3..8806587b4 100644
--- a/apps/mobile/src/components/NotebookItem/index.js
+++ b/apps/mobile/src/components/NotebookItem/index.js
@@ -233,7 +233,7 @@ export const NotebookItem = ({
notebookID: notebookID,
});
}}>
- <Icon name="more-horizontal" size={SIZE.lg} color={colors.icon} />
+ <Icon name="dots-horizontal" size={SIZE.lg} color={colors.icon} />
</TouchableOpacity>
)}
diff --git a/apps/mobile/src/components/NotesList/index.js b/apps/mobile/src/components/NotesList/index.js
index 3e3080820..2811ce417 100644
--- a/apps/mobile/src/components/NotesList/index.js
+++ b/apps/mobile/src/components/NotesList/index.js
@@ -17,6 +17,7 @@ import {ToastEvent} from '../../utils/utils';
import {NotesPlaceHolder} from '../ListPlaceholders';
import NoteItem from '../NoteItem';
import SelectionWrapper from '../SelectionWrapper';
+import {db} from '../../../App';
export const NotesList = ({isGrouped = false}) => {
const [state, dispatch] = useTracked();
@@ -24,6 +25,7 @@ export const NotesList = ({isGrouped = false}) => {
const notes = [...state.notes];
const searchResults = [...state.searchResults];
const [refreshing, setRefreshing] = useState(false);
+
const _renderItem = ({item, index}) => (
<SelectionWrapper
index={index}
@@ -191,12 +193,20 @@ export const NotesList = ({isGrouped = false}) => {
tintColor={colors.accent}
colors={[colors.accent]}
progressViewOffset={165}
- onRefresh={() => {
+ onRefresh={async () => {
setRefreshing(true);
- setTimeout(() => {
+ try {
+ await db.sync();
+ dispatch({type: ACTIONS.NOTES});
+ dispatch({type: ACTIONS.PINNED});
+ dispatch({type: ACTIONS.FAVORITES});
+
setRefreshing(false);
ToastEvent.show('Sync Complete', 'success');
- }, 1000);
+ } catch (e) {
+ setRefreshing(false);
+ ToastEvent.show('Sync failed, network error', 'error');
+ }
}}
refreshing={refreshing}
/>
@@ -258,13 +268,13 @@ const PinnedItems = () => {
customStyle={{
backgroundColor: colors.shade,
width: '100%',
- paddingHorizontal: '5%',
+ paddingHorizontal: 12,
paddingTop: 20,
- marginHorizontal: 0,
+ paddingRight: 18,
marginBottom: 10,
- paddingHorizontal: 12,
marginTop: 20,
borderBottomWidth: 0,
+ marginHorizontal: 0,
}}
pinned={true}
item={item}
diff --git a/apps/mobile/src/views/Editor/index.js b/apps/mobile/src/views/Editor/index.js
index 8b8d13217..402a7ddae 100755
--- a/apps/mobile/src/views/Editor/index.js
+++ b/apps/mobile/src/views/Editor/index.js
@@ -421,7 +421,7 @@ const Editor = ({navigation, noMenu}) => {
paddingRight: 12,
zIndex: 800,
}}>
- <Icon name="more-horizontal" color={colors.icon} size={SIZE.xxxl} />
+ <Icon name="dots-horizontal" color={colors.icon} size={SIZE.xxxl} />
</TouchableOpacity>
</View>
diff --git a/apps/mobile/src/views/Folders/index.js b/apps/mobile/src/views/Folders/index.js
index 576c2ff7e..b4ea7bc00 100644
--- a/apps/mobile/src/views/Folders/index.js
+++ b/apps/mobile/src/views/Folders/index.js
@@ -42,6 +42,7 @@ export const Folders = ({navigation}) => {
};
useEffect(() => {
+ eSendEvent(eScrollEvent, 0);
dispatch({type: ACTIONS.NOTEBOOKS});
let backhandler;
diff --git a/apps/mobile/src/views/Home/index.js b/apps/mobile/src/views/Home/index.js
index 0e41ef9a1..2d412d55a 100755
--- a/apps/mobile/src/views/Home/index.js
+++ b/apps/mobile/src/views/Home/index.js
@@ -11,6 +11,7 @@ import {ACTIONS} from '../../provider/actions';
import {eSendEvent} from '../../services/eventManager';
import NavigationService from '../../services/NavigationService';
import {SideMenuEvent} from '../../utils/utils';
+import {eScrollEvent} from '../../services/events';
let count = 0;
export const AnimatedSafeAreaView = Animatable.createAnimatableComponent(
SafeAreaView,
@@ -22,6 +23,7 @@ export const Home = ({navigation}) => {
const isFocused = useIsFocused();
useEffect(() => {
+ eSendEvent(eScrollEvent, 0);
dispatch({type: ACTIONS.COLORS});
dispatch({type: ACTIONS.NOTES});
}, [isFocused]);
diff --git a/apps/mobile/src/views/Notebook/index.js b/apps/mobile/src/views/Notebook/index.js
index ee02bf6f3..9c301450f 100644
--- a/apps/mobile/src/views/Notebook/index.js
+++ b/apps/mobile/src/views/Notebook/index.js
@@ -29,16 +29,19 @@ export const Notebook = ({navigation}) => {
let isFocused = useIsFocused();
const onLoad = () => {
- topics = db.notebooks.notebook(navigation.state.params.notebook.dateCreated)
+ let allTopics;
+
+ allTopics = db.notebooks.notebook(navigation.state.params.notebook.id).data
.topics;
- notebook = db.notebooks.notebook(
- navigation.state.params.notebook.dateCreated,
- );
+ console.log(allTopics);
+
+ notebook = db.notebooks.notebook(navigation.state.params.notebook.id);
- setTopics([...topics]);
+ setTopics(allTopics);
};
useEffect(() => {
+ eSendEvent(eScrollEvent, 0);
params = navigation.state.params;
let topic = params.notebook.topics;
notebook = params.notebook;
diff --git a/apps/mobile/src/views/Notes/index.js b/apps/mobile/src/views/Notes/index.js
index 9d763b71a..908727573 100644
--- a/apps/mobile/src/views/Notes/index.js
+++ b/apps/mobile/src/views/Notes/index.js
@@ -25,6 +25,7 @@ export const Notes = ({navigation}) => {
}, []);
useEffect(() => {
+ eSendEvent(eScrollEvent, 0);
if (params.type === 'tag') {
let notesInTag = db.notes.tagged(params.tag.title);
setNotes([...notesInTag]);