import React, { Component } from react class MyComponent extends Component { render = () => { return (
{ link_to 'Back to notifications', notifications_path }

{ case @notification.notification_code when MAP_ACCESS_REQUEST request = @notification.notified_object map = request.map } { image_tag @notification.sender.image(:thirtytwo), className: 'thirty-two-avatar' } { request.user.name } wants to collaborate on map { map.name } { else } { @notification.subject } { end }

{ case @notification.notification_code when MAP_ACCESS_REQUEST }

{ if false && request.answered } { if request.approved } You already responded to this access request, and allowed access. { elsif !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. { end } { else } { image_tag asset_path('ellipsis.gif'), className: 'hidden' } { link_to 'Allow', approve_access_post_map_path(id: map.id, request_id: request.id), remote: true, method: :post, className: 'button allow' } { link_to 'Decline', deny_access_post_map_path(id: map.id, request_id: request.id), remote: true, method: :post, className: 'button decline' } { end }

{ link_to 'Go to map', map_url(map) }   { link_to 'View mapper profile', explore_path(id: request.user.id) }
{ else }
{ raw @notification.body }
{ end }
) } } export default MyComponent