Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
React Native Stream Group Chat Tutorial: Initialize login screen
// src/screens/Login.js
import React, { Component } from 'react';
import { View, Text, TextInput, Button } from 'react-native';
import axios from 'axios';
import StringHash from 'string-hash';
import Config from 'react-native-config';
const CHAT_SERVER = 'YOUR NGROK HTTPS URL'; // the server's base URL
class Login extends Component {
static navigationOptions = {
title: "Login"
}
state = {
username: "",
is_loading: false
}
// next: add render()
}
export default Login;
const styles = {
wrapper: {
flex: 1
},
container: {
flex: 1,
alignItems: "center",
justifyContent: "center",
padding: 20,
backgroundColor: "#FFF"
},
field_container: {
marginTop: 20
},
label: {
fontSize: 16
},
text_input: {
height: 40,
marginTop: 5,
marginBottom: 10,
borderColor: "#ccc",
borderWidth: 1,
backgroundColor: "#eaeaea",
padding: 5
},
loading_text: {
alignSelf: "center"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.