Commit 5799ff8c authored by didam's avatar didam

didam

parent dbce01ac
...@@ -90,12 +90,12 @@ apply from: "../../node_modules/react-native/react.gradle" ...@@ -90,12 +90,12 @@ apply from: "../../node_modules/react-native/react.gradle"
* Upload all the APKs to the Play Store and people will download * Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device. * the correct one based on the CPU architecture of their device.
*/ */
def enableSeparateBuildPerCPUArchitecture = false def enableSeparateBuildPerCPUArchitecture = true
/** /**
* Run Proguard to shrink the Java bytecode in release builds. * Run Proguard to shrink the Java bytecode in release builds.
*/ */
def enableProguardInReleaseBuilds = false def enableProguardInReleaseBuilds = true
/** /**
* The preferred build flavor of JavaScriptCore. * The preferred build flavor of JavaScriptCore.
...@@ -139,28 +139,39 @@ android { ...@@ -139,28 +139,39 @@ android {
reset() reset()
enable enableSeparateBuildPerCPUArchitecture enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" include "armeabi-v7a", "x86"
} }
} }
signingConfigs { signingConfigs {
debug { release {
storeFile file('debug.keystore') // if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
storePassword 'android' storeFile file(MYAPP_UPLOAD_STORE_FILE)
keyAlias 'androiddebugkey' storePassword MYAPP_UPLOAD_STORE_PASSWORD
keyPassword 'android' keyAlias MYAPP_UPLOAD_KEY_ALIAS
keyPassword MYAPP_UPLOAD_KEY_PASSWORD
// }
} }
} }
buildTypes { buildTypes {
debug {
signingConfig signingConfigs.debug
}
release { release {
// Caution! In production, you need to generate your own keystore file. // Caution! In production, you need to generate your own keystore file.
// see https://facebook.github.io/react-native/docs/signed-apk-android. // see https://facebook.github.io/react-native/docs/signed-apk-android.
signingConfig signingConfigs.debug signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds minifyEnabled enableProguardInReleaseBuilds
shrinkResources true
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
} }
// release {
// // Caution! In production, you need to generate your own keystore file.
// // see https://facebook.github.io/react-native/docs/signed-apk-android.
// // signingConfig signingConfigs.debug
// // minifyEnabled enableProguardInReleaseBuilds
// // proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
// signingConfig signingConfigs.release
// minifyEnabled enableProguardInReleaseBuilds
// shrinkResources true
// proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
// }
} }
// applicationVariants are e.g. debug, release // applicationVariants are e.g. debug, release
applicationVariants.all { variant -> applicationVariants.all { variant ->
......
...@@ -17,5 +17,12 @@ ...@@ -17,5 +17,12 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true # org.gradle.parallel=true
MYAPP_UPLOAD_STORE_FILE=ad1appraisal.keystore
MYAPP_UPLOAD_KEY_ALIAS=ad1appraisal
MYAPP_UPLOAD_STORE_PASSWORD=ad12345
MYAPP_UPLOAD_KEY_PASSWORD=ad12345
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx2560m
\ No newline at end of file
...@@ -17,7 +17,7 @@ export default class App extends Component { ...@@ -17,7 +17,7 @@ export default class App extends Component {
return ( return (
<MenuProvider> <MenuProvider>
<Container> <Container>
<StatusBar backgroundColor={Colors.yellowBasic} translucent={false} barStyle={'dark-content'}/> <StatusBar backgroundColor={'#e4b300'} translucent={false} barStyle={'dark-content'}/>
<AppNavigation/> <AppNavigation/>
</Container> </Container>
</MenuProvider> </MenuProvider>
......
app/assets/wh2.jpg

49.8 KB | W: | H:

app/assets/wh2.jpg

59.1 KB | W: | H:

app/assets/wh2.jpg
app/assets/wh2.jpg
app/assets/wh2.jpg
app/assets/wh2.jpg
  • 2-up
  • Swipe
  • Onion skin
import React, { Component } from 'react';
import { View, Text, ScrollView, Animated, TextInput } from 'react-native';
import { Container, Input } from 'native-base';
export default class createFormScreen extends Component {
constructor(props) {
super(props);
this.state = {
dataFormKontrak: [
{
label: 'Kode Cabang',
value: '',
errorMessage: ''
},
{
label: 'Nama Cabang',
value: '',
errorMessage: ''
},
{
label: 'No Kontrak',
value: '',
errorMessage: ''
},
{
label: 'No SubKontrak / Collateral ID',
value: '',
errorMessage: ''
},
{
label: 'Nama Nasabah',
value: '',
errorMessage: ''
},
{
label: 'Kode Warehouse',
value: '',
errorMessage: ''
},
{
label: 'Nama Warehouse',
value: '',
errorMessage: ''
},
{
label: 'Kode Remote',
value: '',
errorMessage: ''
},
{
label: 'Tanngal Appraisal',
value: '',
errorMessage: ''
},
{
label: 'Tipe Penilaian',
value: '',
errorMessage: ''
},
{
label: 'Tipe Jaminan',
value: '',
errorMessage: ''
},
{
label: 'Lokasi Unit',
value: '',
errorMessage: ''
},
{
label: 'Keterangan Lokasi Unit',
value: '',
errorMessage: ''
},
{
label: 'Nama Petugas Tarik',
value: '',
errorMessage: ''
},
{
label: 'Int/Ext Kolektor',
value: '',
errorMessage: ''
},
{
label: 'Tanggal Masuk Warehouse',
value: '',
errorMessage: ''
},
{
label: 'Tanggal Pick up',
value: '',
errorMessage: ''
},
{
label: 'Tanggal Perubahan Data',
value: '',
errorMessage: ''
}
]
};
}
handleEditable(item) {
var text = item
var edit = true
if (String(item).includes('Kode Cabang')
|| String(item).includes('Nama Cabang') || String(item).includes('No Kontrak')
|| String(item).includes('Collateral ID' || String(item).includes('Nama Nasabah'))) {
edit = false
alert(edit)
} else {
edit = true
}
return edit
}
render() {
return (
<Container>
<Animated.ScrollView style={{flex: 1,}}>
{this.state.dataFormKontrak.map((item,index) => {
return (
<View style={{flexDirection:'row', marginTop: 5, paddingHorizontal: 10}}>
<View style={{justifyContent: "center", paddingLeft: 10, width:'50%'}}>
<Text numberOfLines={1} ellipsizeMode='tail'>{item.label}</Text>
</View>
<View style={{justifyContent: "center",}}>
<TextInput
editable={item.label.includes('Kode Cabang')? false : true}
numberOfLines={2} ellipsizeMode='tail'
placeholder='INPUT WITH ERROR MESSAGE'
value={item.value}
style={{borderColor: 'red', borderWidth: .5, height: 30, fontSize: 13, padding: 0, paddingHorizontal: 5, borderRadius: 3}}
/>
</View>
</View>
)
})}
</Animated.ScrollView>
</Container>
);
}
}
...@@ -2,7 +2,7 @@ import React, { Component } from 'react'; ...@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { Container, Text, View } from 'native-base'; import { Container, Text, View } from 'native-base';
import LinearGradient from 'react-native-linear-gradient'; import LinearGradient from 'react-native-linear-gradient';
import Colors from '../../library/colors'; import Colors from '../../library/colors';
import { TouchableOpacity } from 'react-native'; import { TouchableOpacity, ImageBackground, Image, ScrollView, StyleSheet, Dimensions} from 'react-native';
import FontAwesome5Icon from 'react-native-vector-icons/FontAwesome5'; import FontAwesome5Icon from 'react-native-vector-icons/FontAwesome5';
import { import {
Menu, Menu,
...@@ -11,6 +11,7 @@ import { ...@@ -11,6 +11,7 @@ import {
MenuTrigger, MenuTrigger,
renderers renderers
} from 'react-native-popup-menu'; } from 'react-native-popup-menu';
import Images from '../../library/images';
class HomePageScreen extends Component { class HomePageScreen extends Component {
constructor(props) { constructor(props) {
...@@ -31,9 +32,11 @@ class HomePageScreen extends Component { ...@@ -31,9 +32,11 @@ class HomePageScreen extends Component {
} }
render() { render() {
const height = Dimensions.get('window').height
const width = Dimensions.get('window').width
return ( return (
<Container> <Container style={{backgroundColor:'#f8f8f8'}}>
<LinearGradient style={{borderBottomLeftRadius: 25, height: 150, width: '100%', justifyContent:'flex-end', padding: 20}} colors={[Colors.blackBasic, Colors.yellowBasic]} start={{x: 0, y: .5}} end={{x: 0, y: .4}}> {/* <LinearGradient style={{borderBottomLeftRadius: 25, height: 150, width: '100%', justifyContent:'flex-end', padding: 20}} colors={[Colors.blackBasic, Colors.yellowBasic]} start={{x: 0, y: .5}} end={{x: 0, y: .4}}>
<View style={{flexDirection:'row', justifyContent: 'space-between',}}> <View style={{flexDirection:'row', justifyContent: 'space-between',}}>
<Text style={{color:'#fff'}}> Dadang Kuspriadi </Text> <Text style={{color:'#fff'}}> Dadang Kuspriadi </Text>
<Menu> <Menu>
...@@ -53,8 +56,61 @@ class HomePageScreen extends Component { ...@@ -53,8 +56,61 @@ class HomePageScreen extends Component {
</MenuOptions> </MenuOptions>
</Menu> </Menu>
</View> </View>
</LinearGradient> </LinearGradient> */}
<View style={{marginTop: 10, width: '100%'}}> <ImageBackground source={Images.background2} style={{width: '100%', height: 200, justifyContent:'center'}}>
<View style={{alignItems: 'center', justifyContent: 'center', marginTop: 100}}>
<Text style={{color:'#fff', fontSize: 20}}> DADANG TUKIMIN</Text>
</View>
<View style={{alignItems:'flex-end', justifyContent:'flex-end', marginTop: 20, paddingHorizontal: 20, flexDirection:'row'}}>
<Text style={{color:'#fff', fontSize: 14}}> Warehouse</Text>
<FontAwesome5Icon name={'angle-down'} color={'#fff'} size={20} style={{marginLeft: 10, marginBottom: -1}}/>
</View>
</ImageBackground>
<View style={{padding: 10, paddingVertical: 20, flexDirection: 'row'}}>
{this.state.data.map((item,index) => {
return (
<TouchableOpacity onPress={() => this.handleNav(item)} activeOpacity={.5}>
<Image source={item == 'Penerimaan'? Images.IconPenerimaan : item == 'Appraisal'? Images.IconAppraisal : Images.IconApproval} style={{width: 125, height: 125, marginLeft: 0}}/>
</TouchableOpacity>
)
})}
</View>
<View style={{width: '100%', backgroundColor:'#dbdbdb', height: 3, marginVertical: 10}}/>
<View style={{ paddingVertical: 10 }}>
<View style={{ flexDirection: 'row', alignItems: 'center', paddingHorizontal: 25 }}>
{/* <Image source={Images.newsFeed} style={{ width: 40, height: 40 }} /> */}
{/* <Text> News Feed </Text> */}
{/* <MPText text={'News Feed'} type={'regular'} fontType={'regular'} style={{ color: colors.PrimaryOldBlue, fontSize: 16, paddingLeft: 10 }} /> */}
</View>
<View style={{ flexDirection: 'row', paddingTop: 10 }}>
<ScrollView
// style={{marginStart: 10}}
showsHorizontalScrollIndicator={false}
ref={(scrollView) => { this.scrollView2 = scrollView; }}
pagingEnabled={true}
horizontal={true}
decelerationRate={0}
snapToInterval={width - 60}
snapToAlignment={"center"}
contentInset={{
top: 0,
left: 30,
bottom: 0,
right: 30,
}}>
{this.state.data.map((item, index) => {
return (
<View style={[styles.view2, { marginLeft: 20, marginRight: index == this.state.data.length - 1 ? 20 : 0 }]} >
<Image source={Images.background2} style={{ resizeMode: 'stretch', height: '100%', width: '100%', borderRadius: 10 }} />
</View>
)
})}
</ScrollView>
</View>
</View>
{/* <View style={{marginTop: 10, width: '100%'}}>
<View style={{flexDirection:'row', paddingVertical: 10, justifyContent:'center'}}> <View style={{flexDirection:'row', paddingVertical: 10, justifyContent:'center'}}>
{this.state.data.map((item, index) => { {this.state.data.map((item, index) => {
return( return(
...@@ -66,10 +122,25 @@ class HomePageScreen extends Component { ...@@ -66,10 +122,25 @@ class HomePageScreen extends Component {
})} })}
</View> </View>
</View> </View>
<View style={{width: '100%', backgroundColor:'#dbdbdb', height: 3, marginVertical: 10}}/> <View style={{width: '100%', backgroundColor:'#dbdbdb', height: 3, marginVertical: 10}}/> */}
</Container> </Container>
); );
} }
} }
const styles = StyleSheet.create({
view2: {
marginVertical: 10,
backgroundColor: '#f1edf9',
width: Dimensions.get('window').width - 100,
margin: 10,
height: 175,
borderRadius: 10,
justifyContent: 'center',
alignItems: 'center',
elevation: 3
},
})
export default HomePageScreen; export default HomePageScreen;
import React, { Component } from 'react'
import { Text, View, ScrollView } from 'react-native'
import { Container } from 'native-base'
export default class listPenerimaan extends Component {
constructor(props) {
super(props)
this.state = {
arrayDummy: [
{ noKontrak: '2001920', namaWerehouse: 'Branch-1', petugas: 'denskuy', tglTerima: '03-03-2020' }
]
}
}
render() {
return (
<Container style={{ flex: 1 }}>
<ScrollView style={{ paddingHorizontal: 20, marginVertical: 0, backgroundColor: '#F5F5F5' }} showsVerticalScrollIndicator={false} >
{this.state.arrayDummy.map((item, index) => {
return (
<View style={{ marginTop: index == 0 ? 10 : 20 }} key={index}>
<View style={{ width: '100%', backgroundColor: '#FFFFFF', borderTopLeftRadius: 15, borderTopRightRadius: 15, paddingHorizontal: 20, shadowRadius: 80 }}>
{/* <Text style={{ alignSelf: 'center', marginTop: 10, fontFamily: Fonts.type.bold, fontSize: 16 }}>{item.tempat}</Text>
<Text style={{ fontFamily: Fonts.type.light, marginTop: 10 }}>{item.jalan}</Text>
<Text style={{ fontFamily: Fonts.type.light }}>{item.waktu}</Text>
<Text style={{ fontFamily: Fonts.type.light }}>{item.mobil}</Text> */}
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
{/* <Text style={{ fontFamily: Fonts.type.light }}>{item.via}</Text>
<Text style={{ fontFamily: Fonts.type.bold }}>{item.harga}</Text> */}
</View>
</View>
<View style={{ flexDirection: 'row', justifyContent: 'center', backgroundColor: '#FFFFFF' }}>
<View style={{ borderWidth: .3, marginTop: 5, height: '1%', width: '85%', alignSelf: 'center' }} />
</View>
<View style={{ backgroundColor: '#FFFFFF', height: 60, borderBottomStartRadius: 15, borderBottomEndRadius: 15, paddingHorizontal: 20, flexDirection: 'row', paddingBottom: 10, borderTopColor: '#dedede' }}>
{/* <Ionicons name='ios-timer' size={28} color={item.status == 'Proccess' ? 'orange' : item.status == 'Cancelled' ? 'red' : 'green'} style={{ alignSelf: 'center' }} />
<Text style={{ fontFamily: Fonts.type.bold, alignSelf: 'center', marginLeft: 10, color: item.status == 'Proccess' ? 'orange' : item.status == 'Cancelled' ? 'red' : 'green', fontSize: 16 }}>{item.status}</Text> */}
</View>
</View>
)
})}
</ScrollView>
</Container>
)
}
}
This diff is collapsed.
const Constant = {
BASE_URL : 'http://103.44.149.207:8080/projectmanagement/public/mobile/',
//USER
TOKEN: 'TOKEN',
USER_ID: 'USER_ID',
USERNAME: 'USERNAME',
FULLNAME: 'FULLNAME',
EMAIL: 'EMAIL',
ROLE: 'ROLE',
TOKEN_EXPR: 'TOKEN_EXPR',
AVATAR: 'AVATAR'
}
export default Constant;
\ No newline at end of file
...@@ -5,8 +5,8 @@ const Images = { ...@@ -5,8 +5,8 @@ const Images = {
wh3: require('../assets/wh3.jpg'), wh3: require('../assets/wh3.jpg'),
wh4: require('../assets/wh4.jpg'), wh4: require('../assets/wh4.jpg'),
background1: require('../assets/Background.jpg'), background1: require('../assets/Background.jpg'),
background2: require('../assets/Background-2.jpg'), background2: require('../assets/Background2.jpg'),
background3: require('../assets/Background-3.jpg'), background3: require('../assets/Background3.jpg'),
//ICONS //ICONS
...@@ -22,7 +22,6 @@ const Images = { ...@@ -22,7 +22,6 @@ const Images = {
MenuNotification1: require('../assets/Icon/MenuNotification–1.png'), MenuNotification1: require('../assets/Icon/MenuNotification–1.png'),
MenuProfile: require('../assets/Icon/MenuProfile.png'), MenuProfile: require('../assets/Icon/MenuProfile.png'),
MenuProfile1: require('../assets/Icon/MenuProfile–1.png'), MenuProfile1: require('../assets/Icon/MenuProfile–1.png'),
ButtonBack: require('../assets/Icon/ButtonBack.png'), ButtonBack: require('../assets/Icon/ButtonBack.png'),
} }
......
...@@ -7,6 +7,9 @@ import LinearGradient from 'react-native-linear-gradient'; ...@@ -7,6 +7,9 @@ import LinearGradient from 'react-native-linear-gradient';
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome'; import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
import { Fumi } from 'react-native-textinput-effects'; import { Fumi } from 'react-native-textinput-effects';
import AwesomeButton from 'react-native-really-awesome-button'; import AwesomeButton from 'react-native-really-awesome-button';
import api from './service/api';
import AsyncStorage from '@react-native-community/async-storage';
import { StackActions, NavigationActions } from 'react-navigation';
class componentName extends Component { class componentName extends Component {
constructor(props) { constructor(props) {
...@@ -17,74 +20,93 @@ class componentName extends Component { ...@@ -17,74 +20,93 @@ class componentName extends Component {
password: '' password: ''
} }
} }
handleLogin(next) {
api.create().login({
username: 'superadmin',
password: 'eksad@2020'
}).then((Response) => {
if (Response.data.status == 'success') {
next();
this.navigateToLogin()
}
})
}
navigateToLogin() {
AsyncStorage.clear(() => {
const navigation = this.props.navigation;
const resetAction = StackActions.reset({
index: 0,
actions: [NavigationActions.navigate({ routeName: 'HomeNavigation' })],
});
navigation.dispatch(resetAction)
})
}
render() { render() {
return ( return (
<Container style={{alignItems:'center', backgroundColor: '#fcfcfc'}}> <Container style={{alignItems:'center', backgroundColor: '#fcfcfc'}}>
<LinearGradient style={{height: 100, width: '100%'}} colors={[Colors.yellowBasic, Colors.yellowBasic]}/> <LinearGradient style={{height: '45%', width:'150%', borderBottomLeftRadius: 300, borderBottomRightRadius: 300, justifyContent: 'center', alignItems:'center'}} colors={[Colors.yellowBasic, '#fcc000']} angle={155} useAngle>
<View style={{height:250, width:'100%', backgroundColor:'transparent', marginTop: 250, padding: 20}}> {/* <View style={{backgroundColor:'white', alignItems:'center'}}> */}
<View style={{height: '100%', width: '100%', backgroundColor: '#fff', justifyContent: 'center', padding: 20, borderRadius: 10}}> <LinearGradient style={{height: 100, width: 100, borderBottomLeftRadius: 40, borderTopLeftRadius: 40, borderTopRightRadius: 40, alignItems:'center', justifyContent: 'center',}} colors={[Colors.blackBasic, Colors.blackBasic]}>
<View> <LinearGradient style={{ alignItems:'center', justifyContent: 'flex-end', height: 65, width: 65, borderTopLeftRadius: 20, borderBottomLeftRadius: 20, borderBottomRightRadius: 20}} colors={[Colors.yellowBasic, Colors.yellowBasic]}>
<Fumi {/* <View style={{height: 50, width: 50, borderRadius: 50, borderBottomWidth: 1, borderBottomColor: Colors.blackBasic}}/> */}
label={'Username'} <Text style={{rotation: 90, fontSize: 25, marginLeft: 5}}>)</Text>
iconClass={FontAwesomeIcon}
iconName={'child'}
iconColor={Colors.blackBasic}
iconSize={20}
iconWidth={40}
inputPadding={16}
style={{borderRadius: 5, backgroundColor: Colors.yellowBasic, borderWidth: 1, borderColor: '#dbdbdb'}}
labelStyle={{ fontSize: 14, marginTop: -2}}
/>
</View>
<View style={{marginTop: 10}}>
<Fumi
secureTextEntry={true}
label={'Password'}
iconClass={FontAwesomeIcon}
iconName={'key'}
iconColor={Colors.blackBasic}
iconSize={20}
iconWidth={40}
style={{borderRadius: 2}}
inputPadding={16}
style={{borderRadius: 5, backgroundColor: Colors.yellowBasic, borderWidth: 1, borderColor: '#dbdbdb'}}
labelStyle={{ fontSize: 14, marginTop: -2}}
/>
</View>
<View style={{marginTop: 40}}>
<AwesomeButton
width={'100%'} raiseLevel={3} springRelease={true} type="primary"
progress
backgroundDarker={'#ffed75'}
backgroundShadow={'#dbdbdb'}
borderColor={Colors.blackBasic}
backgroundColor={Colors.yellowBasic}
backgroundProgress={'#ffef85'}
progressLoadingTime={300}
onPress={next => {
/** Do Something **/
next();
setTimeout(()=> {this.props.navigation.navigate('HomeNavigation')},300)
}}
>
<Text style={{color: Colors.blackBasic, fontWeight: 'bold'}}> Login </Text>
</AwesomeButton>
</View>
{/* <LinearGradient colors={[Colors.yellowBasic, '#d4b700', Colors.blackBasic]} style={{width: '100%', height: 40, marginTop: 20, borderRadius: 5, alignItems:'center', justifyContent: 'center',}} start={{x: 0, y: 0}} end={{x: 0, y: .9}}>
<Text style={{}}> Login </Text>
</LinearGradient> */}
</View>
</View>
<View style={{marginTop: 75, width: '100%', backgroundColor:'#fcfcfc'}}>
<View style={{backgroundColor:'white', alignItems:'center'}}>
<LinearGradient style={{height: 40, width: 40, borderBottomLeftRadius: 13, borderTopLeftRadius: 13, borderTopRightRadius: 13, alignItems:'center', justifyContent: 'center',}} colors={[Colors.blackBasic, Colors.blackBasic]}>
<LinearGradient style={{ alignItems:'center', justifyContent: 'flex-end', height: 25, width: 25, borderTopLeftRadius: 8, borderBottomLeftRadius: 8, borderBottomRightRadius: 8}} colors={[Colors.yellowBasic, Colors.yellowBasic]}>
<View style={{backgroundColor: Colors.blackBasic, height: 1, width: 15, marginBottom: 5}}/>
</LinearGradient> </LinearGradient>
</LinearGradient> </LinearGradient>
<Text style={{marginBottom: 50, elevation: 1}}>Ad1 Appraisal.v1</Text> {/* <Text style={{marginTop: 20, elevation: 1}}>Ad1 Appraisal.v1</Text> */}
{/* </View> */}
</LinearGradient>
<View style={{height: '55%', width:'100%', backgroundColor:'white', marginTop: 10}}>
<View style={{padding: 30, width:'100%'}}>
<View style={{height: 75}}>
<Text style={{marginBottom: 5}}>Username</Text>
<Hideo
iconClass={FontAwesome5Icon}
iconName={'user'}
iconColor={'white'}
onChangeText={(username) => this.setState({username})}
// this is used as backgroundColor of icon container view.
iconBackgroundColor={Colors.yellowBasic}
inputStyle={{ color: '#464949', backgroundColor: '#edf4f9', borderTopRightRadius: 10}}
/>
</View>
<View style={{height: 75, marginTop: 5}}>
<Text style={{marginVertical: 5}}>Password</Text>
<Hideo
iconClass={FontAwesome5Icon}
iconName={'key'}
iconColor={'white'}
onChangeText={(username) => this.setState({username})}
// this is used as backgroundColor of icon container view.
iconBackgroundColor={Colors.yellowBasic}
inputStyle={{ color: '#464949', backgroundColor: '#edf4f9', borderTopRightRadius: 10}}
/>
{/* <Text>Password</Text>
<TextInput value={'ads'}/> */}
</View>
</View>
<View style={{alignItems:'center', justifyContent: 'center', width: '70%', alignSelf:'center'}}>
<View style={{width: '70%', borderRadius: 10, alignSelf:'center', marginTop: 25}}>
<AwesomeButton
width={'100%'} raiseLevel={3} springRelease={true} type="primary"
progress
backgroundDarker={'#ffed75'}
backgroundShadow={'#dbdbdb'}
borderColor={Colors.blackBasic}
backgroundColor={Colors.yellowBasic}
backgroundProgress={'#ffef85'}
progressLoadingTime={300}
style={{alignSelf:'center'}}
onPress={next => {
/** Do Something **/
this.handleLogin(next)
}}
>
<Text style={{color: '#fff', fontWeight: 'bold'}}> Login </Text>
</AwesomeButton>
</View>
</View> </View>
</View> </View>
</Container> </Container>
......
...@@ -2,80 +2,129 @@ import React, { Component } from 'react'; ...@@ -2,80 +2,129 @@ import React, { Component } from 'react';
import { Container } from 'native-base'; import { Container } from 'native-base';
import LinearGradient from 'react-native-linear-gradient'; import LinearGradient from 'react-native-linear-gradient';
import Colors from './library/colors'; import Colors from './library/colors';
import { View, Text, TextInput } from 'react-native'; import { View, Text, TextInput, ImageBackground, StyleSheet, Keyboard, Image} from 'react-native';
import AwesomeButton from 'react-native-really-awesome-button'; import AwesomeButton from 'react-native-really-awesome-button';
import { Input, Icon } from 'react-native-elements'; import { Input, Icon } from 'react-native-elements';
import FontAwesome5Icon from 'react-native-vector-icons/FontAwesome5'; import FontAwesome5Icon from 'react-native-vector-icons/FontAwesome5';
import Fontisto from 'react-native-vector-icons/Fontisto'
import { Hideo } from 'react-native-textinput-effects'; import { Hideo } from 'react-native-textinput-effects';
import api from './service/api';
import AsyncStorage from '@react-native-community/async-storage';
import { StackActions, NavigationActions } from 'react-navigation';
import Images from './library/images';
class LoginScreen extends Component { class LoginScreen extends Component {
constructor(props) {
super(props)
this.state = {
username: '',
password: '',
token: '',
visiblePw: false
}
}
handleLogin(next) {
api.create().login({
username: this.state.username,
password: this.state.password
}).then((Response) => {
next();
if (Response.data.status == 'success') {
this.navigateToLogin()
} else {
alert(Response.data.message)
}
})
}
navigateToLogin() {
AsyncStorage.clear(() => {
const navigation = this.props.navigation;
const resetAction = StackActions.reset({
index: 0,
actions: [NavigationActions.navigate({ routeName: 'HomeNavigation' })],
});
navigation.dispatch(resetAction)
})
}
render() { render() {
return ( return (
<Container style={{alignItems:'center'}}> <ImageBackground source={Images.background1} style={{flex: 1, width: null, height: null, justifyContent:'center'}} resizeMode={'stretch'} resizeMethod={'auto'}>
<LinearGradient style={{height: '45%', width:'150%', borderBottomLeftRadius: 300, borderBottomRightRadius: 300, justifyContent: 'center', alignItems:'center'}} colors={[Colors.yellowBasic, '#fcc000']} angle={155} useAngle> <View style={{height: '50%', alignItems:'center', justifyContent: 'flex-end',}}>
{/* <View style={{backgroundColor:'white', alignItems:'center'}}> */} <Image source={Images.LogoApps} style={{marginBottom: 65, width: 125, height: 125}}/>
<LinearGradient style={{height: 100, width: 100, borderBottomLeftRadius: 40, borderTopLeftRadius: 40, borderTopRightRadius: 40, alignItems:'center', justifyContent: 'center',}} colors={[Colors.blackBasic, Colors.blackBasic]}> </View>
<LinearGradient style={{ alignItems:'center', justifyContent: 'flex-end', height: 65, width: 65, borderTopLeftRadius: 20, borderBottomLeftRadius: 20, borderBottomRightRadius: 20}} colors={[Colors.yellowBasic, Colors.yellowBasic]}> <View style={{paddingHorizontal: 50, paddingTop: 35, height: '50%'}}>
{/* <View style={{height: 50, width: 50, borderRadius: 50, borderBottomWidth: 1, borderBottomColor: Colors.blackBasic}}/> */} <View style={{borderRadius: 25, paddingHorizontal: 20, alignItems:'center', flexDirection:'row', width: '100%', backgroundColor:'rgba(237, 237, 237, .5)', }}>
<Text style={{rotation: 90, fontSize: 25, marginLeft: 5}}>)</Text> <FontAwesome5Icon name={'user-alt'} color={'white'} size={18} />
</LinearGradient> <TextInput
</LinearGradient> placeholder={'Username'}
{/* <Text style={{marginTop: 20, elevation: 1}}>Ad1 Appraisal.v1</Text> */} placeholderTextColor={'#fff'}
{/* </View> */} value={this.state.username}
</LinearGradient> onChangeText={(username) => this.setState({username})}
<View style={{height: '55%', width:'100%', backgroundColor:'white', marginTop: 10}}> style={{marginLeft: 10, width: '80%', color: '#fff'}}
<View style={{padding: 30, width:'100%'}}>
<View style={{height: 75}}>
<Text style={{marginBottom: 5}}>Username</Text>
<Hideo
iconClass={FontAwesome5Icon}
iconName={'user'}
iconColor={'white'}
// this is used as backgroundColor of icon container view.
iconBackgroundColor={Colors.yellowBasic}
inputStyle={{ color: '#464949', backgroundColor: '#edf4f9', borderTopRightRadius: 10}}
/> />
</View> </View>
<View style={{height: 75, marginTop: 5}}> <View style={{marginTop: 20, marginBottom: 75, borderRadius: 25, paddingHorizontal: 20, alignItems:'center', flexDirection:'row', width: '100%', backgroundColor:'rgba(237, 237, 237, .5)', }}>
<Text style={{marginVertical: 5}}>Password</Text> <Fontisto name={'locked'} color={'white'} size={18} />
<Hideo <TextInput
iconClass={FontAwesome5Icon} placeholder={'Password'}
iconName={'key'} placeholderTextColor={'#fff'}
iconColor={'white'} secureTextEntry={!this.state.visiblePw}
// this is used as backgroundColor of icon container view. value={this.state.password}
iconBackgroundColor={Colors.yellowBasic} onChangeText={(password) => this.setState({password})}
inputStyle={{ color: '#464949', backgroundColor: '#edf4f9', borderTopRightRadius: 10}} style={{marginLeft: 10, width: '80%', color: 'white'}}
/> />
{/* <Text>Password</Text> <FontAwesome5Icon name={this.state.visiblePw? 'eye' : 'eye-slash' } onPress={() => this.setState({visiblePw: !this.state.visiblePw})} color={'white'} size={20} style={{marginLeft: 5}}/>
<TextInput value={'ads'}/> */} {/* < */}
</View> </View>
</View>
{/* <View style={{alignItems:'center', justifyContent: 'center', width: '70%', alignSelf:'center'}}> */} <View style={{width: '100%', borderRadius: 100, alignSelf:'center'}}>
<View style={{width: '70%', borderRadius: 10, alignSelf:'center', marginTop: 25}}>
<AwesomeButton <AwesomeButton
width={'100%'} raiseLevel={3} springRelease={true} type="primary" width={'100%'} raiseLevel={3} springRelease={true} type="primary"
progress progress
backgroundDarker={'#ffed75'} backgroundDarker={'#e3b91f'}
backgroundShadow={'#dbdbdb'} backgroundShadow={'#e3c143'}
borderColor={Colors.blackBasic} borderColor={Colors.blackBasic}
backgroundColor={Colors.yellowBasic} backgroundColor={'#e4b300'}
backgroundProgress={'#ffef85'} backgroundProgress={'#ffef85'}
progressLoadingTime={300} progressLoadingTime={300}
borderRadius={50}
style={{alignSelf:'center'}} style={{alignSelf:'center'}}
onPress={next => { onPress={next => {
/** Do Something **/ /** Do Something **/
next(); this.handleLogin(next)
setTimeout(()=> {this.props.navigation.navigate('HomeNavigation')},300)
}} }}
> >
<Text style={{color: '#fff', fontWeight: 'bold'}}> Login </Text> <Text style={{color: Colors.blackBasic, fontWeight: 'bold'}}> Login </Text>
</AwesomeButton> </AwesomeButton>
</View> </View>
</View>
{/* <View style={{alignItems:'center', justifyContent: 'center', width: '70%', alignSelf:'center'}}> */}
{/* </View> */} {/* </View> */}
</View> </ImageBackground>
</Container>
); );
} }
} }
const Styles = StyleSheet.create({
segitigaBiru: {
marginTop: 100,
alignSelf: 'center',
width: 0,
height: 0,
borderLeftWidth: 50,
borderRightWidth: 50,
borderBottomWidth: 100,
borderStyle: 'solid',
backgroundColor: 'transparent',
borderLeftColor: 'transparent',
borderRightColor: 'transparent',
borderBottomColor: '#00BCD4'
}
})
export default LoginScreen; export default LoginScreen;
...@@ -28,7 +28,6 @@ import Ionicons from 'react-native-vector-icons/Ionicons' ...@@ -28,7 +28,6 @@ import Ionicons from 'react-native-vector-icons/Ionicons'
import { View , Image} from 'react-native'; import { View , Image} from 'react-native';
import LinearGradient from 'react-native-linear-gradient'; import LinearGradient from 'react-native-linear-gradient';
import { TouchableOpacity } from 'react-native-gesture-handler'; import { TouchableOpacity } from 'react-native-gesture-handler';
import CreateFormScreen from '../container/createFormScreen';
import Colors from '../library/colors'; import Colors from '../library/colors';
import HomeTabNavigation from './homeTabNavigation'; import HomeTabNavigation from './homeTabNavigation';
...@@ -38,7 +37,6 @@ const MainNavigator = createStackNavigator({ ...@@ -38,7 +37,6 @@ const MainNavigator = createStackNavigator({
Splash: { screen: SplashScreen, navigationOptions: { header: null}}, Splash: { screen: SplashScreen, navigationOptions: { header: null}},
HomeNavigation: { screen: HomeTabNavigation, navigationOptions: { header: null}}, HomeNavigation: { screen: HomeTabNavigation, navigationOptions: { header: null}},
HomepageScreen: { screen: HomepageScreen, navigationOptions: { header: null} }, HomepageScreen: { screen: HomepageScreen, navigationOptions: { header: null} },
CreateFromScreen: { screen: CreateFormScreen, navigationOptions: { header: null}},
Appraisal: { screen: Appraisal, navigationOptions: { title: 'Appraisal'}}, Appraisal: { screen: Appraisal, navigationOptions: { title: 'Appraisal'}},
MenuAppraisal: { screen: MenuAppraisal, navigationOptions: { title: 'Menu Appraisal'}}, MenuAppraisal: { screen: MenuAppraisal, navigationOptions: { title: 'Menu Appraisal'}},
MenuAppraisal2: { screen: MenuAppraisal2, navigationOptions: { title: 'Menu Appraisal'}}, MenuAppraisal2: { screen: MenuAppraisal2, navigationOptions: { title: 'Menu Appraisal'}},
......
import apisauce from 'apisauce'
import AsyncStorage from '@react-native-community/async-storage';
import Constant from '../library/constants'
const create = () => {
const api = apisauce.create({
baseURL: `${Constant.BASE_URL}`,
// baseURL: Constant.BASE_URL.MASTER_DEMO,
headers: {
'Cache-Control': 'no-cache',
},
timeout: 30000
})
api.addAsyncRequestTransform(request => async () => {
var token
var url
try {
const res = await AsyncStorage.getItem(Constant.TOKEN)
const url = await AsyncStorage.getItem(Constant.BASE_URL)
if (res != null) {
token = res
// alert(url)
// api.setBaseURL(`${url}/api/`)
} else {
token = ""
// url = Constant.BASE_URL.MASTER + '/api/'
// alert(url)
// api.setBaseURL(`${url}/api/`)
}
} catch (error) {
// console.tron.log(error)
}
request.headers['token'] = token
// console.tron.log(url)
})
//Inisialisasi
const GET = api.get
const POST = api.post
const methodGET = () => GET('something')
const methodPost = (value) => POST('something', value)
const login = (value) => POST('auth/login', value)
return {
login
}
}
export default {create};
\ No newline at end of file
...@@ -3,11 +3,24 @@ import { Container } from 'native-base'; ...@@ -3,11 +3,24 @@ import { Container } from 'native-base';
import Colors from './library/colors'; import Colors from './library/colors';
import LinearGradient from 'react-native-linear-gradient'; import LinearGradient from 'react-native-linear-gradient';
import { View, Text } from 'react-native'; import { View, Text } from 'react-native';
import AsyncStorage from '@react-native-community/async-storage'
import { StackActions, NavigationActions } from 'react-navigation';
class SplashScreen extends Component { class SplashScreen extends Component {
componentDidMount() { componentDidMount() {
setTimeout(() => { this.props.navigation.navigate('LoginNew') }, 3000) setTimeout(() => { this.navigateToLogin() }, 3000)
}
navigateToLogin() {
AsyncStorage.clear(() => {
const navigation = this.props.navigation;
const resetAction = StackActions.reset({
index: 0,
actions: [NavigationActions.navigate({ routeName: 'LoginNew' })],
});
navigation.dispatch(resetAction)
})
} }
render() { render() {
......
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