Skip to content

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

fix insets

ammarahm-ed27ee0d4c1a3e
diff --git a/apps/mobile/src/components/NotesList/index.js b/apps/mobile/src/components/NotesList/index.js
index 522e0c8ab..843a3b3f4 100644
--- a/apps/mobile/src/components/NotesList/index.js
+++ b/apps/mobile/src/components/NotesList/index.js
@@ -18,6 +18,7 @@ import {NotesPlaceHolder} from '../ListPlaceholders';
import NoteItem from '../NoteItem';
import SelectionWrapper from '../SelectionWrapper';
import {useIsFocused} from 'react-navigation-hooks';
+import {useSafeArea} from 'react-native-safe-area-context';
const sectionListRef = createRef();
export const NotesList = ({isGrouped = false}) => {
@@ -26,6 +27,7 @@ export const NotesList = ({isGrouped = false}) => {
const isFocused = useIsFocused();
const [refreshing, setRefreshing] = useState(false);
const searchResults = {...state.searchResults};
+ const insets = useSafeArea();
const _renderItem = ({item, index}) => (
<SelectionWrapper
index={index}
@@ -71,13 +73,11 @@ export const NotesList = ({isGrouped = false}) => {
marginTop:
Platform.OS == 'ios'
? notes[0] && !selectionMode
- ? DDS.isTab
- ? 115
- : 135
+ ? 135
: 135 - 60
: notes[0] && !selectionMode
- ? 155
- : 155 - 60,
+ ? 135
+ : 135 - 60 - insets.top,
}}>
<PinnedItems />
</View>
@@ -152,13 +152,11 @@ export const NotesList = ({isGrouped = false}) => {
marginTop:
Platform.OS == 'ios'
? notes[0] && !selectionMode
- ? DDS.isTab
- ? 115
- : 135
+ ? 135
: 135 - 60
: notes[0] && !selectionMode
- ? 155
- : 155 - 60,
+ ? 135
+ : 135 - 60 - insets.top,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
diff --git a/apps/mobile/src/components/SimpleList/index.js b/apps/mobile/src/components/SimpleList/index.js
index 2b0ab16e3..91fe7a6bd 100644
--- a/apps/mobile/src/components/SimpleList/index.js
+++ b/apps/mobile/src/components/SimpleList/index.js
@@ -63,8 +63,8 @@ const SimpleList = ({
? 135
: 135 - 60
: data[0] && !selectionMode
- ? 155 - insets.top
- : 155 - insets.top - 60,
+ ? 135 - insets.top
+ : 135 - insets.top - 60,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',