New post view + fix moment location
This commit is contained in:
@@ -5,7 +5,10 @@ import API from './../API.js';
|
||||
import UserName from './UserName.js';
|
||||
import { useSnapshot } from 'valtio';
|
||||
import GlobalState from '../contexts/GlobalState.js';
|
||||
|
||||
import Moment from 'moment';
|
||||
import i18n from "../i18nMessages.js";
|
||||
import 'moment/min/locales';
|
||||
Moment.locale(i18n.locale);
|
||||
|
||||
let Comment = ({ comment, postid }) => {
|
||||
const gState = useSnapshot(GlobalState);
|
||||
@@ -30,7 +33,7 @@ let Comment = ({ comment, postid }) => {
|
||||
<View style={{flex:8}}>
|
||||
<Text style={styles.userName}>
|
||||
<UserName profileid={comment.profileid} key={comment.profileid} />
|
||||
|
||||
<Text style={{fontSize: 12, fontWeight: "normal"}}> {Moment(comment.createdAt).fromNow()}</Text>
|
||||
</Text>
|
||||
</View>
|
||||
<View style={{flex:2}}>
|
||||
@@ -42,6 +45,7 @@ let Comment = ({ comment, postid }) => {
|
||||
</View>
|
||||
</View>
|
||||
<Text style={{fontSize: 16}}>{comment.content}</Text>
|
||||
|
||||
</Card.Content>
|
||||
</Card>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user