Commit b4b49f81 authored by didam's avatar didam

didim

parent a314c2c9
......@@ -6,6 +6,7 @@ import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient
import Svg, { Circle, Rect } from 'react-native-svg'
import Reactron from 'reactotron-react-native'
import Next from 'react-native-vector-icons/MaterialIcons'
import reactotron from 'reactotron-react-native'
export default class Approval extends Component {
......@@ -17,7 +18,8 @@ export default class Approval extends Component {
{ noKontrak: 'K-2001921', namaWerehouse: 'Branch-1', petugas: 'Dudung Tukimin', tglTerima: '03-03-2020', status: 'Need Approval', brand: 'Honda', type: 'Beat', noPol: 'B 4203 STW' },
],
listData: [],
loading: false
loading: false,
longPress: false
}
}
......@@ -30,7 +32,7 @@ export default class Approval extends Component {
api.create().getListApproval({
warehouse_id: 2
}).then((response) => {
console.log(JSON.stringify(response.data))
reactotron.log(response.data)
if (response.data.status == "success") {
let listData = []
response.data.data.map((item, index) => {
......@@ -45,6 +47,18 @@ export default class Approval extends Component {
})
}
postApproval() {
api.create().postApproval({
contract_id: this.state.arrayContractId
}). then((response) => {
reactotron.log(response)
})
}
handleArrayContract(item) {
}
render() {
return (
<Container style={{ flex: 1 }}>
......@@ -52,9 +66,14 @@ export default class Approval extends Component {
{this.state.listData.map((item, index) => {
return (
<View key={index} style={{ paddingHorizontal: 7 }}>
<View style={{flexDirection: 'row'}}>
{this.state.longPress && (
<View>
</View>
)}
{!this.state.loading && (
<TouchableOpacity style={{ marginTop: 10, borderRadius: 20 }} onLongPress={() => alert('takeit')} onPress={() => this.props.navigation.navigate('MenuApproval', { data: item })}>
<TouchableOpacity style={{ marginTop: 10, borderRadius: 20 }} onLongPress={() => this.handleArrayContract(item.contract_id)} delayLongPress={100} onPress={() => this.state.longPress? this.handleArrayContract(item.contract_id) : this.props.navigation.navigate('MenuApproval', { data: item })}>
<View style={{ height: 60, backgroundColor: '#e4b300', justifyContent: 'space-between', paddingHorizontal: 20, flexDirection: 'row', borderTopRightRadius: 10, borderTopLeftRadius: 10 }}>
<View style={{ justifyContent: 'center' }}>
<Text style={{ color: 'white', fontSize: 16, fontWeight: '700' }}>{item.contract_number}</Text>
......@@ -76,6 +95,8 @@ export default class Approval extends Component {
</View>
</TouchableOpacity>
)}
</View>
{this.state.loading && (
<SvgAnimatedLinearGradient
height={140}
......
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