diff --git a/frontend/src/components/MapView/MapInfoBox.js b/frontend/src/components/MapView/MapInfoBox.js
index 96cfd45f..7f64da0f 100644
--- a/frontend/src/components/MapView/MapInfoBox.js
+++ b/frontend/src/components/MapView/MapInfoBox.js
@@ -3,60 +3,20 @@ import React, { Component, PropTypes } from 'react'
class MapInfoBox extends Component {
static propTypes = {
currentUser: PropTypes.object,
- map: PropTypes.object
+ map: PropTypes.object,
+ infoBoxHtml: PropTypes.string
}
render () {
- const { currentUser, map } = this.props
+ const { currentUser, map, infoBoxHtml } = this.props
if (!map) return null
-
- let name, contributors_class, contributor_image, contributor_list,
- contributor_count, topic_count, synapse_count, map_creator_tip,
- permission, desc, user_name, created_at, updated_at
- return
-
Click here to name this map
-
{name}
-
-
-

-
{contributor_count}
-
{contributor_list}
-
-
- {topic_count}
-
-
- {synapse_count}
-
-
- {map_creator_tip}
-
-
-
-
- {desc}
-
-
-
Created by: {user_name} on {created_at}
-
Last edited: {updated_at}
-
-
-
-
Update Thumbnail
-
Thumb
-
-
-
-
-
-
+ const html = {__html: infoBoxHtml}
+ const isCreator = map.authorizePermissionChange(currentUser)
+ const canEdit = map.authorizeToEdit(currentUser)
+ let classes = 'mapInfoBox mapElement mapElementHidden permission '
+ classes += isCreator ? 'yourMap' : ''
+ classes += canEdit ? ' canEdit' : ''
+ return
}
}
diff --git a/frontend/src/components/MapView/index.js b/frontend/src/components/MapView/index.js
index f9c8d1c3..ef9222e4 100644
--- a/frontend/src/components/MapView/index.js
+++ b/frontend/src/components/MapView/index.js
@@ -13,15 +13,17 @@ class MapView extends Component {
mapId: PropTypes.string,
map: PropTypes.object,
mapIsStarred: PropTypes.bool,
+ toggleFilterBox: PropTypes.func,
+ toggleMapInfoBox: PropTypes.func,
+ infoBoxHtml: PropTypes.string,
currentUser: PropTypes.object,
endActiveMap: PropTypes.func,
- launchNewMap: PropTypes.func
+ launchNewMap: PropTypes.func,
}
constructor(props) {
super(props)
this.state = {
- infoBoxOpen: false,
filterBoxOpen: false,
chatOpen: false
}
@@ -34,7 +36,6 @@ class MapView extends Component {
endMap() {
this.setState({
- infoBoxOpen: false,
filterBoxOpen: false,
chatOpen: false
})
@@ -61,8 +62,8 @@ class MapView extends Component {
}
render = () => {
- const { map, mapIsStarred, currentUser, onOpen, onClose } = this.props
- const { infoBoxOpen, filterBoxOpen, chatOpen } = this.state
+ const { map, mapIsStarred, currentUser, onOpen, onClose, toggleMapInfoBox, toggleFilterBox, infoBoxHtml } = this.props
+ const { filterBoxOpen, chatOpen } = this.state
const onChatOpen = () => {
this.setState({chatOpen: true})
onOpen()
@@ -73,12 +74,16 @@ class MapView extends Component {
}
// TODO: stop using {...this.props} and make explicit
return
-
+
-
+
}
}