Commit 1e809707 authored by didam's avatar didam
parents b4b49f81 628dde04
......@@ -4,6 +4,7 @@ import { Container } from 'native-base'
import api from '../../../service/api'
import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient'
import Svg, { Circle, Rect } from 'react-native-svg'
import { NavigationEvents } from 'react-navigation'
import Reactron from 'reactotron-react-native'
import Next from 'react-native-vector-icons/MaterialIcons'
......@@ -48,6 +49,9 @@ export default class Appraisal extends Component {
render() {
return (
<Container style={{ flex: 1 }}>
<NavigationEvents
onDidFocus={() => this.getListAppraisal()}
/>
<ScrollView style={{ paddingHorizontal: 20, backgroundColor: '#F5F5F5', paddingTop: 10 }} showsVerticalScrollIndicator={false} >
{this.state.listData.map((item, index) => {
return (
......
import React, { Component } from 'react'
import { Text, View, TextInput, ScrollView, StyleSheet, TouchableOpacity } from 'react-native'
import { Text, View, TextInput, ScrollView, StyleSheet, TouchableOpacity, BackHandler } from 'react-native'
import { Collapse, CollapseHeader, CollapseBody } from "accordion-collapse-react-native";
import { Thumbnail, List, ListItem, Separator, Container } from 'native-base';
import M from 'moment'
......@@ -37,7 +37,20 @@ export default class sampleMenuAppraisal extends Component {
}
componentDidMount() {
// alert(JSON.stringify(this.state.data))
BackHandler.addEventListener('hardwareBackPress', this._onBackPressed)
}
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this._onBackPressed)
}
_onBackPressed = () => {
api.create().postDraftAppraisal({
contract_id: this.state.data.contract_id
}).then((response) => {
this.props.navigation.goBack()
return true
})
}
handlePenerimaanDate(date) {
......
......@@ -3,6 +3,7 @@ import { Text, View, ScrollView, TouchableOpacity } from 'react-native'
import { Container } from 'native-base'
import api from '../../../service/api'
import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient'
import { NavigationEvents } from 'react-navigation'
import Svg, { Circle, Rect } from 'react-native-svg'
import Reactron from 'reactotron-react-native'
import Next from 'react-native-vector-icons/MaterialIcons'
......@@ -62,6 +63,9 @@ export default class Approval extends Component {
render() {
return (
<Container style={{ flex: 1 }}>
<NavigationEvents
onDidFocus={() => this.getListAppraisal()}
/>
<ScrollView style={{ paddingHorizontal: 20, backgroundColor: '#F5F5F5', paddingTop: 10 }} showsVerticalScrollIndicator={false} >
{this.state.listData.map((item, index) => {
return (
......
......@@ -375,7 +375,31 @@ export default class sampleMenuPenerimaan3 extends Component {
</View>
</View>
</ScrollView>
{this.state.data == "" ?
<View style={{ width: '100%', justifyContent: 'center', marginTop: 20, alignSelf: 'center', alignContent: 'flex-end', alignItems: 'center' }}>
<AwesomeButton
backgroundColor={Colors.yellowBasic}
backgroundShadow={'#DBDBDB'}
backgroundPlaceholder={null}
backgroundDarker={'#FFED75'}
backgroundProgress={null}
width={120}
height={45}
raiseLevel={5}
borderRadius={10}
progressLoadingTime={1000}
progress={!this.state.progress}
onPress={next => {
setTimeout(() => {
this.handlePenerimaan()
next()
}, 300);
}}
>
<Text style={{ color: 'black', fontWeight: '700' }}>Terima</Text>
</AwesomeButton>
</View>
:
<View style={{ width: '100%', justifyContent: 'space-evenly', marginTop: 20, alignSelf: 'center', alignContent: 'flex-end', alignItems: 'center', flexDirection: 'row' }}>
<AwesomeButton
backgroundColor={Colors.yellowBasic}
......@@ -398,6 +422,7 @@ export default class sampleMenuPenerimaan3 extends Component {
>
<Text style={{ color: 'black', fontWeight: '700' }}>Batal</Text>
</AwesomeButton>
<AwesomeButton
backgroundColor={Colors.yellowBasic}
backgroundShadow={'#DBDBDB'}
......@@ -420,6 +445,8 @@ export default class sampleMenuPenerimaan3 extends Component {
<Text style={{ color: 'black', fontWeight: '700' }}>Terima</Text>
</AwesomeButton>
</View>
}
</Container>
)
}
......
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