Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Ad1Appraisal-Mobile
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Ad1Appraisal-Mobile
Commits
5799ff8c
Commit
5799ff8c
authored
Mar 05, 2020
by
didam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
didam
parent
dbce01ac
Changes
17
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
371 additions
and
598 deletions
+371
-598
build.gradle
android/app/build.gradle
+23
-12
gradle.properties
android/gradle.properties
+7
-0
App.js
app/App.js
+1
-1
Background2.jpg
app/assets/Background2.jpg
+0
-0
Background3.jpg
app/assets/Background3.jpg
+0
-0
wh2.jpg
app/assets/wh2.jpg
+0
-0
createFormScreen.js
app/container/createFormScreen.js
+0
-147
homepageScreen.js
app/container/home/homepageScreen.js
+77
-6
listPenerimaan.js
app/container/listPenerimaan.js
+0
-49
sampleMenuPenerimaan3.js
app/container/sampleMenuPenerimaan3.js
+0
-269
constants.js
app/library/constants.js
+16
-0
images.js
app/library/images.js
+2
-3
login.js
app/login.js
+84
-62
loginNew.js
app/loginNew.js
+95
-46
appNavigation.js
app/navigation/appNavigation.js
+0
-2
api.js
app/service/api.js
+52
-0
splashScreen.js
app/splashScreen.js
+14
-1
No files found.
android/app/build.gradle
View file @
5799ff8c
...
@@ -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
=
fals
e
def
enableSeparateBuildPerCPUArchitecture
=
tru
e
/**
/**
* Run Proguard to shrink the Java bytecode in release builds.
* Run Proguard to shrink the Java bytecode in release builds.
*/
*/
def
enableProguardInReleaseBuilds
=
fals
e
def
enableProguardInReleaseBuilds
=
tru
e
/**
/**
* 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
->
...
...
android/gradle.properties
View file @
5799ff8c
...
@@ -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
app/App.js
View file @
5799ff8c
...
@@ -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/Background
–
2.jpg
→
app/assets/Background2.jpg
View file @
5799ff8c
File moved
app/assets/Background
–
3.jpg
→
app/assets/Background3.jpg
View file @
5799ff8c
File moved
app/assets/wh2.jpg
View replaced file @
dbce01ac
View file @
5799ff8c
49.8 KB
|
W:
|
H:
59.1 KB
|
W:
|
H:
2-up
Swipe
Onion skin
app/container/createFormScreen.js
deleted
100644 → 0
View file @
dbce01ac
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
>
);
}
}
app/container/home/homepageScreen.js
View file @
5799ff8c
...
@@ -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
;
app/container/listPenerimaan.js
deleted
100644 → 0
View file @
dbce01ac
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
>
)
}
}
app/container/sampleMenuPenerimaan3.js
deleted
100644 → 0
View file @
dbce01ac
This diff is collapsed.
Click to expand it.
app/library/constants.js
0 → 100644
View file @
5799ff8c
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
app/library/images.js
View file @
5799ff8c
...
@@ -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'
),
}
}
...
...
app/login.js
View file @
5799ff8c
...
@@ -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
)
{
...
@@ -18,41 +21,74 @@ class componentName extends Component {
...
@@ -18,41 +21,74 @@ class componentName extends Component {
}
}
}
}
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
}
<
/LinearGradient
>
iconName
=
{
'child'
}
<
/LinearGradient
>
iconColor
=
{
Colors
.
blackBasic
}
{
/* <Text style={{marginTop: 20, elevation: 1}}>Ad1 Appraisal.v1</Text> */
}
iconSize
=
{
20
}
{
/* </View> */
}
iconWidth
=
{
40
}
<
/LinearGradient
>
inputPadding
=
{
16
}
<
View
style
=
{{
height
:
'55%'
,
width
:
'100%'
,
backgroundColor
:
'white'
,
marginTop
:
10
}}
>
style
=
{{
borderRadius
:
5
,
backgroundColor
:
Colors
.
yellowBasic
,
borderWidth
:
1
,
borderColor
:
'#dbdbdb'
}}
<
View
style
=
{{
padding
:
30
,
width
:
'100%'
}}
>
labelStyle
=
{{
fontSize
:
14
,
marginTop
:
-
2
}}
<
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
>
<
View
style
=
{{
marginTop
:
10
}}
>
<
View
style
=
{{
height
:
75
,
marginTop
:
5
}}
>
<
Fumi
<
Text
style
=
{{
marginVertical
:
5
}}
>
Password
<
/Text
>
secureTextEntry
=
{
true
}
<
Hideo
label
=
{
'Password'
}
iconClass
=
{
FontAwesome5Icon
}
iconClass
=
{
FontAwesomeIcon
}
iconName
=
{
'key'
}
iconName
=
{
'key'
}
iconColor
=
{
Colors
.
blackBasic
}
iconColor
=
{
'white'
}
iconSize
=
{
20
}
onChangeText
=
{(
username
)
=>
this
.
setState
({
username
})}
iconWidth
=
{
40
}
// this is used as backgroundColor of icon container view.
style
=
{{
borderRadius
:
2
}}
iconBackgroundColor
=
{
Colors
.
yellowBasic
}
inputPadding
=
{
16
}
inputStyle
=
{{
color
:
'#464949'
,
backgroundColor
:
'#edf4f9'
,
borderTopRightRadius
:
10
}}
style
=
{{
borderRadius
:
5
,
backgroundColor
:
Colors
.
yellowBasic
,
borderWidth
:
1
,
borderColor
:
'#dbdbdb'
}}
labelStyle
=
{{
fontSize
:
14
,
marginTop
:
-
2
}}
/
>
/
>
{
/* <Text>Password</Text>
<TextInput value={'ads'}/> */
}
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{{
marginTop
:
40
}}
>
<
View
style
=
{{
alignItems
:
'center'
,
justifyContent
:
'center'
,
width
:
'70%'
,
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
...
@@ -62,29 +98,15 @@ class componentName extends Component {
...
@@ -62,29 +98,15 @@ class componentName extends Component {
backgroundColor
=
{
Colors
.
yellowBasic
}
backgroundColor
=
{
Colors
.
yellowBasic
}
backgroundProgress
=
{
'#ffef85'
}
backgroundProgress
=
{
'#ffef85'
}
progressLoadingTime
=
{
300
}
progressLoadingTime
=
{
300
}
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
:
Colors
.
blackBasic
,
fontWeight
:
'bold'
}}
>
Login
<
/Text
>
<
Text
style
=
{{
color
:
'#fff'
,
fontWeight
:
'bold'
}}
>
Login
<
/Text
>
<
/AwesomeButton
>
<
/AwesomeButton
>
<
/View
>
<
/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
>
<
Text
style
=
{{
marginBottom
:
50
,
elevation
:
1
}}
>
Ad1
Appraisal
.
v1
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/Container
>
<
/Container
>
...
...
app/loginNew.js
View file @
5799ff8c
...
@@ -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
]}
>
<
LinearGradient
style
=
{{
alignItems
:
'center'
,
justifyContent
:
'flex-end'
,
height
:
65
,
width
:
65
,
borderTopLeftRadius
:
20
,
borderBottomLeftRadius
:
20
,
borderBottomRightRadius
:
20
}}
colors
=
{[
Colors
.
yellowBasic
,
Colors
.
yellowBasic
]}
>
{
/* <View style={{height: 50, width: 50, borderRadius: 50, borderBottomWidth: 1, borderBottomColor: Colors.blackBasic}}/> */
}
<
Text
style
=
{{
rotation
:
90
,
fontSize
:
25
,
marginLeft
:
5
}}
>
)
<
/Text
>
<
/LinearGradient
>
<
/LinearGradient
>
{
/* <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'
}
// 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
=
{{
paddingHorizontal
:
50
,
paddingTop
:
35
,
height
:
'50%'
}}
>
<
Text
style
=
{{
marginVertical
:
5
}}
>
Password
<
/Text
>
<
View
style
=
{{
borderRadius
:
25
,
paddingHorizontal
:
20
,
alignItems
:
'center'
,
flexDirection
:
'row'
,
width
:
'100%'
,
backgroundColor
:
'rgba(237, 237, 237, .5)'
,
}}
>
<
Hideo
<
FontAwesome5Icon
name
=
{
'user-alt'
}
color
=
{
'white'
}
size
=
{
18
}
/
>
iconClass
=
{
FontAwesome5Icon
}
<
TextInput
iconName
=
{
'key
'
}
placeholder
=
{
'Username
'
}
iconColor
=
{
'white
'
}
placeholderTextColor
=
{
'#fff
'
}
// this is used as backgroundColor of icon container view.
value
=
{
this
.
state
.
username
}
iconBackgroundColor
=
{
Colors
.
yellowBasic
}
onChangeText
=
{(
username
)
=>
this
.
setState
({
username
})
}
inputStyle
=
{{
color
:
'#464949'
,
backgroundColor
:
'#edf4f9'
,
borderTopRightRadius
:
10
}}
style
=
{{
marginLeft
:
10
,
width
:
'80%'
,
color
:
'#fff'
}}
/
>
/
>
{
/* <Text>Password</Text>
<TextInput value={'ads'}/> */
}
<
/View
>
<
/View
>
<
View
style
=
{{
marginTop
:
20
,
marginBottom
:
75
,
borderRadius
:
25
,
paddingHorizontal
:
20
,
alignItems
:
'center'
,
flexDirection
:
'row'
,
width
:
'100%'
,
backgroundColor
:
'rgba(237, 237, 237, .5)'
,
}}
>
<
Fontisto
name
=
{
'locked'
}
color
=
{
'white'
}
size
=
{
18
}
/
>
<
TextInput
placeholder
=
{
'Password'
}
placeholderTextColor
=
{
'#fff'
}
secureTextEntry
=
{
!
this
.
state
.
visiblePw
}
value
=
{
this
.
state
.
password
}
onChangeText
=
{(
password
)
=>
this
.
setState
({
password
})}
style
=
{{
marginLeft
:
10
,
width
:
'80%'
,
color
:
'white'
}}
/
>
<
FontAwesome5Icon
name
=
{
this
.
state
.
visiblePw
?
'eye'
:
'eye-slash'
}
onPress
=
{()
=>
this
.
setState
({
visiblePw
:
!
this
.
state
.
visiblePw
})}
color
=
{
'white'
}
size
=
{
20
}
style
=
{{
marginLeft
:
5
}}
/
>
{
/* < */
}
<
/View
>
<
/View
>
{
/* <View style={{alignItems:'center', justifyContent: 'center', width: '70%', alignSelf:'center'}}> */
}
<
View
style
=
{{
width
:
'
70%'
,
borderRadius
:
10
,
alignSelf
:
'center'
,
marginTop
:
25
}}
>
<
View
style
=
{{
width
:
'
100%'
,
borderRadius
:
100
,
alignSelf
:
'center'
}}
>
<
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
>
<
/View
>
<
/Container
>
{
/* <View style={{alignItems:'center', justifyContent: 'center', width: '70%', alignSelf:'center'}}> */
}
{
/* </View> */
}
<
/ImageBackground
>
);
);
}
}
}
}
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
;
app/navigation/appNavigation.js
View file @
5799ff8c
...
@@ -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'
}},
...
...
app/service/api.js
0 → 100644
View file @
5799ff8c
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
app/splashScreen.js
View file @
5799ff8c
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment