Reverts changes to app-modal and changes input window for notes on iOS
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
import React from 'react'
|
||||
import {
|
||||
Dimensions,
|
||||
KeyboardAvoidingView,
|
||||
Modal,
|
||||
Platform,
|
||||
StyleSheet,
|
||||
TouchableOpacity,
|
||||
View,
|
||||
@@ -14,10 +12,6 @@ import CloseIcon from './close-icon'
|
||||
|
||||
import { Sizes, Spacing } from '../../styles'
|
||||
|
||||
const keyboardVerticalOffsetPlatformDependent = Platform.OS === 'ios' ? 40 : 0
|
||||
const keyboardBehaviorPlatformDependent =
|
||||
Platform.OS === 'ios' ? 'position' : 'padding'
|
||||
|
||||
const AppModal = ({ children, onClose }) => (
|
||||
<Modal
|
||||
animationType="fade"
|
||||
@@ -25,19 +19,13 @@ const AppModal = ({ children, onClose }) => (
|
||||
transparent={true}
|
||||
visible={true}
|
||||
>
|
||||
<KeyboardAvoidingView
|
||||
keyboardVerticalOffset={keyboardVerticalOffsetPlatformDependent}
|
||||
behavior={keyboardBehaviorPlatformDependent}
|
||||
style={styles.safeAreaView}
|
||||
>
|
||||
<TouchableOpacity onPress={onClose} style={styles.blackBackground} />
|
||||
<View style={styles.modalWindow}>
|
||||
<View style={styles.headerContainer}>
|
||||
<CloseIcon onClose={onClose} />
|
||||
</View>
|
||||
{children}
|
||||
<TouchableOpacity onPress={onClose} style={styles.blackBackground} />
|
||||
<View style={styles.modalWindow}>
|
||||
<View style={styles.headerContainer}>
|
||||
<CloseIcon onClose={onClose} />
|
||||
</View>
|
||||
</KeyboardAvoidingView>
|
||||
{children}
|
||||
</View>
|
||||
</Modal>
|
||||
)
|
||||
|
||||
@@ -74,11 +62,6 @@ const styles = StyleSheet.create({
|
||||
elevation: 2, // works on android
|
||||
minWidth: '80%',
|
||||
},
|
||||
safeAreaView: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
})
|
||||
|
||||
export default AppModal
|
||||
|
||||
Reference in New Issue
Block a user