fix header

This commit is contained in:
ammarahm-ed
2020-01-31 18:40:56 +05:00
parent 430b2f847b
commit 6e2c2e0cf0
3 changed files with 22 additions and 23 deletions

View File

@@ -164,15 +164,11 @@ export const Container = ({
}}> }}>
{noSelectionHeader ? null : <SelectionHeader />} {noSelectionHeader ? null : <SelectionHeader />}
<Animatable.View <View
transition={['backgroundColor', 'opacity', 'height']}
duration={300}
style={{ style={{
position: 'absolute', position: 'absolute',
backgroundColor: colors.bg, backgroundColor: colors.bg,
zIndex: 800, zIndex: 999,
height: selectionMode ? 0 : null,
opacity: selectionMode ? 0 : 1,
width: '100%', width: '100%',
}}> }}>
<Header <Header
@@ -206,7 +202,7 @@ export const Container = ({
value={text} value={text}
/> />
) : null} ) : null}
</Animatable.View> </View>
{children} {children}

View File

@@ -27,22 +27,23 @@ export const SelectionHeader = ({navigation}) => {
return ( return (
<Animatable.View <Animatable.View
transition={['backgroundColor', 'opacity', 'height']} transition={['translateY']}
duration={300} duration={700}
useNativeDriver={true}
style={{ style={{
width: '100%', width: '100%',
position: 'absolute', position: 'absolute',
height: selectionMode height: Platform.OS === 'android' ? 50 + StatusBar.currentHeight : 50,
? Platform.OS === 'android'
? 50 + StatusBar.currentHeight
: 50
: 0,
opacity: selectionMode ? 1 : 0,
backgroundColor: colors.bg, backgroundColor: colors.bg,
paddingTop: Platform.OS === 'ios' ? 0 : StatusBar.currentHeight, paddingTop: Platform.OS === 'ios' ? 0 : StatusBar.currentHeight,
justifyContent: 'flex-end', justifyContent: 'flex-end',
zIndex: 11, zIndex: 999,
paddingHorizontal: 12, paddingHorizontal: 12,
transform: [
{
translateY: selectionMode ? 0 : -100,
},
],
}}> }}>
<View <View
style={{ style={{

View File

@@ -46,31 +46,33 @@ const SelectionWrapper = ({children, item, currentEditingNote, index}) => {
style={{ style={{
display: selectionMode ? 'flex' : 'none', display: selectionMode ? 'flex' : 'none',
opacity: selectionMode ? 1 : 0, opacity: selectionMode ? 1 : 0,
width: '10%',
height: 70,
justifyContent: 'center',
alignItems: 'center',
paddingRight: 8,
}}> }}>
<TouchableWithoutFeedback <TouchableWithoutFeedback
onPress={() => { onPress={() => {
dispatch({type: ACTIONS.SELECTED_ITEMS, item: item}); dispatch({type: ACTIONS.SELECTED_ITEMS, item: item});
}} }}
style={{ style={{
width: '10%',
height: 70,
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
paddingRight: 15,
}}> }}>
<View <View
style={{ style={{
borderWidth: 2, borderWidth: 2,
borderColor: selected ? colors.accent : colors.icon, borderColor: selected ? colors.accent : colors.icon,
width: 30, width: 25,
height: 30, height: 25,
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
borderRadius: 100, borderRadius: 100,
paddingTop: 4, paddingTop: 2,
}}> }}>
{selected ? ( {selected ? (
<Icon size={SIZE.md} color={colors.accent} name="check" /> <Icon size={SIZE.sm} color={colors.accent} name="check" />
) : null} ) : null}
</View> </View>
</TouchableWithoutFeedback> </TouchableWithoutFeedback>