import React from 'react'; import { View } from 'react-native'; import { Container, Header, Title, Content, Spinner, List, ListItem, InputGroup, Input, Icon, Button, Text } from 'native-base'; import * as events from '../../services/events'; import DashboardScreen from './dashboard-screen' import Screen from './screen' export default class LoginScreen extends Screen { constructor(props) { super(props) this.configuration = this.resolve('configuration'); this.state = { account: { username: 'mokha', password: 'password' }, eventsOfInterest: [events.LOGGED_IN], }; } render() { return (
StrongLifters ({this.configuration.value_for('ENV')})
{this.content()}
) } content() { if (this.state.isLoading) { return ( ); } else { return ( this.setState({account: {username: text }})} /> this.setState({account: {password: text }})} /> {this.configuration.value_for('API_HOST')} ); } } onLogin() { this.publish({ event: events.LOGIN, username: this.state.account.username, password: this.state.account.password }); this.setState({isLoading: true}); } notify(event) { this.setState({isLoading: false}); this.loadScreen(DashboardScreen, { ...event }) } }