fix insets

This commit is contained in:
ammarahm-ed
2020-04-20 09:31:21 +05:00
parent a25b76a6ec
commit 27ee0d4c1a
2 changed files with 10 additions and 12 deletions

View File

@@ -18,6 +18,7 @@ import {NotesPlaceHolder} from '../ListPlaceholders';
import NoteItem from '../NoteItem'; import NoteItem from '../NoteItem';
import SelectionWrapper from '../SelectionWrapper'; import SelectionWrapper from '../SelectionWrapper';
import {useIsFocused} from 'react-navigation-hooks'; import {useIsFocused} from 'react-navigation-hooks';
import {useSafeArea} from 'react-native-safe-area-context';
const sectionListRef = createRef(); const sectionListRef = createRef();
export const NotesList = ({isGrouped = false}) => { export const NotesList = ({isGrouped = false}) => {
@@ -26,6 +27,7 @@ export const NotesList = ({isGrouped = false}) => {
const isFocused = useIsFocused(); const isFocused = useIsFocused();
const [refreshing, setRefreshing] = useState(false); const [refreshing, setRefreshing] = useState(false);
const searchResults = {...state.searchResults}; const searchResults = {...state.searchResults};
const insets = useSafeArea();
const _renderItem = ({item, index}) => ( const _renderItem = ({item, index}) => (
<SelectionWrapper <SelectionWrapper
index={index} index={index}
@@ -71,13 +73,11 @@ export const NotesList = ({isGrouped = false}) => {
marginTop: marginTop:
Platform.OS == 'ios' Platform.OS == 'ios'
? notes[0] && !selectionMode ? notes[0] && !selectionMode
? DDS.isTab ? 135
? 115
: 135
: 135 - 60 : 135 - 60
: notes[0] && !selectionMode : notes[0] && !selectionMode
? 155 ? 135
: 155 - 60, : 135 - 60 - insets.top,
}}> }}>
<PinnedItems /> <PinnedItems />
</View> </View>
@@ -152,13 +152,11 @@ export const NotesList = ({isGrouped = false}) => {
marginTop: marginTop:
Platform.OS == 'ios' Platform.OS == 'ios'
? notes[0] && !selectionMode ? notes[0] && !selectionMode
? DDS.isTab ? 135
? 115
: 135
: 135 - 60 : 135 - 60
: notes[0] && !selectionMode : notes[0] && !selectionMode
? 155 ? 135
: 155 - 60, : 135 - 60 - insets.top,
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
justifyContent: 'space-between', justifyContent: 'space-between',

View File

@@ -63,8 +63,8 @@ const SimpleList = ({
? 135 ? 135
: 135 - 60 : 135 - 60
: data[0] && !selectionMode : data[0] && !selectionMode
? 155 - insets.top ? 135 - insets.top
: 155 - insets.top - 60, : 135 - insets.top - 60,
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
justifyContent: 'space-between', justifyContent: 'space-between',