import React from 'react'; import { StyleSheet } from 'react-native';
import {createAppContainer } from 'react-navigation'; import
SafeAreaView from 'react-native-safe-area-view'; import {
createStackNavigator } from 'react-navigation-stack'; import ThankPage
from './ThankPage';
const RootStack = createStackNavigator({ Home: {
Home: HomeScreen,
Thank: ThankPage }, });
const AppContainer = createAppContainer(RootStack);
const [username, setUsername] = React.useState('');
const [password, setPassword] = React.useState('');
class HomeScreen extends React.Component { navigateToNew = () => {
this.props.navigation.navigate('ThankPage'); } render() {
const onbtnPress = () =>{
alert("Thank you") }
return (
<SafeAreaView>
<View style={styles.container}>
<Image
source = {require('./login_img.png')}
style = {{ width: 350, height: 150 }} />
<ImageBackground style={styles.imgback}
source = {require('./login_back.png')}
style = {{ width: 340, height: 250 }}>
<View style={styles.SectionStyle}>
<TextInput
style={{ height: 20,borderColor: 'gray' }}
value={username}
onChangeText={username =>setUsername(username)}
placeholder={"Username"}
underlineColorAndroid="transparent"
/>
</View>
<View style={styles.SectionStyle}>
<TextInput
style={{ height: 20,borderColor: 'gray' }}
onChangeText={password => setPassword(password)}
value={password}
placeholder={"Password"}
underlineColorAndroid="transparent"
secureTextEntry={true}
inlineImageLeft="./eye_close_icon.imageset/eye_close_icon.png"
/>
<Image source={require('./eye_close_icon.imageset/eye_close_icon.png')}
style={styles.ImageStyle} />
<TouchableOpacity
onPress={ this.navigateToNew }
>
<Image source={require('./btn_back.png')} style={styles.imgbtnok} />
<Text style={styles.white }>Submit & SYNC</Text>
</TouchableOpacity>
</View>
</SafeAreaView> ); } }
const styles = StyleSheet.create({ container: {
flex: 1,
backgroundColor: 'grey',
alignItems: 'center',
justifyContent: 'center',
margin:10, }, SectionStyle: {
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#fff',
borderWidth: .5,
borderColor: '#000',
height: 40,
borderRadius: 5 ,
margin: 25 }, imgback: {
opacity:1, }, ImageStyle: {
height: 25,
width: 25,
resizeMode : 'stretch', }, white: {
// Define your HEX color code here.
color: '#FFFFFF',
marginLeft:135,
marginTop:-55, }, imgbtnok: {
height: 80,
width: 130,
marginLeft: 120,
position: 'relative',
resizeMode : 'stretch', }, });
export default class App extends React.Component {
render() {
return ; } }