import React from 'react'; import { StyleSheet, View, Text, Animated, Dimensions, TouchableOpacity, } from 'react-native'; import MapView, { Marker, ProviderPropType } from 'react-native-maps'; const screen = Dimensions.get('window'); class LegalLabel extends React.Component { static propTypes = { provider: ProviderPropType, }; state = { _legalLabelPositionY: new Animated.Value(10), legalLabelPositionY: 10, }; componentDidMount() { this.state._legalLabelPositionY.addListener(({ value }) => { this.setState({ legalLabelPositionY: value, }); }); } componentWillUnmount() { this.state._legalLabelPositionY.removeAllListeners(); } onPressAnimate = () => { Animated.sequence([ Animated.spring(this.state._legalLabelPositionY, { toValue: 100, }), Animated.spring(this.state._legalLabelPositionY, { toValue: 10, }), ]).start(); }; render() { const latlng = { latitude: 37.78825, longitude: -122.4324, }; const ASPECT_RATIO = screen.width / screen.height; const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; return ( Animate Bio description lorem ipsum Ullamco exercitation aliqua ullamco nostrud dolor et aliquip fugiat do aute fugiat velit in aliqua sit. Profile Photo ); } } const padding = 10; const photoSize = 80; const mapHeight = screen.height - 130; const styles = StyleSheet.create({ bio: { marginHorizontal: padding, marginBottom: 0, paddingVertical: padding / 2, }, bioText: { fontSize: 16, lineHeight: 16 * 1.5, }, username: { paddingLeft: photoSize + padding + padding, paddingTop: padding, }, usernameText: { fontSize: 36, lineHeight: 36, color: 'blue', textDecorationLine: 'underline', }, photo: { padding: 2, position: 'absolute', top: mapHeight - photoSize / 2, left: padding, borderRadius: 5, borderWidth: StyleSheet.hairlineWidth, backgroundColor: '#ccc', width: photoSize, height: photoSize, }, photoInner: { alignItems: 'center', justifyContent: 'center', flex: 1, }, photoText: { fontSize: 9, textAlign: 'center', }, map: { height: mapHeight, }, }); export default LegalLabel;