diff --git a/app/components/FavNotif.js b/app/components/FavNotif.js
index 43366de..d6e4662 100644
--- a/app/components/FavNotif.js
+++ b/app/components/FavNotif.js
@@ -2,7 +2,7 @@ import React from 'react';
import { StyleSheet, View, Text } from 'react-native';
import Swipeout from 'react-native-swipeout';
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome'
-import { /*faQuestion,*/ faTrash } from '@fortawesome/free-solid-svg-icons'
+import { faQuestion, faTrash } from '@fortawesome/free-solid-svg-icons'
import PropTypes from 'prop-types';
@@ -11,11 +11,11 @@ export default class FavNotif extends React.Component
constructor(props) {
super(props);
this.swipeData = [
- /*{ // TODO: add a more information feature to the notifications
+ { // TODO: add a more information feature to the notifications
text: ,
backgroundColor: 'blue',
onPress: () => { this.props.info(this.props.data._id) }
- },*/
+ },
{
text: ,
backgroundColor: 'red',
diff --git a/app/screens/FavoritesScreen.js b/app/screens/FavoritesScreen.js
index abb1e67..bd2ca0a 100644
--- a/app/screens/FavoritesScreen.js
+++ b/app/screens/FavoritesScreen.js
@@ -35,8 +35,22 @@ export default class FavoritesScreen extends React.Component
}
info(key) {
- console.log(key);
- this.setState({modal: !this.state.modal});
+ fetch(`${this.props.url}user/get_notification/${key}`, {
+ method: 'GET',
+ headers: {
+ Accept: 'application/json',
+ 'Content-Type': 'application/json',
+ 'authorization': `Bearer ${this.props.token}`
+ }
+ }).then((response) => response.json()).then((json) => {
+ console.log(json);
+ this.setState({modal: !this.state.modal});
+ this.setState({selected: json[0]});
+ }).catch((err) => {
+ console.error(err);
+ alert("Error: Could not connect");
+ this.props.logout();
+ });
}
async remove(index) {
@@ -60,8 +74,26 @@ export default class FavoritesScreen extends React.Component
return (
- HELLO
+ visible={this.state.modal} onRequestClose={() =>
+ this.setState({modal: !this.state.modal})}>
+
+
+
+ {this.state.selected !== undefined ? this.state.selected.method : ""}
+ {this.state.selected !== undefined ? this.state.selected.link: ""}
+
+
+ {this.state.selected !== undefined && (this.state.selected.body !== undefined &&
+ this.state.selected.body.length == 0) ? this.state.selected.body : "The body is empty"}
+
+
+ {this.state.selected !== undefined && this.state.selected.header[0]? this.state.selected.header[0].cookie : ""}
+
+
+ {this.state.selected !== undefined && this.state.selected.header[0]? this.state.selected.header[0].referer: ""}
+
+
+
+
);
@@ -120,5 +154,8 @@ const styles = StyleSheet.create({
width: '100%',
alignItems: 'center',
justifyContent: 'center',
+ },
+ padding: {
+ marginBottom: 20,
}
});
diff --git a/app/screens/NotificationScreen.js b/app/screens/NotificationScreen.js
index 43764a1..06b8000 100644
--- a/app/screens/NotificationScreen.js
+++ b/app/screens/NotificationScreen.js
@@ -110,7 +110,7 @@ export default class HomeScreen extends React.Component
}).catch((err) => {
console.error(err);
alert("Error: Could not connect");
- //this.props.logout();
+ this.props.logout();
});
}
@@ -151,6 +151,12 @@ export default class HomeScreen extends React.Component
{this.state.selected !== undefined && (this.state.selected.body !== undefined &&
this.state.selected.body.length == 0) ? this.state.selected.body : "The body is empty"}
+
+ {this.state.selected !== undefined && this.state.selected.header[0]? this.state.selected.header[0].cookie : ""}
+
+
+ {this.state.selected !== undefined && this.state.selected.header[0]? this.state.selected.header[0].referer: ""}
+