import * as React from 'react';
import { View, Text, SafeAreaView, StyleSheet, Image, Dimensions,
ScrollView } from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons'
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
isLoading: true,
fontLoaded: false
}
}
async componentDidMount() {
return fetch('http://rapprogtrain.com/server-side/test.php')
.then((response) => response.json())
.then((responseJson) => {
this.setState({
isLoading: false,
dataSource: responseJson
}, function() {
// In this block you can do something with new state.
});
})
.catch((error) => {
console.error(error);
});
}
FlatListItemSeparator = () => {
return (
<View
/>
);
}
render() {
return (
<SafeAreaView style={styles.MainContainer}>
<ScrollView
>
<Text style={styles.textTitle}>Статьи:</Text>
<View style={styles.postContainer}>
<Image
source = {{ uri: "https://tinyjpg.com/images/social/website.jpg" }}
style={{resizeMode:'cover',width:null,height:null, flex:1, borderRadius:4,
borderWidth:1,
borderColor:'#dddddd'}}
/>
<Text
style={styles.textOfArticle}
>
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
</Text>
<View style={{marginTop:10, flexDirection: 'row', justifyContent: 'space-between'}}>
<Text style={{color:'#727272',fontSize:13}}>Lorem</Text>
<View style={{flexDirection: 'row'}}>
<Icon name="ios-eye" size={18} style={{color:'#727272', marginRight:3}} />
<Text style={{color:'#727272',fontSize:13}}>22</Text>
</View>
</View>
</View>
</ScrollView>
</SafeAreaView>
);
}
}
const styles = StyleSheet.create({
MainContainer :{
// Setting up View inside content in Vertically center.
justifyContent: 'center',
flex:1
},
textTitle :{fontSize:22,fontFamily: 'Roboto-M',fontWeight:'700', padding:10},
textOfArticle:{
marginTop:7,
fontSize:16,
fontFamily: 'Roboto-M'
},
postContainer :{
width: Dimensions.get('window').width,
height:250,
paddingBottom:10,
padding:10
},
});
а где продолжение?