Commit c4230eab authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

font

parent 68aaf8d1
import * as React from 'react';
import Auth from './view/Auth';
import { NavigationContainer } from '@react-navigation/native';
import { persistStore, persistReducer } from 'redux-persist';
......@@ -11,15 +11,18 @@ import * as Localization from 'expo-localization';
import i18n from 'i18n-js';
import en from './lib/en';
import id from './lib/id';
import React, {useState } from 'react';
import { Text, View } from 'react-native';
import { AppLoading } from 'expo';
import * as Font from 'expo-font';
export const lang = i18n.translations = {
en:en,
id:id
}
export const set_lang = i18n.locale = Localization.locale;
export const fallbacks = i18n.fallbacks = true;
export const set_lang = i18n.locale = Localization.locale;
export const fallbacks = i18n.fallbacks = true;
const persistConfig = {
key: 'root',
......@@ -30,6 +33,8 @@ const persistReducers = persistReducer(persistConfig, rootReducer)
const store = createStore(persistReducers);
const persistor = persistStore(store)
i18n.locale = Localization.locale;
export default function App() {
return (
<Provider store={store}>
......
......@@ -1409,6 +1409,11 @@
"prop-types": "^15.6.1"
}
},
"@use-expo/font": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@use-expo/font/-/font-2.0.0.tgz",
"integrity": "sha512-oOJ2uaRyZNQg7PnQviz7nBcdrRL38zxScab4ktgtI4asa6G0dHW9wg307uJJmn0sHS04Yqtw+m0EOjDcGw3iWg=="
},
"@valdio/react-native-scrollable-tabview": {
"version": "0.8.12",
"resolved": "https://registry.npmjs.org/@valdio/react-native-scrollable-tabview/-/react-native-scrollable-tabview-0.8.12.tgz",
......
......@@ -14,6 +14,7 @@
"@react-navigation/native": "^5.0.5",
"@react-navigation/stack": "^5.0.5",
"@shankarmorwal/rn-viewpager": "^1.2.11",
"@use-expo/font": "^2.0.0",
"@valdio/react-native-scrollable-tabview": "^0.8.12",
"accordion-collapse-react-native": "^0.2.8",
"axios": "^0.19.2",
......@@ -75,5 +76,6 @@
"babel-preset-expo": "~8.0.0",
"@babel/core": "^7.0.0"
},
"private": true
}
......@@ -113,7 +113,7 @@ class Auth extends React.Component {
this.props.session_id === '' ? (
<>
{/* <Stack.Screen name="Change language" component={ChangeLanguage} /> */}
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Login" component={Login} options={{headerShown:false}} />
<Stack.Screen name="Home" component={Home} />
<Stack.Screen name="Profile" component={ProfilePage} />
<Stack.Screen name="Change Profil" component={ChangeProfile} />
......@@ -136,7 +136,7 @@ class Auth extends React.Component {
<Stack.Screen name="Card Activation" component={CardActivation} />
<Stack.Screen name="Renewal" component={Renewal} />
<Stack.Screen name="Account" component={Account} />
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Login" component={Login} options={{headerShown:false}}/>
<Stack.Screen name="Transfer Balance" component={TransferBalance} />
<Stack.Screen name="Register" component={Register} />
<Stack.Screen name="Email Confirmation" component={EmailConfirmation} />
......
import * as React from 'react';
import { Button, View, Text, TextInput, StyleSheet, Alert, Platform } from 'react-native';
import { Button, View, Text, TextInput, StyleSheet, Alert, Platform, Image } from 'react-native';
import Axios from 'axios';
import Constants from 'expo-constants';
import { connect } from 'react-redux';
import ActionType from '../redux/globalActionType';
import { BASE_URL_LOGIN } from '../model/Base_Model';
import { TouchableOpacity } from 'react-native-gesture-handler';
import { Notifications } from 'expo';
import i18n from 'i18n-js';
import { StackActions } from '@react-navigation/native';
import Spinner from 'react-native-loading-spinner-overlay';
class Login extends React.Component {
constructor(props) {
......@@ -29,7 +26,7 @@ class Login extends React.Component {
})
}
componentDidMount(){
componentDidMount() {
// console.log(this.props.language)
}
......@@ -128,7 +125,7 @@ class Login extends React.Component {
}
let prosesProps = {
proses:'Register'
proses: 'Register'
}
this.props.setProses(prosesProps);
......@@ -162,7 +159,7 @@ class Login extends React.Component {
isEmailverif: true
}
let pageProps = {
pageEmailConfirmation:true
pageEmailConfirmation: true
}
this.props.setLoginInfo(loginProps)
......@@ -182,63 +179,50 @@ class Login extends React.Component {
}
})
}
}
}
render() {
return (
<View style={styles.container}>
<Spinner
visible={this.state.spinner}
textContent={'Loading...'}
textStyle={styles.spinnerTextStyle}
<View style={{ flex: 2 }}>
<View style={{ flex: 1, flexDirection: 'row' }}>
<View style={{ flex: 3 }}>
<Image
style={{ height: '100%', width: '100%' }}
source={require('../assets/images/daun.png')}
/>
<View style={styles.form}>
<View style={{ marginRight: 10, marginLeft: 10, }}>
<Text style={{ top: 5 }}>Email</Text>
</View>
<View style={{ margin: 10 }}>
<View style={{ flex: 6 }}>
<Image
style={{ height: 150, width: 150, alignSelf: 'center', top: '20%' }}
source={require('../assets/excelso.png')}
/>
</View>
</View>
</View>
<View style={{ flex: 1, marginRight: 20, marginLeft: 20 }}>
<View style={{ flex: 1, marginRight: 20, marginLeft: 20 }}>
<Text style={{color:'white',textAlign:'center'}}>Email</Text>
<TextInput
style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5 }}
style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, borderRadius: 20 }}
onChangeText={(email) => this.setState({ email })}
autoCapitalize="none"
value={this.state.email}
keyboardType='email-address'
/>
</View>
<View style={{ marginRight: 10, marginLeft: 10 }}>
<Text style={{ top: 5 }}>{i18n.t('password')}</Text>
</View>
<View style={{ margin: 10 }}>
<View style={{ flex: 1, marginRight: 20, marginLeft: 20 }}>
<Text style={{color:'white',textAlign:'center'}}>Password</Text>
<TextInput
style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5 }}
style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, borderRadius: 20 }}
onChangeText={password => this.setState({ password })}
value={this.state.password}
secureTextEntry={true}
/>
</View>
<View style={{ marginRight: 10, marginLeft: 10 }}>
<Button
title={i18n.t('login')}
onPress={() => this.handleLoggin()}
/>
</View>
</View>
<View style={styles.footer}>
<View style={styles.container_register}>
<View style={{ flex: 1 }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('New Register')}>
<Text style={{ fontSize: 20 }}>{i18n.t('register')}</Text>
</TouchableOpacity>
</View>
<View style={{ flex: 1, }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Reset Password')}>
<Text style={{ fontSize: 20, textAlign: 'right' }}>{i18n.t('forgotPassword')}</Text>
</TouchableOpacity>
</View>
</View>
</View>
<View style={{ flex: 1, }}></View>
</View>
)
}
......@@ -247,7 +231,7 @@ class Login extends React.Component {
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
backgroundColor: '#151515',
},
form: {
......@@ -323,3 +307,61 @@ const mapStateToProps = (state) => {
}
export default connect(mapStateToProps, mapDispatchToProps)(Login);
// <Spinner
// visible={this.state.spinner}
// textContent={'Loading...'}
// textStyle={styles.spinnerTextStyle}
// />
// <View style={styles.form}>
// <View style={{ marginRight: 10, marginLeft: 10, }}>
// <Text style={{ top: 5 }}>Email</Text>
// </View>
// <View style={{ margin: 10 }}>
// <TextInput
// style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5 }}
// onChangeText={(email) => this.setState({ email })}
// autoCapitalize="none"
// value={this.state.email}
// keyboardType='email-address'
// />
// </View>
// <View style={{ marginRight: 10, marginLeft: 10 }}>
// <Text style={{ top: 5 }}>{i18n.t('password')}</Text>
// </View>
// <View style={{ margin: 10 }}>
// <TextInput
// style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5 }}
// onChangeText={password => this.setState({ password })}
// value={this.state.password}
// secureTextEntry={true}
// />
// </View>
// <View style={{ marginRight: 10, marginLeft: 10 }}>
// <Button
// title={i18n.t('login')}
// onPress={() => this.handleLoggin()}
// />
// </View>
// </View>
// <View style={styles.footer}>
// <View style={styles.container_register}>
// <View style={{ flex: 1 }}>
// <TouchableOpacity onPress={() => this.props.navigation.navigate('New Register')}>
// <Text style={{ fontSize: 20 }}>{i18n.t('register')}</Text>
// </TouchableOpacity>
// </View>
// <View style={{ flex: 1, }}>
// <TouchableOpacity onPress={() => this.props.navigation.navigate('Reset Password')}>
// <Text style={{ fontSize: 20, textAlign: 'right' }}>{i18n.t('forgotPassword')}</Text>
// </TouchableOpacity>
// </View>
// </View>
// </View>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment