Skip to content

Commit

Permalink
remove KeyboardAvoidingView from addons wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Estevão Lucas committed Nov 19, 2018
1 parent 1542639 commit fe42fc4
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { View, ScrollView, KeyboardAvoidingView, Platform } from 'react-native';
import { View, ScrollView } from 'react-native';

import style from '../style';

export default class Wrapper extends PureComponent {
render() {
const { panels, addonSelected } = this.props;

const keyboardVerticalOffset = Platform.OS === 'ios' ? 60 : 0;

const addonKeys = Object.keys(panels);

return addonKeys.map(id => {
const selected = addonSelected === id;

return (
<View key={id} style={selected ? style.flex : style.invisible}>
<KeyboardAvoidingView
behavior={Platform.OS === 'android' ? null : 'padding'}
keyboardVerticalOffset={keyboardVerticalOffset}
style={style.flex}
>
<ScrollView style={style.flex}>{panels[id].render({ active: selected })}</ScrollView>
</KeyboardAvoidingView>
<ScrollView style={style.flex}>{panels[id].render({ active: selected })}</ScrollView>
</View>
);
});
Expand Down

0 comments on commit fe42fc4

Please sign in to comment.