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={