-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurundetay.js
69 lines (59 loc) · 1.84 KB
/
urundetay.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import React, {Component} from 'react';
import {SafeAreaView, TouchableOpacity,ScrollView, StatusBar, View, StyleSheet, Text, Image, useColorScheme, Button, BackHandler, } from 'react-native';
import { Colors, DebugInstructions, Header, LearnMoreLinks, ReloadInstructions, } from 'react-native/Libraries/NewAppScreen';
import { WebView } from 'react-native-webview';
export default class UrunDetay extends Component {
constructor(props) {
super(props);
this.state = {
detailData:{}
}
}
componentDidMount() {
console.log('this props detail:',JSON.stringify(this.props));
const {route,navigation} = this.props;
const {params} = route;
console.log('params:',params)
this.setState({detailData:params});
}
render() {
const {detailData} = this.state;
console.log('deail:',this.props.navigation)
let vw = <Text>Loading...</Text>;
if(detailData.id && detailData.id >0 ){
vw =
<View style={styles.container}>
<View style={styles.headerbar}>
<Text style={styles.pagetitle}>{this.state.detailData.title}</Text>
</View>
<WebView
source={{ uri: 'https://app.toptankoyurunleri.com/urun/'+this.state.detailData.seotitle+'/'+this.state.detailData.id}}
style={{ marginTop: 55 }}
/>
</View>
}
return vw
}
}
const styles = StyleSheet.create({
container:{
flex:1,
},
headerbar: {
height: 55,
backgroundColor: "#fff",
flex:1,
position: 'absolute',
top: 0,
width: '100%',
paddingBottom: 15,
paddingTop: 15,
},
pagetitle:{
fontSize:18,
flex:1,
alignSelf:'center',
color:"#000",
fontWeight: 'bold',
},
});