Commit 943d3f1d authored by Deni Rinaldi's avatar Deni Rinaldi

list appraisal

parent d8db4024
......@@ -5,6 +5,7 @@ import M from 'moment'
import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient'
import Svg, { Circle, Rect } from 'react-native-svg'
import Colors from '../../library/colors';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons'
const dateNow = M().format('DD-MM-YYYY')
......@@ -13,24 +14,27 @@ class History extends Component {
super(props)
this.state = {
data: [
{ jam: '17.30', tanggal: M().format('DD-MM-YYYY') },
{ jam: '17.30', tanggal: '06-03-2020' },
{ jam: '17.30', tanggal: '05-03-2020' },
{ jam: '17.30', tanggal: '05-03-2020' },
{ jam: '17.30', tanggal: '05-03-2020' },
{ jam: '17.30', tanggal: '05-03-2020' },
{ jam: '17.30', tanggal: '04-03-2020' },
{ jam: '17.30', tanggal: '04-03-2020' },
{ jam: '17.30', tanggal: '04-03-2020' },
{ jam: '17.30', tanggal: '04-03-2020' },
{ jam: '17.30', tanggal: '04-03-2020' },
{ jam: '17.30', tanggal: '03-03-2020' },
{ jam: '17.30', tanggal: '03-03-2020' },
{ jam: '17.30', tanggal: M().format('DD-MM-YYYY'), noKontrak: 'K-01239912' },
{ jam: '17.30', tanggal: '06-03-2020', noKontrak: 'K-01239913' },
{ jam: '17.30', tanggal: '05-03-2020', noKontrak: 'K-01239914' },
{ jam: '17.30', tanggal: '05-03-2020', noKontrak: 'K-01239915' },
{ jam: '17.30', tanggal: '05-03-2020', noKontrak: 'K-01239916' },
{ jam: '17.30', tanggal: '05-03-2020', noKontrak: 'K-01239917' },
{ jam: '17.30', tanggal: '04-03-2020', noKontrak: 'K-01239918' },
{ jam: '17.30', tanggal: '04-03-2020', noKontrak: 'K-01239919' },
{ jam: '17.30', tanggal: '04-03-2020', noKontrak: 'K-01239920' },
{ jam: '17.30', tanggal: '04-03-2020', noKontrak: 'K-01239921' },
{ jam: '17.30', tanggal: '04-03-2020', noKontrak: 'K-01239922' },
{ jam: '17.30', tanggal: '03-03-2020', noKontrak: 'K-01239923' },
{ jam: '17.30', tanggal: '03-03-2020', noKontrak: 'K-01239924' },
],
date: new Date(),
yesterday: '',
loading: true,
dataLoad: false
dataLoad: false,
OrientationStatus : '',
Height_Layout : '',
Width_Layout : '',
}
}
......@@ -43,10 +47,28 @@ class History extends Component {
}, 2000);
}
DetectOrientation() {
if (this.state.Width_Layout > this.state.Height_Layout) {
this.setState({
OrientationStatus: 'Landscape'
});
}
else {
this.setState({
OrientationStatus: 'Portrait'
});
}
}
render() {
return (
<Container>
<View style={{ height: '10%', width: '100%', backgroundColor: '#e4b300', zIndex: 1 }}>
<Container
onLayout={(event) => this.setState({
Width_Layout: event.nativeEvent.layout.width,
Height_Layout: event.nativeEvent.layout.height
}, () => this.DetectOrientation())}>
<View style={this.state.OrientationStatus == 'Landscape'? { width: '100%', backgroundColor: '#e4b300', zIndex: 1, height: 80 } : { width: '100%', backgroundColor: '#e4b300', zIndex: 1, height: '10%'}}>
<View style={{ alignItems: 'center', justifyContent: 'center', marginTop: 20 }}>
<Text style={{ fontWeight: 'bold', fontSize: 20, fontStyle: 'italic' }}>My History</Text>
</View>
......@@ -57,13 +79,20 @@ class History extends Component {
<View style={{ backgroundColor: '#f5f5f5', paddingHorizontal: 20, zIndex: 3, height: '90%' }}>
<ScrollView style={{ flex: 1 }} showsVerticalScrollIndicator={false}>
<ScrollView style={this.state.OrientationStatus == 'Landscape'? { flex: 1, marginBottom: 40 } : {flex: 1}} showsVerticalScrollIndicator={false}>
{this.state.data.map((item, index) => {
return (
<View>
{this.state.dataLoad && (
<View style={{ marginTop: index == 0 ? 40 : 20, marginBottom: index == this.state.data.length - 1 ? 20 : 0, height: 120 }}>
<View style={{ width: '100%', height: 100, backgroundColor: '#fff', borderRadius: 10 }}>
<View style={{ width: '100%', height: 100, backgroundColor: '#fff', borderRadius: 10, padding: 10, flexDirection: 'row' }}>
<View style={{ width: '70%' }}>
<Text style={{ fontWeight: '700', fontSize: 16 }}>{item.noKontrak}</Text>
</View>
<View style={{ width: '30%', justifyContent: 'flex-end', alignSelf: 'center', flexDirection: 'row' }}>
<Text style={{ color: '#e4b300' }}>Detail</Text>
<MaterialIcons name="navigate-next" size={20} color={'#e4b300'} />
</View>
</View>
<Text style={{ textAlign: 'right', fontStyle: 'italic', fontSize: 12, marginTop: 5, color: '#cccccc' }}>{item.tanggal == String(dateNow) ? item.jam : item.tanggal == this.state.yesterday ? 'yesterday' : item.tanggal} </Text>
</View>
......@@ -74,6 +103,7 @@ class History extends Component {
borderRadius={200}
marginTop={10}
width={'100%'}
duration={800}
>
<Rect x="0" y="30" rx="5" ry="1" width="1000" height="100" />
</SvgAnimatedLinearGradient>
......
......@@ -9,8 +9,8 @@ export default class Appraisal extends Component {
super(props)
this.state = {
arrayDummy: [
{ noKontrak: 'K-2001920', namaWerehouse: 'Branch-2', petugas: 'Dadang', tglTerima: '03-03-2020', status: 'Draft' },
{ noKontrak: 'K-2001921', namaWerehouse: 'Branch-1', petugas: 'Dudung', tglTerima: '03-03-2020', status: 'Need Approval' },
{ noKontrak: 'K-2001920', namaWerehouse: 'Branch-2', petugas: 'Dadang Tukimin', tglTerima: '03-03-2020', status: 'Draft', brand: 'Honda', type: 'Revo', noPol: 'B 4203 PWK' },
{ noKontrak: 'K-2001921', namaWerehouse: 'Branch-1', petugas: 'Dudung Tukimin', tglTerima: '03-03-2020', status: 'Need Approval', brand: 'Honda', type: 'Beat', noPol: 'B 4203 STW' },
]
}
}
......@@ -21,7 +21,30 @@ export default class Appraisal extends Component {
{this.state.arrayDummy.map((item, index) => {
return (
<View key={index} style={{ paddingHorizontal: 7 }}>
<TouchableOpacity style={{ width: '100%', backgroundColor: '#FFFFFF', borderRadius: 15, paddingHorizontal: 10, shadowRadius: 80, paddingVertical: 10, marginTop: 10 }} onPress={() => this.props.navigation.navigate('MenuAppraisal')}>
<TouchableOpacity style={{ marginTop: 10, borderRadius: 20 }} onPress={() => this.props.navigation.navigate('MenuAppraisal')}>
<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.noKontrak}</Text>
<Text style={{ color: 'white', fontSize: 14 }}>{item.petugas}</Text>
</View>
<View style={{ justifyContent: 'center' }}>
<Text style={{ color: 'white', fontSize: 14, textAlign: 'center' }}>{item.namaWerehouse}</Text>
</View>
</View>
<View style={{ height: 60, backgroundColor: '#E6E6E6', justifyContent: 'space-between', paddingHorizontal: 20, flexDirection: 'row', borderBottomRightRadius: 10, borderBottomLeftRadius: 10 }}>
<View style={{ justifyContent: 'center' }}>
<Text style={{ color: 'black', fontSize: 14 }}>{item.brand} - {item.type}</Text>
<Text style={{ color: 'black', fontSize: 14 }}>{item.noPol}</Text>
</View>
<View style={{ justifyContent: 'center' }}>
<Text style={{ color: 'black', fontSize: 14, textAlign: 'center' }}>{item.status}</Text>
</View>
</View>
{/* <View style={{ backgroundColor: '#E6E6E6', borderBottomRightRadius: 10, borderBottomLeftRadius: 10, justifyContent: 'center', paddingHorizontal: 20, paddingVertical: 10, borderTopWidth: .7, borderTopColor: 'black' }}>
</View> */}
</TouchableOpacity>
{/* <TouchableOpacity style={{ width: '100%', backgroundColor: '#FFFFFF', borderRadius: 15, paddingHorizontal: 10, shadowRadius: 80, paddingVertical: 10, marginTop: 10 }} onPress={() => this.props.navigation.navigate('MenuAppraisal')}>
<View style={{ width: 120, height: 20, backgroundColor: 'black', marginLeft: -20, marginTop: 5, borderTopRightRadius: 5, borderBottomRightRadius: 5 }}>
<Text style={{ color: 'white', textAlign: 'center' }}>{item.status}</Text>
</View>
......@@ -40,25 +63,21 @@ export default class Appraisal extends Component {
borderLeftColor: 'transparent',
}} />
<View style={{ flexDirection: 'row' }}>
<View style={{ width: '80%' }}>
{/* <View style={{ flexDirection: 'row', width: '100%', backgroundColor: 'red' }}> */}
<View style={{ width: '80%' }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Text style={{ alignSelf: 'center', fontSize: 16, fontWeight: 'bold' }}>{item.noKontrak}</Text>
<Text style={{ alignSelf: 'center', fontSize: 14 }}>{item.namaWerehouse}</Text>
</View>
{/* </View> */}
{/* <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}> */}
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Text style={{ alignSelf: 'center', fontSize: 14 }}>{item.tglTerima}</Text>
<Text style={{ alignSelf: 'center', fontSize: 14 }}>{item.petugas}</Text>
</View>
{/* </View> */}
</View>
</View>
<View style={{ justifyContent: 'center', width: '20%', alignItems: 'flex-end' }}>
<Next name="navigate-next" size={26} />
</View>
</View>
</TouchableOpacity>
</TouchableOpacity> */}
</View>
)
})}
......
......@@ -808,19 +808,6 @@ export default class sampleMenuAppraisal extends Component {
/>
</View>
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
<View style={{ justifyContent: 'center', width: '45%' }}>
<Text style={{ fontSize: 13 }}>Nilai Pembanding Rekondisi</Text>
</View>
<View style={styles.viewInputEnable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
value={this.state.namaRemote}
editable
/>
</View>
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
<View style={{ justifyContent: 'center', width: '45%' }}>
<Text style={{ fontSize: 13 }}>Pokok Pembiayaan</Text>
......
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