Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8ba25dd
test
jadcarson Jul 19, 2016
d952a34
Updated database
Jul 19, 2016
b31d171
Merge pull request #2 from wrestlewithjad/chrissucks
jadcarson Jul 19, 2016
84fba75
local-signup working. Some issues with updating username in top right…
Chrisitchy Jul 21, 2016
c94d28f
Have a working map and now adding extra info to it
jadcarson Jul 21, 2016
7824ed5
added 'trash' button, need to add logic so you cant like and trash th…
sdavisonswim Jul 21, 2016
9982568
sending correct props
jadcarson Jul 21, 2016
ea11643
added logic so that you can only like OR trash a pic, not both
sdavisonswim Jul 21, 2016
b60604a
Began implementing filter; does not re-render
Jul 21, 2016
8382901
local login and signup working for the most part... some odd things w…
Chrisitchy Jul 21, 2016
ffc62e2
maps work, had to set up some simple redux
jadcarson Jul 22, 2016
1267c28
added logic for like/dislike.. adding hipster scale, still need to wo…
sdavisonswim Jul 22, 2016
b137df7
have FB profile pic and user names in database now
Chrisitchy Jul 22, 2016
7a10c17
Merge pull request #3 from wrestlewithjad/filtering
jadcarson Jul 22, 2016
8f90d86
Merge pull request #5 from wrestlewithjad/local-signup-passport
jadcarson Jul 22, 2016
a478c3b
worked on map
jadcarson Jul 22, 2016
c3fc12e
fixed more merge conflicts
jadcarson Jul 22, 2016
c370a02
test
jadcarson Jul 19, 2016
355951b
I don't get rebasing
jadcarson Jul 22, 2016
9b24ba4
sending correct props
jadcarson Jul 21, 2016
d3685b2
fixed more rebasing
jadcarson Jul 22, 2016
fa93b5a
worked on map
jadcarson Jul 22, 2016
c4f9b81
forgot to remove a git conflict line
jadcarson Jul 22, 2016
56f5462
fixed merge issues
jadcarson Jul 22, 2016
71409aa
merged everything
jadcarson Jul 22, 2016
281ea03
forgot to commit this
jadcarson Jul 22, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions client/actions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const FETCH_GOOGLE = 'FETCH_GOOGLE'

export function fetchGoogle(google) {
console.log("fetching")
return{
type:FETCH_GOOGLE,
payload: google
}
}
43 changes: 39 additions & 4 deletions client/components/ArtGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,27 @@ export default class App extends React.Component {

this.state = {
tempCollection: [],
artCollection: []
artCollection: [],
hipCollection: []
}
}

componentWillMount() {
this.update()
if(true){
this.update()
}
}

update() {
console.log("params",this.props.params)
this.fetchArt(this.props.params.artistName)
.then(() => {
this.getLikes()
this.getTrash()
this.getHipster()
})
}

signUp(userData) {
auth.signUp(userData)
}
Expand All @@ -33,7 +41,7 @@ export default class App extends React.Component {
return art.getArt()
.then((artwork) => {
if(artist) {
this.setState({tempCollection: artwork.filter((art) => art['Artist Name'] == artist)})
this.setState({tempCollection: artwork.filter((art) => art['Artist Full Name'] == artist)})
}
else {
this.setState({tempCollection: artwork})
Expand All @@ -54,12 +62,39 @@ export default class App extends React.Component {
})
}

getTrash(){
var trashResults = [];
this.state.tempCollection.forEach((artWork) => {
art.getTrash(artWork._id)
.then((trashCount) => {
trashResults.push(Object.assign(artWork, {trashCount: trashCount.trashCount}))
if (trashResults.length === this.state.tempCollection.length) {
this.setState({trashCollection: trashResults})
}
})
})
}

getHipster(){
var hipResults = [];
this.state.tempCollection.forEach((artWork) => {
art.getHipster(artWork._id)
.then((userScore) => {
hipResults.push(Object.assign(artWork, {userScore: userScore.userScore}))
//if(hipResults.length === this.state.tempCollection.length) {
this.setState({hipCollection: hipResults})
//}
})
})
}


render(){
return (
<div>
<br/>
<br/>
<ArtWindow className="artGallery" update={this.update.bind(this)} gallery={this.state.artCollection} loggedIn={this.state.loggedIn} fetchArt={this.fetchArt.bind(this)}/>
<ArtWindow className="artGallery" update={this.update.bind(this)} gallery={this.state.artCollection} loggedIn={this.state.loggedIn} fetchArt={this.fetchArt.bind(this)}/>
</div>
)
}
Expand Down
87 changes: 87 additions & 0 deletions client/components/ArtMap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import React from 'react'
import {Link} from 'react-router'
import NavBar from './NavBar'
import * as auth from '../models/auth'
import * as art from '../models/art'
import GoogleMap from 'google-map-react';
import TheMap from './theMap'



export default class ArtistMap extends React.Component {

constructor() {
super()
this.state = {
artists: [],
artistLat:[],
ArtName:[],
ArtLocation:[],
ArtTitle:[],
ArtistName:[],
ArtImage:[],
ArtWeb:[]
}

}

componentDidMount() {
art.getArt()
.then((res) => {
this.setState({artists: res},(next)=>{
console.log("artists",this.state.artists)
var ArtName = this.state.ArtName.slice();
var ArtLocation = this.state.ArtLocation.slice();
var ArtTitle = this.state.ArtTitle.slice();
var ArtistName = this.state.ArtistName.slice();
var ArtImage = this.state.ArtImage.slice();
var ArtWeb = this.state.ArtWeb.slice();

var latLong = this.state.artists.map(artist =>{
ArtName.push(artist['Art Location Name']);
ArtLocation.push(artist['Art Location Street Address'])
ArtTitle.push(artist['Art Title'])
ArtistName.push(artist['Artist Full Name'])
ArtImage.push(artist['Images'])
ArtWeb.push(artist['Web Detail Page'])
//console.log("what",artTitle)

var stillNotFormatted = artist.Location.split('(')[1]
var slicedInfo = stillNotFormatted.slice(0,stillNotFormatted.length-1)
var lat = Number(slicedInfo.split(',')[0])
var lon = Number(slicedInfo.split(',')[1])
var latLon = {lat:lat,lng:lon}
return latLon
})
this.setState({ArtName})
this.setState({ArtLocation})
this.setState({ArtTitle})
this.setState({ArtistName})
this.setState({ArtImage})
this.setState({ArtWeb},function(){
// console.log("here",this.state.artName)
// console.log("ok",this.state.ArtTitle)
// console.log("here",this.state.artWeb)
// console.log("ok",this.state.artistName)
})

this.setState({artistLat:latLong})

})


})
}

render() {
return (
<div>
<NavBar />
<h3>Artist List </h3>
{this.state.artistLat.length>0?<TheMap artists = {this.state.artistLat} artName = {this.state.ArtName} artLocation = {this.state.ArtLocation} artTitle = {this.state.ArtTitle} artistName = {this.state.ArtistName} artWeb = {this.state.ArtWeb} artImage = {this.state.ArtImage}/>:null}

</div>
)
}

}
Loading