import * as React from 'react' import { NavigationScreenConfigProps } from 'react-navigation' import { StyleSheet, View, Text, TouchableOpacity, TextInput, Animated } from 'react-native' import { CollapsibleHeaderFlatList, CollapsibleHeaderProps } from 'react-native-collapsible-header-views' import { isIphoneX, getStatusBarHeight } from 'react-native-iphone-x-helper' import { all } from 'cat-names' export class ShowAndHide extends React.Component { public state = { text: '' } private header = (props: CollapsibleHeaderProps) => ( this.props.navigation.goBack()}> {'<-'} this.setState({ text })} value={this.state.text} /> ) render() { return ( cat.includes(this.state.text))} renderItem={Item} ItemSeparatorComponent={Separator} keyExtractor={keyExtractor} /> ) } } const keyExtractor = (item: string, _index: number) => `${item}` const statusBarHeight = () => isIphoneX() ? getStatusBarHeight(false) : 0 const Item = ({ item }: { item: string }) => ( {item} ) const Separator = () => ( ) const styles = StyleSheet.create({ container: { backgroundColor: 'wheat', marginTop: statusBarHeight() }, item: { paddingLeft: 20, paddingVertical: 20, backgroundColor: 'wheat' }, separator: { height: 1, backgroundColor: 'gray' }, header: { justifyContent: 'flex-start', alignItems: 'center', flexDirection: 'row', paddingTop: statusBarHeight() }, backButton: { height: 94, width: 94, marginHorizontal: 3, justifyContent: 'center', alignItems: 'center', borderRadius: 3, backgroundColor: 'green' }, title: { fontWeight: 'bold', fontSize: 20, color: 'white' }, headerInput: { height: 94, flex: 1, backgroundColor: 'white', borderRadius: 3, margin: 3 } })