Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react';
- import {
- AppRegistry,
- StyleSheet,
- Text,
- View,
- TouchableHighlight,
- Alert
- } from 'react-native';
- class MiniMinionClient extends Component {
- constructor(props) {
- super(props);
- }
- getStatus() {
- return fetch('http://10.0.2.2:3000/api/v1/status.json')
- .then((response) => response.json())
- .then((responseJson) => {
- return responseJson;
- })
- .catch((error) => {
- console.error(error);
- });
- }
- render() {
- var status = this.getStatus()
- return (
- <View style={styles.container}>
- <Text>Version {status.version}</Text>
- <Text>Last Update: {status.last_update}</Text>
- </View>
- );
- }
- }
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- flexDirection: 'row',
- justifyContent: 'center',
- alignItems: 'center',
- backgroundColor: '#F5FCFF',
- }
- });
- AppRegistry.registerComponent('MiniMinionClient', () => MiniMinionClient);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement