Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react';
- import { SafeAreaView, ScrollView, View, StyleSheet, Text, Button} from 'react-native';
- import Icon from 'react-native-vector-icons/FontAwesome';
- import Api from '../Api';
- export default class Detalhes extends Component {
- constructor(props) {
- super(props);
- this.state = {
- immobile : null,
- }
- }
- async componentDidMount(){
- const { codImmobile } = this.props.navigation.state.params;
- const response = await Api.post("/", {class:'immobile', action:'details', id: codImmobile});
- const { data } = response;
- this.setState({immobile: data});
- console.log(this.state.immobile);
- }
- render() {
- const immob = this.state.immobile;
- //const {title_ad} = this.state.immobile;
- console.log(immob);
- //console.log(title_ad);
- return(
- <SafeAreaView>
- <ScrollView>
- <View style={styles.container}>
- <Text style={styles.title}> </Text>
- <Button title="Voltar" onPress={() => this.props.navigation.navigate('Dashboard')}/>
- </View>
- </ScrollView>
- </SafeAreaView>
- );
- }
- }
- const styles = StyleSheet.create({
- container: {
- marginTop: 5,
- flex: 1,
- justifyContent: 'center',
- alignItems: 'center',
- },
- title:{
- fontSize: 15,
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement