Commit 35c75793 authored by Trisno's avatar Trisno

rapihin content News Detail

parent 3f89e273
......@@ -22,8 +22,8 @@ export default class NewsDetail extends React.Component {
const screenWidth = Math.round(Dimensions.get('window').width);
const statusBarHeight = getStatusBarHeight();
this.setState({
image_height: screenWidth,
statusbar_height: statusBarHeight
image_height: screenWidth,
statusbar_height: statusBarHeight
})
this.get_news_detail(this.props.route.params.slug)
}
......@@ -38,10 +38,11 @@ export default class NewsDetail extends React.Component {
content: detail.content,
})
})
}
render() {
// console.log(this.state.content)
return (
<View style={styles.container}>
<ScrollView style={styles.body}>
......@@ -50,8 +51,16 @@ export default class NewsDetail extends React.Component {
</View>
<View style={styles.content}>
<Text style={styles.title}>{this.state.title}</Text>
<View style={{backgroundColor: '#adadad', height: 1.5, flex: 1, marginBottom: 5}} />
<HTML html={this.state.content} tagsStyles={{ p: {fontFamily: 'Gotham-Light', marginTop: 8, marginBottom: 8}, blockquote: { backgroundColor: "#f1f1f1", padding: 12, paddingBottom: 0, marginTop: 6 } }}/>
<View style={{ backgroundColor: '#adadad', height: 1.5, flex: 1, marginBottom: 5 }} />
<HTML html={this.state.content} tagsStyles={{
p: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light' },
blockquote: { backgroundColor: "#f1f1f1", padding: 12, paddingBottom: 0, marginTop: 0 },
li: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginBottom : 0 },
ul: { fontSize: 12, color: '#838383', fontFamily: 'Gotham-Light', marginVertical: 5, marginBottom : -10 },
}}
ignoredTags={['br']}
ignoredStyles={['font-family','&nbsp;', '&amp;']} />
</View>
</ScrollView>
</View>
......@@ -61,7 +70,7 @@ export default class NewsDetail extends React.Component {
const styles = StyleSheet.create({
container:{
container: {
flex: 1,
backgroundColor: 'white',
},
......@@ -70,13 +79,13 @@ const styles = StyleSheet.create({
paddingHorizontal: 5,
flexDirection: 'row',
backgroundColor: '#CFB368',
alignItems : 'center'
alignItems: 'center'
},
headerTitle: {
flex: 1,
textAlign: 'center',
margin: 20,
fontSize: 23,
textAlign: 'center',
margin: 20,
fontSize: 23,
alignSelf: 'center',
color: 'white',
fontFamily: 'Gotham-Black'
......
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