Commit 50c0c1d5 authored by didam's avatar didam

didam

parent 0fb3b39d
import React, { Component } from 'react';
import { Container, Text } from 'native-base';
import { View, ScrollView } from 'react-native';
import { View, ScrollView, BackHandler } from 'react-native';
import M from 'moment'
import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient'
import Svg, { Circle, Rect } from 'react-native-svg'
......@@ -84,8 +84,18 @@ class History extends Component {
this.setState({ dataLoad: true, loading: false })
}, 2000);
this.getHistory()
BackHandler.addEventListener("hardwareBackPress", this.onBackPressed);
}
componentWillUnmount() {
BackHandler.removeEventListener("hardwareBackPress", this.onBackPressed);
}
onBackPressed = () => {
this.props.navigation.goBack();
return true;
};
getHistory() {
api.create().getHistory().then((response) => {
......
import React, { Component } from 'react'
import { Text, View, ScrollView, TouchableOpacity } from 'react-native'
import { Text, View, ScrollView, TouchableOpacity, BackHandler } from 'react-native'
import { Container } from 'native-base'
import api from '../../../service/api'
import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient'
......@@ -24,8 +24,19 @@ export default class Appraisal extends Component {
componentDidMount() {
this.getListAppraisal()
}
BackHandler.addEventListener("hardwareBackPress", this.onBackPressed);
// AsyncStorage.setItem(Constant.TOKEN, 'keisiiii')
}
componentWillUnmount() {
BackHandler.removeEventListener("hardwareBackPress", this.onBackPressed);
}
onBackPressed = () => {
this.props.navigation.goBack()
return true;
};
getListAppraisal() {
this.setState({ loading: true })
// alert(this.props.navigation.state.params.data.value)
......@@ -43,6 +54,8 @@ export default class Appraisal extends Component {
this.setState({ loading: false })
}, 500);
})
} else {
this.setState({ loading: false })
}
})
}
......@@ -53,7 +66,11 @@ export default class Appraisal extends Component {
<NavigationEvents
onDidFocus={() => this.getListAppraisal()}
/>
<ScrollView style={{ paddingHorizontal: 20, backgroundColor: '#F5F5F5', paddingTop: 10 }} showsVerticalScrollIndicator={false} >
{this.state.listData.length == 0 &&
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
<Text style={{fontStyle: 'italic'}}>No data found ...</Text>
</View>}
{this.state.listData.length > 0 && <ScrollView style={{ paddingHorizontal: 20, backgroundColor: '#F5F5F5', paddingTop: 10 }} showsVerticalScrollIndicator={false} >
{this.state.listData.map((item, index) => {
return (
<View key={index} style={{ paddingHorizontal: 7 }}>
......@@ -98,7 +115,7 @@ export default class Appraisal extends Component {
)
})}
</ScrollView>
</ScrollView>}
</Container>
)
}
......
......@@ -64,6 +64,8 @@ export default class Approval extends Component {
this.setState({ loading: false })
}, 500);
})
} else {
this.setState({ loading: false })
}
})
}
......@@ -122,7 +124,11 @@ export default class Approval extends Component {
/>
<Text style={{marginLeft: -10}}> Select All</Text>
</TouchableOpacity>}
<ScrollView style={{ paddingHorizontal: 20, backgroundColor: '#F5F5F5', paddingTop: this.state.longPress? 0 : 10 }} showsVerticalScrollIndicator={false} >
{this.state.listData.length == 0 &&
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
<Text style={{fontStyle: 'italic'}}>No data found ...</Text>
</View>}
{this.state.listData.length > 0 && <ScrollView style={{ paddingHorizontal: 20, backgroundColor: '#F5F5F5', paddingTop: this.state.longPress? 0 : 10 }} showsVerticalScrollIndicator={false} >
{this.state.listData.map((item, index) => {
return (
<View key={index} style={{ paddingHorizontal: 7 }}>
......@@ -178,7 +184,7 @@ export default class Approval extends Component {
</View>
)
})}
</ScrollView>
</ScrollView>}
{this.state.longPress && <View style={{width: '100%', paddingHorizontal: 50, paddingBottom: 10, backgroundColor:"#f5f5f5", alignItems:'center', justifyContent: 'center',}}>
<AwesomeButton
width={'100%'} raiseLevel={3} springRelease={true} type="primary"
......
......@@ -197,6 +197,7 @@ class HomePageScreen extends Component {
</View>
</View>
</Modal>
<ScrollView style={{flex: 1}}>
<ImageBackground source={Images.background2} style={{width: '100%', height: 200, justifyContent:'center'}}>
<View style={{ alignItems: 'center', justifyContent: 'flex-end', flex: 1}}>
......@@ -247,12 +248,12 @@ class HomePageScreen extends Component {
<FontAwesome5Icon name={'angle-down'} color={'#fff'} size={20} style={{marginLeft: 10, marginBottom: -1}}/> */}
</View>
</ImageBackground>
<View style={{padding: 10, paddingVertical: 20, flexDirection: 'row', width:'100%'}}>
<View style={{padding: 10, paddingVertical: 20, flexDirection: 'row', width:'100%', justifyContent: 'space-evenly',}}>
{this.state.data.map((item,index) => {
var itemVis = item == 'Penerimaan'? this.state.visAccepted : item == 'Appraisal'? this.state.visAppraisal : this.state.visApproved
return (
itemVis && <TouchableOpacity onPress={() => this.handleNav(item)} key={index} activeOpacity={.5}>
<Image source={item == 'Penerimaan'? Images.IconPenerimaan : item == 'Appraisal'? Images.IconAppraisal : Images.IconApproval} style={{width: 125, height: 125, marginLeft: 0}}/>
itemVis && <TouchableOpacity onPress={() => this.handleNav(item)} key={index} activeOpacity={.5} style={{width: '30%', height: 125}}>
<Image source={item == 'Penerimaan'? Images.IconPenerimaan : item == 'Appraisal'? Images.IconAppraisal : Images.IconApproval} style={{width: '100%', height: '100%', marginLeft: 0}}/>
</TouchableOpacity>
)
})}
......
import React, { Component } from 'react'
import { Text, View, ScrollView, TouchableOpacity } from 'react-native'
import { Text, View, ScrollView, TouchableOpacity, BackHandler} from 'react-native'
import { Container, Fab, Icon } from 'native-base'
import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient'
import Svg, { Circle, Rect } from 'react-native-svg'
......@@ -23,8 +23,18 @@ export default class Penerimaan extends Component {
componentDidMount() {
this.getListData()
// alert(JSON.stringify(this.props))
BackHandler.addEventListener("hardwareBackPress", this.onBackPressed);
}
componentWillUnmount() {
BackHandler.removeEventListener("hardwareBackPress", this.onBackPressed);
}
onBackPressed = () => {
this.props.navigation.goBack()
return true;
};
getListData() {
api.create().getListClar({
warehouse_id: Number(this.props.navigation.state.params.data.value)
......@@ -48,7 +58,11 @@ export default class Penerimaan extends Component {
<NavigationEvents
onDidFocus={() => this.getListData()}
/>
<ScrollView style={{ paddingHorizontal: 20, backgroundColor: '#F5F5F5', paddingTop: 10 }} showsVerticalScrollIndicator={false} >
{this.state.listClar.length == 0 &&
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
<Text style={{fontStyle: 'italic'}}>No data found ...</Text>
</View>}
{this.state.listClar.length > 0 && <ScrollView style={{ paddingHorizontal: 20, backgroundColor: '#F5F5F5', paddingTop: 10 }} showsVerticalScrollIndicator={false} >
{this.state.listClar.map((item, index) => {
return (
<View key={index} style={{ paddingHorizontal: 7 }}>
......@@ -91,7 +105,7 @@ export default class Penerimaan extends Component {
)
})}
</ScrollView>
</ScrollView>}
<Fab
active={true}
direction="up"
......
import React, { Component } from 'react';
import { Container } from 'native-base';
import { View, Text, ScrollView, Image } from 'react-native';
import { View, Text, ScrollView, Image, BackHandler } from 'react-native';
import Images from '../../library/images';
class Notif extends Component {
......@@ -27,6 +27,19 @@ class Notif extends Component {
]
}
}
componentDidMount() {
BackHandler.addEventListener("hardwareBackPress", this.onBackPressed);
}
componentWillUnmount() {
BackHandler.removeEventListener("hardwareBackPress", this.onBackPressed);
}
onBackPressed = () => {
this.props.navigation.goBack();
return true;
};
render() {
return (
<Container>
......
......@@ -4,7 +4,7 @@ import LinearGradient from 'react-native-linear-gradient';
import Colors from '../../library/colors';
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5'
import MaterialIcons from 'react-native-vector-icons/MaterialIcons'
import { Image, Keyboard } from 'react-native';
import { Image, Keyboard, BackHandler } from 'react-native';
import Images from '../../library/images';
import AwesomeButton from 'react-native-really-awesome-button';
import AsyncStorage from '@react-native-community/async-storage';
......@@ -25,8 +25,18 @@ class Profile extends Component {
componentDidMount() {
this.getToken()
BackHandler.addEventListener("hardwareBackPress", this.onBackPressed);
}
componentWillUnmount() {
BackHandler.removeEventListener("hardwareBackPress", this.onBackPressed);
}
onBackPressed = () => {
this.props.navigation.goBack();
return true;
};
navigateToLogin(next) {
next()
AsyncStorage.clear(() => {
......
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