Skip to content

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

refactor list

ammarahm-ed43d364c9eced
diff --git a/apps/mobile/src/components/SimpleList/index.js b/apps/mobile/src/components/SimpleList/index.js
index 8cba2f9fd..6667abce0 100644
--- a/apps/mobile/src/components/SimpleList/index.js
+++ b/apps/mobile/src/components/SimpleList/index.js
@@ -47,24 +47,19 @@ const SimpleList = ({
}) => {
const [state] = useTracked();
const {colors} = state;
- const [refreshing, setRefreshing] = useState(false);
-
const [dataProvider, setDataProvider] = useState(
new DataProvider((r1, r2) => {
return r1 !== r2;
}).cloneWithRows([header, {type: 'empty'}]),
);
- const insets = useSafeAreaInsets();
+ const insets = useSafeAreaInsets();
const {width, fontScale} = useWindowDimensions();
-
+ const refreshing = false;
const listData = data;
const dataType = type;
- const _onScroll = (event) => {
- if (!event) return;
- let y = event.nativeEvent.contentOffset.y;
- eSendEvent(eScrollEvent, y);
- };
+
+
useEffect(() => {
if (loading) return;
@@ -85,6 +80,12 @@ const SimpleList = ({
}
};
+ const _onScroll = (event) => {
+ if (!event) return;
+ let y = event.nativeEvent.contentOffset.y;
+ eSendEvent(eScrollEvent, y);
+ };
+
const _layoutProvider = new LayoutProvider(
(index) => {
return dataProvider.getDataForIndex(index).type;
@@ -174,6 +175,7 @@ const SimpleList = ({
index={index}
headerProps={headerProps}
jumpToDialog={jumpToDialog}
+ sortMenuButton={sortMenuButton}
/>
);
case 'empty':
@@ -238,7 +240,7 @@ const SimpleList = ({
export default SimpleList;
-const RenderSectionHeader = ({item, index, headerProps, jumpToDialog}) => {
+const RenderSectionHeader = ({item, index, headerProps, jumpToDialog,sortMenuButton}) => {
const [state] = useTracked();
const {colors} = state;