diff --git a/apps/mobile/src/components/SelectionWrapper/index.js b/apps/mobile/src/components/SelectionWrapper/index.js
index 91e1a1d1b..e7adff2f5 100644
--- a/apps/mobile/src/components/SelectionWrapper/index.js
+++ b/apps/mobile/src/components/SelectionWrapper/index.js
@@ -1,6 +1,7 @@
import React, {useEffect, useState} from 'react';
import {useWindowDimensions} from 'react-native';
import {useTracked} from '../../provider';
+import { useSettingStore } from '../../provider/stores';
import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/EventManager';
import {history} from '../../utils';
import {PressableButton} from '../PressableButton';
@@ -14,13 +15,14 @@ const SelectionWrapper = ({
background,
onLongPress,
onPress,
- height,
testID,
}) => {
const [state, dispatch] = useTracked();
const {colors} = state;
const [actionStrip, setActionStrip] = useState(false);
- const {fontScale} = useWindowDimensions();
+ const settings = useSettingStore(state => state.settings);
+ const listMode = item.type === "notebook" ? settings.notebooksListMode : settings.notesListMode
+ const compactMode = (item.type === 'notebook' || item.type === 'note') && listMode === "compact"
const _onLongPress = () => {
if (history.selectedItemsList.length > 0) return;
@@ -64,10 +66,7 @@ const SelectionWrapper = ({
borderRadius: 0,
overflow: 'hidden',
paddingHorizontal: 12,
- marginTop: 0,
- height: height * fontScale,
- borderBottomWidth:1,
- borderColor:colors.nav
+ paddingVertical:compactMode ? 8 : 12,
}}>
{actionStrip && (
diff --git a/apps/mobile/src/components/SimpleList/card.js b/apps/mobile/src/components/SimpleList/card.js
index 7656f116f..3ad0b1a9a 100644
--- a/apps/mobile/src/components/SimpleList/card.js
+++ b/apps/mobile/src/components/SimpleList/card.js
@@ -1,19 +1,17 @@
import React from 'react';
-import { View } from 'react-native';
+import {View} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
-import { useTracked } from '../../provider';
-import {
- useMessageStore,
- useSelectionStore
-} from '../../provider/stores';
-import { SIZE } from '../../utils/SizeUtils';
-import { PressableButton } from '../PressableButton';
+import {useTracked} from '../../provider';
+import {useMessageStore, useSelectionStore} from '../../provider/stores';
+import {hexToRGBA} from '../../utils/ColorUtils';
+import {SIZE} from '../../utils/SizeUtils';
+import {PressableButton} from '../PressableButton';
import Paragraph from '../Typography/Paragraph';
export const Card = ({color}) => {
- const [state,dispatch] = useTracked();
+ const [state, dispatch] = useTracked();
const colors = state.colors;
- color = color ? color : colors.accent
+ color = color ? color : colors.accent;
const selectionMode = useSelectionStore(state => state.selectionMode);
const messageBoardState = useMessageStore(state => state.message);
@@ -25,25 +23,33 @@ export const Card = ({color}) => {
type="transparent"
customStyle={{
paddingVertical: 12,
- width: '100%',
+ width: '95%',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-start',
paddingHorizontal: 0,
- borderRadius:0
+ borderRadius: 0,
}}>
-
+
{
marginLeft: 10,
maxWidth: '75%',
}}>
-
+
{messageBoardState.message}
+ color={colors.heading}>
{messageBoardState.actionText}
@@ -76,9 +80,7 @@ export const Card = ({color}) => {
}}>
diff --git a/apps/mobile/src/components/SimpleList/index.js b/apps/mobile/src/components/SimpleList/index.js
index bf7536748..3d3e3c5c7 100644
--- a/apps/mobile/src/components/SimpleList/index.js
+++ b/apps/mobile/src/components/SimpleList/index.js
@@ -2,7 +2,6 @@ import React, {useEffect, useRef, useState} from 'react';
import {FlatList, RefreshControl} from 'react-native';
import {useTracked} from '../../provider';
import {eSendEvent} from '../../services/EventManager';
-import SettingsService from '../../services/SettingsService';
import Sync from '../../services/Sync';
import {eScrollEvent} from '../../utils/Events';
import JumpToDialog from '../JumpToDialog';
@@ -15,14 +14,6 @@ import {Footer} from './footer';
import {Header} from './header';
import {SectionHeader} from './section-header';
-const heights = {
- note: 100,
- notebook: 110,
- tag: 80,
- topic: 80,
- header: 35,
-};
-
let renderItems = {
note: NoteWrapper,
notebook: NotebookWrapper,
@@ -33,8 +24,8 @@ let renderItems = {
const RenderItem = ({item, index}) => {
const Item = renderItems[item.itemType || item.type];
-
- return ;
+
+ return ;
};
const SimpleList = ({
@@ -43,8 +34,6 @@ const SimpleList = ({
customRefresh,
customRefreshing,
refreshCallback,
- sortMenuButton,
- jumpToDialog,
placeholderData,
loading,
headerProps = {
@@ -60,9 +49,12 @@ const SimpleList = ({
useEffect(() => {
if (!loading) {
- setTimeout(() => {
- _setLoading(false);
- }, 300);
+ setTimeout(
+ () => {
+ _setLoading(false);
+ },
+ listData.length === 0 ? 0 : 300,
+ );
} else {
_setLoading(true);
}
@@ -74,6 +66,7 @@ const SimpleList = ({
) : (
@@ -117,7 +110,7 @@ const SimpleList = ({
style={styles}
keyExtractor={_keyExtractor}
ref={scrollRef}
- data={_loading ? listData.slice(0,9) : listData}
+ data={_loading ? listData.slice(0, 9) : listData}
renderItem={renderItem}
onScroll={_onScroll}
initialNumToRender={10}
@@ -146,14 +139,16 @@ const SimpleList = ({
}
ListFooterComponent={}
ListHeaderComponent={
-
+ <>
+
+ >
}
/>
diff --git a/apps/mobile/src/components/SimpleList/sectionheader.js b/apps/mobile/src/components/SimpleList/sectionheader.js
index ef9d9d4fc..ce9ee7f51 100644
--- a/apps/mobile/src/components/SimpleList/sectionheader.js
+++ b/apps/mobile/src/components/SimpleList/sectionheader.js
@@ -1,19 +1,23 @@
import React, {useEffect, useState} from 'react';
import {TouchableOpacity, useWindowDimensions, View} from 'react-native';
import {useTracked} from '../../provider';
+import {useSettingStore} from '../../provider/stores';
import {
eSendEvent,
eSubscribeEvent,
eUnSubscribeEvent,
} from '../../services/EventManager';
+import SettingsService from '../../services/SettingsService';
import {SORT} from '../../utils';
+import {COLORS_NOTE} from '../../utils/Colors';
import {db} from '../../utils/DB';
import {eOpenJumpToDialog, eOpenSortDialog} from '../../utils/Events';
import {SIZE} from '../../utils/SizeUtils';
+import {ActionIcon} from '../ActionIcon';
import {Button} from '../Button';
import Heading from '../Typography/Heading';
-export const SectionHeader = ({item, index, type}) => {
+export const SectionHeader = ({item, index, type, title}) => {
const [state] = useTracked();
const {colors} = state;
const {fontScale} = useWindowDimensions();
@@ -23,6 +27,12 @@ export const SectionHeader = ({item, index, type}) => {
let groupBy = Object.keys(SORT).find(
key => SORT[key] === groupOptions.groupBy,
);
+
+ const color = COLORS_NOTE[title.toLowerCase()] || colors.accent;
+ const settings = useSettingStore(state => state.settings);
+ const listMode =
+ type === 'notebooks' ? settings.notebooksListMode : settings.notesListMode;
+
groupBy = !groupBy
? 'Default'
: groupBy.slice(0, 1).toUpperCase() + groupBy.slice(1, groupBy.length);
@@ -30,6 +40,7 @@ export const SectionHeader = ({item, index, type}) => {
const onUpdate = () => {
setGroupOptions({...db.settings?.getGroupOptions(type)});
};
+
useEffect(() => {
eSubscribeEvent('groupOptionsUpdate', onUpdate);
return () => {
@@ -42,17 +53,18 @@ export const SectionHeader = ({item, index, type}) => {
style={{
flexDirection: 'row',
alignItems: 'center',
- width: '100%',
+ width: '95%',
justifyContent: 'space-between',
paddingHorizontal: 12,
height: 35 * fontScale,
- backgroundColor: index === 0 ? 'transparent' : colors.nav,
- borderBottomWidth: 1,
- borderBottomColor: index !== 0 ? 'transparent' : colors.accent,
+ backgroundColor: colors.nav,
+ alignSelf: 'center',
+ borderRadius: 5,
+ marginVertical: 5,
}}>
{
- eSendEvent(eOpenJumpToDialog,type);
+ eSendEvent(eOpenJumpToDialog, type);
}}
activeOpacity={0.9}
hitSlop={{top: 10, left: 10, right: 30, bottom: 15}}
@@ -61,7 +73,7 @@ export const SectionHeader = ({item, index, type}) => {
justifyContent: 'center',
}}>
{
- {index === 0 ? (
-