import React, { Component, PropTypes } from 'react' import MapInfoBox from './MapInfoBox' import MapChat from './MapChat' import TopicCard from '../TopicCard' class MapView extends Component { static propTypes = { mapId: PropTypes.string, map: PropTypes.object, mapIsStarred: PropTypes.bool, currentUser: PropTypes.object, endActiveMap: PropTypes.func, launchNewMap: PropTypes.func } constructor(props) { super(props) this.state = {} } componentDidMount() { window && window.addEventListener('resize', this.resize) this.resize() } componentDidUpdate(prevProps) { const oldMapId = prevProps.mapId const { mapId, endActiveMap, launchNewMap } = this.props if (!oldMapId && mapId) launchNewMap(mapId) else if (oldMapId && mapId && oldMapId !== mapId) { endActiveMap() launchNewMap(mapId) } else if (oldMapId && !mapId) endActiveMap() } componentWillUnmount() { window && window.removeEventListener('resize', this.resize) } resize = () => { } render = () => { const { mapIsStarred } = this.props const starclassName = mapIsStarred ? 'starred' : '' const tooltip = mapIsStarred ? 'Star' : 'Unstar' return
Center View
Zoom In
Zoom Out
{tooltip}
Map Info
Help
} } export default MapView /*
<% if authenticated? %> <% # for creating and pulling in topics and synapses %> <% if controller_name == 'maps' && action_name == "conversation" %> <%= render :partial => 'maps/newtopicsecret' %> <% else %> <%= render :partial => 'maps/newtopic' %> <% end %> <%= render :partial => 'maps/newsynapse' %> <% # for populating the change metacode list on the topic card %> <%= render :partial => 'shared/metacodeoptions' %> <% end %> <%= render :partial => 'layouts/lowermapelements' %>
Double-click to
add a topic
Use Tab & Shift+Tab to select a metacode
Press Enter to add the topic
*/