Skip to content

Commit

Permalink
integrated the basic image flow.
Browse files Browse the repository at this point in the history
related to #19
  • Loading branch information
sohilpandya committed Nov 23, 2017
1 parent 50f782e commit d499719
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
5 changes: 4 additions & 1 deletion graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ type Building {
significance: String,
recommendation: String,
latitude: Float,
longitude: Float
longitude: Float,
image_main: String,
image_second: String,
image_third: String
}

type Query {
Expand Down
5 changes: 4 additions & 1 deletion helpers/createDataObj.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ const createDataObj = (data) => {
significance: item['Significance Statement'],
recommendation: item['Recommendation'],
latitude: item['Latitude'],
longitude: item['Longitude']
longitude: item['Longitude'],
image_main: item['Image Main'],
image_second: item['Image Second'],
image_third: item['Image Third']
};
});
}
Expand Down
5 changes: 4 additions & 1 deletion models/islington.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ const islingtonSchema = new Schema({
significance: String,
recommendation: String,
latitude: Number,
longitude: Number
longitude: Number,
image_main: String,
image_second: String,
image_third: String
});

const Islington = mongoose.model("Islington", islingtonSchema);
Expand Down
4 changes: 4 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class App extends Component {
}

render() {
console.log(this.state.buildings)
return <div>
<Map
{...this.state}
Expand Down Expand Up @@ -73,6 +74,9 @@ const query = gql`
recommendation
latitude
longitude
image_main
image_second
image_third
}
}
`;
Expand Down
8 changes: 7 additions & 1 deletion src/BuildingDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ const BuildingDetails = ({ building }) => {
significance,
recommendation,
latitude,
longitude } = building
longitude,
image_main,
image_second,
image_third } = building

return (
<div>
Expand All @@ -37,6 +40,9 @@ const BuildingDetails = ({ building }) => {
<div> { date_local_listing } </div>
<div> { significance } </div>
<div> { recommendation } </div>
<img src={ image_main } />
<img src={ image_second } />
<img src={ image_third } />
</div>
);
};
Expand Down

0 comments on commit d499719

Please sign in to comment.