Add moment
This commit is contained in:
@@ -4,6 +4,7 @@ import { View, Text, StyleSheet, SafeAreaView, FlatList } from 'react-native';
|
||||
import { Card } from 'react-native-paper';
|
||||
import API from './../API.js';
|
||||
import Post from './../components/Post.js';
|
||||
import Moment from 'moment';
|
||||
|
||||
|
||||
let LoadPost = ({ postid, viewer }) => {
|
||||
@@ -24,13 +25,16 @@ let Notifications = ({ navigation, route }) => {
|
||||
}, [route.params]);
|
||||
const renderNotification = (({ item }) => {
|
||||
//return (<LoadPost postid={item.postid} viewer={Me} />);
|
||||
const gotToPost = ()=>{
|
||||
navigation.navigate('SinglePost', {postid: item.postid, viewer: Me});
|
||||
const gotToPost = () => {
|
||||
navigation.navigate('SinglePost', { postid: item.postid, viewer: Me });
|
||||
};
|
||||
return (
|
||||
<Card style={{margin: 3}} onPress={gotToPost}>
|
||||
<Card style={{ margin: 3 }} onPress={gotToPost}>
|
||||
<Card.Content>
|
||||
<Text>{item.body}</Text>
|
||||
<Text style={{ fontWeight: 'normal', fontSize: 12 }}>
|
||||
{" " + Moment(item.ts).fromNow()}
|
||||
</Text>
|
||||
</Card.Content>
|
||||
</Card>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user