-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb9e67a
commit fd99872
Showing
26 changed files
with
575 additions
and
619 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"plugins": [ | ||
"eslint-plugin-babel" | ||
], | ||
"extends": ["standard", "standard-jsx"], | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"meteor": true | ||
}, | ||
"globals": { | ||
"Places": true, | ||
"Media": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,76 @@ | ||
import React, {Component} from 'react'; | ||
import MusicMap from './MusicMap'; | ||
import Menu from './Menu'; | ||
import Header from './Header'; | ||
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; | ||
import { Places } from '../api/places.js'; | ||
import { Events } from '../api/events.js'; | ||
import { Media } from '../api/media.js'; | ||
import { createContainer } from 'meteor/react-meteor-data'; | ||
import CircularProgress from 'material-ui/CircularProgress'; | ||
import React, {Component} from 'react' | ||
import MusicMap from './MusicMap' | ||
import Menu from './Menu' | ||
import Header from './Header' | ||
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider' | ||
import { Places } from '../api/places.js' | ||
import { Events } from '../api/events.js' | ||
import { Media } from '../api/media.js' | ||
import { createContainer } from 'meteor/react-meteor-data' | ||
import CircularProgress from 'material-ui/CircularProgress' | ||
|
||
export class AppContent extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = {markers: this.props.places, markerType: 'places'}; | ||
constructor (props) { | ||
super(props) | ||
this.state = {markers: this.props.places, markerType: 'places'} | ||
} | ||
componentWillReceiveProps(nextProps) { | ||
this.setState({places: nextProps.places, media: nextProps.media, events: nextProps.events, markers:nextProps.places}) | ||
|
||
componentWillReceiveProps (nextProps) { | ||
this.setState({places: nextProps.places, media: nextProps.media, events: nextProps.events, markers: nextProps.places}) | ||
} | ||
|
||
getMediaMarkerPosition(marker) { | ||
if (marker.placeId){ | ||
return this.props.places.find((place)=>{return place._id === marker.placeId}).position | ||
getMediaMarkerPosition (marker) { | ||
if (marker.placeId) { | ||
return this.props.places.find((place) => { return place._id === marker.placeId }).position | ||
} | ||
} | ||
|
||
toggleMarkersFor = (markerType) => { | ||
if (markerType == 'media'){ | ||
const newMarkers = this.props[markerType].map((marker)=>{ | ||
if (markerType === 'media') { | ||
const newMarkers = this.props[markerType].map((marker) => { | ||
return { | ||
...marker, | ||
position: this.getMediaMarkerPosition(marker), | ||
}}); | ||
position: this.getMediaMarkerPosition(marker) | ||
} | ||
}) | ||
this.setState({markers: newMarkers, markerType: 'media'}) | ||
} else { | ||
this.setState({markers: this.props.places, markerType: 'places'}) | ||
} | ||
} | ||
|
||
render() { | ||
render () { | ||
return <MuiThemeProvider> | ||
{this.props.dataReady ? ( | ||
<div className="container"> | ||
<Header /> | ||
<Menu {...this.props} markerType={this.state.markerType}/> | ||
<MusicMap {...this.props} | ||
markers={this.state.markers} | ||
markerType={this.state.markerType} | ||
toggleMarkersFor={this.toggleMarkersFor} | ||
/> | ||
</div> | ||
{this.props.dataReady ? ( | ||
<div className='container'> | ||
<Header /> | ||
<Menu {...this.props} markerType={this.state.markerType} /> | ||
<MusicMap {...this.props} | ||
markers={this.state.markers} | ||
markerType={this.state.markerType} | ||
toggleMarkersFor={this.toggleMarkersFor} | ||
/> | ||
</div> | ||
) : ( | ||
<div style={{marginTop: '20%', textAlign: 'center'}}> | ||
<CircularProgress size={200} thickness={35} /> | ||
<h1>L O A D I N G . . .</h1> | ||
</div>)} | ||
</MuiThemeProvider> | ||
<div style={{marginTop: '20%', textAlign: 'center'}}> | ||
<CircularProgress size={200} thickness={35} /> | ||
<h1>L O A D I N G . . .</h1> | ||
</div>)} | ||
</MuiThemeProvider> | ||
} | ||
} | ||
|
||
const App = createContainer(() => { | ||
let placesSub = Meteor.subscribe('places'); | ||
let eventsSub = Meteor.subscribe('events'); | ||
let mediaSub = Meteor.subscribe('media'); | ||
let subsReady = (placesSub.ready() && eventsSub.ready() && mediaSub.ready()); | ||
let placesSub = Meteor.subscribe('places') | ||
let eventsSub = Meteor.subscribe('events') | ||
let mediaSub = Meteor.subscribe('media') | ||
let subsReady = (placesSub.ready() && eventsSub.ready() && mediaSub.ready()) | ||
return { | ||
places: Places.find().fetch(), | ||
events: Events.find().fetch(), | ||
media: Media.find().fetch(), | ||
dataReady: subsReady, | ||
dataReady: subsReady | ||
} | ||
}, AppContent); | ||
|
||
export default App; | ||
|
||
|
||
}, AppContent) | ||
|
||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.