import React, { Component } from 'react' import { Link } from 'react-router' import { MAP_ACCESS_REQUEST } from '../../constants' import NotificationsHeader from './NotificationsHeader' import Loading from '../../components/Loading' import NotificationBody from '../../components/NotificationBody' /* TODO: allow / decline access loading states make backend serve HTML for raw body too */ class NotificationPage extends Component { componentDidMount() { // the notification id const id = parseInt(this.props.params.id, 10) if (!this.props.notifications.find(n => n.id === id)) { this.props.fetchNotification(id) } } render = () => { const id = parseInt(this.props.params.id, 10) const notification = this.props.notifications.find(n => n.id === id) if (!notification) { return (
{request.answered &&
{request.approved && You already responded to this access request, and allowed access.}
{!request.approved && You already responded to this access request, and declined access. If you changed your mind, you can still grant
them access by going to the map and adding them as a collaborator.}
}
{!request.answered &&
Allow
Decline
}