Skip to content

Commit

Permalink
fixed alphabetical oredring
Browse files Browse the repository at this point in the history
related to #55
  • Loading branch information
sohilpandya committed Feb 1, 2018
1 parent 45589dd commit e90d3d6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
5 changes: 3 additions & 2 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class App extends Component {
this.setState({
building: building,
mapCenter: [building.longitude, building.latitude],
mapZoom: [15.5],
mapZoom: 15.5,
})
}

Expand All @@ -64,7 +64,8 @@ class App extends Component {
isHomePage = () => {
this.setState({
isHome: true,
isAbout: false
isAbout: false,
building: {}
});
}

Expand Down
8 changes: 4 additions & 4 deletions src/components/BuildingsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ class BuildingsList extends Component {
render() {
const { buildings = [], handleBuildingDetails } = this.props;
const buildingCards = buildings.map((building, i) => {
return <BuildingCard
key={i}
building={building}
handleBuildingDetails={handleBuildingDetails}
return <BuildingCard
key={i}
building={building}
handleBuildingDetails={handleBuildingDetails}
inputRef={this.props.inputRef}/>
})

Expand Down
13 changes: 6 additions & 7 deletions src/components/Markers.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,27 @@ const Markers = ({
buildings = [], handleBuildingDetails, hoveringItem, selectedBuilding,
goToViewport, hovering, id, selectedBuildingId
}) => {
const allMarkers = buildings.length > 0 && buildings.map((buildingObj, i) => {
let counter = ++i;

const allMarkers = buildings.length > 0 && buildings.map((buildingObj, i) => {
return (
<Marker
key={counter}
key={i}
longitude={buildingObj.longitude}
latitude={buildingObj.latitude}>

<div
onMouseEnter={(obj) => {
hoveringItem(counter);
hoveringItem(buildingObj.id);
}}
onClick={() => {
selectedBuilding(counter);
selectedBuilding(buildingObj.id);
handleBuildingDetails(buildingObj);
let longitude = buildingObj.longitude;
let latitude = buildingObj.latitude;
goToViewport({longitude, latitude});
}}
onTouchStart={() => {
selectedBuilding(counter);
selectedBuilding(buildingObj.id);
handleBuildingDetails(buildingObj);
let longitude = buildingObj.longitude;
let latitude = buildingObj.latitude;
Expand All @@ -44,7 +43,7 @@ const allMarkers = buildings.length > 0 && buildings.map((buildingObj, i) => {
>

{
(hovering && id === counter) || selectedBuildingId === counter ? <MarkerFilled /> : <MarkerEmpty />
(hovering && buildingObj.id === id) || buildingObj.id === selectedBuildingId ? <MarkerFilled /> : <MarkerEmpty />
}

</div>
Expand Down

0 comments on commit e90d3d6

Please sign in to comment.