Skip to content

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

improve multi-select ux

ammarahm-ed65868d66a5ae
diff --git a/apps/mobile/src/components/SelectionHeader/index.js b/apps/mobile/src/components/SelectionHeader/index.js
index f0a754988..f6b89dc05 100644
--- a/apps/mobile/src/components/SelectionHeader/index.js
+++ b/apps/mobile/src/components/SelectionHeader/index.js
@@ -122,8 +122,15 @@ export const SelectionHeader = ({navigation}) => {
{currentScreen === 'trash' || currentScreen === 'notebooks' ? null : (
<TouchableOpacity
onPress={async () => {
+ let favCount = 0;
+ let unFavCount = 0;
if (selectedItemsList.length > 0) {
selectedItemsList.forEach(async item => {
+ if (item.favorite) {
+ favCount += 1;
+ } else {
+ unFavCount += 1;
+ }
await db.notes.note(item.id).favorite();
dispatch({type: ACTIONS.NOTES});
dispatch({type: ACTIONS.FAVORITES});
@@ -133,7 +140,13 @@ export const SelectionHeader = ({navigation}) => {
dispatch({type: ACTIONS.CLEAR_SELECTION});
- ToastEvent.show('Notes added to favorites', 'success');
+ ToastEvent.show(
+ favCount +
+ ' notes added to favorites &' +
+ unFavCount +
+ 'removed',
+ 'success',
+ );
}
}}>
<Icon
diff --git a/apps/mobile/src/views/Folders/index.js b/apps/mobile/src/views/Folders/index.js
index 435fcaa58..f9a048947 100644
--- a/apps/mobile/src/views/Folders/index.js
+++ b/apps/mobile/src/views/Folders/index.js
@@ -34,8 +34,6 @@ export const Folders = ({navigation}) => {
const [refreshing, setRefreshing] = useState(false);
let isFocused = useIsFocused();
- ///
-
const handleBackPress = () => {
alert('here');
return true;
@@ -143,20 +141,20 @@ export const Folders = ({navigation}) => {
<NotebookItem
hideMore={params.hideMore}
customStyle={{
- width: selectionMode ? w - 74 : '100%',
+ backgroundColor: Platform.ios
+ ? hexToRGBA(colors.accent + '19')
+ : hexToRGBA(colors.shade),
+ width: '100%',
+ paddingHorizontal: 12,
+ paddingTop: 20,
+ paddingRight: 18,
+ marginBottom: 10,
+ marginTop: 20,
+ borderBottomWidth: 0,
marginHorizontal: 0,
}}
isMove={params.isMove}
- onLongPress={() => {
- dispatch({
- type: ACTIONS.SELECTION_MODE,
- enabled: !selectionMode,
- });
- dispatch({
- type: ACTIONS.SELECTED_ITEMS,
- item: item,
- });
- }}
+ onLongPress={() => {}}
noteToMove={params.note}
item={item}
pinned={true}