Notifications view improvement and some cleaning

This commit is contained in:
Adolfo Reyna
2022-12-11 22:17:58 -05:00
parent 18a37c64c0
commit 90be0f05bb
6 changed files with 52 additions and 45 deletions

View File

@@ -1,9 +1,8 @@
import { StatusBar } from 'expo-status-bar';
import React, { useState, useEffect } from 'react';
import React from 'react';
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 SinglePost from '../components/SinglePostComponent';
import Moment from 'moment';
import { useSnapshot } from 'valtio';
import GlobalState from '../contexts/GlobalState.js';
@@ -11,7 +10,7 @@ import GlobalState from '../contexts/GlobalState.js';
let NotificationsView = ({ navigation, route }) => {
const gState = useSnapshot(GlobalState);
const viewer = gState.me;
const renderNotification = (({ item }) => {
const renderNotification = (({ item }) => {
const gotToPost = () => {
navigation.navigate('SinglePost', { postid: item.postid });
};
@@ -22,6 +21,7 @@ let NotificationsView = ({ navigation, route }) => {
<Text style={{ fontWeight: 'normal', fontSize: 12 }}>
{" " + Moment(item.ts).fromNow()}
</Text>
<SinglePost postId={item.postid} />
</Card.Content>
</Card>
)