import React, {Component} from 'react'; import { ScrollView, StyleSheet, Image, Text, View, } from 'react-native'; import {SharedElementTransition} from 'react-native-navigation'; import * as Animatable from 'react-native-animatable'; const FADE_DURATION = 500; const SHOW_DURATION = 500; const HIDE_DURATION = 500; const ICON_MARGIN = 24; class Profiles extends Component { private __STRESS_TEST__: any; constructor(props) { super(props); this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent.bind(this)); this.state = { animationType: 'fadeIn' } } componentDidMount() { if (this.__STRESS_TEST__) { setTimeout(() => { this.setState({ animationType: 'fadeOut' }); this.props.navigator.pop(); }, 650); } } onNavigatorEvent(event) { if (event.id === 'backPress') { this.setState({ animationType: 'fadeOut' }); this.props.navigator.pop(); } } _renderHeader() { return ( {this._renderIcon()} {this._renderTitle()} ); } _renderTitle() { return ( {this.props.title} ); } _renderContent() { return ( {this._genRows()} ); } _genRows() { const children = []; for (let ii = 0; ii < 30; ii++) { children.push( {'row ' + ii} ); } return children; } _renderIcon() { return ( ); } render() { return ( {this._renderHeader()} {this._renderContent()} ); } } const styles = StyleSheet.create({ container: { flex: 1, flexDirection: 'column', backgroundColor: 'transparent' }, header: { height: 110, flexDirection: 'column-reverse' }, titleContainer: { marginLeft: ICON_MARGIN + 90 + +16, marginBottom: 8 }, title: { fontSize: 23, }, iconContainer: { position: 'absolute', bottom: -ICON_MARGIN, left: ICON_MARGIN }, heroIcon: { width: 90, height: 90, resizeMode: 'contain' }, body: { flex: 4, backgroundColor: 'white', }, list: { marginTop: 16, marginHorizontal: 8 } }); export default Profiles;