Skip to content

Commit

Permalink
clarify class names for neighborhoods vs. bikes info
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicacaley committed Jul 31, 2019
1 parent b4368ec commit 4999c71
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
18 changes: 18 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,19 @@ nav {
padding: 10px;
}

.current-neighborhood {
background-color: rgb(108, 117, 125, .1);
width: 200px;
border-radius: 10px;
margin-left: auto;
margin-right: 10%;
margin-top: 15vh;
height: auto;
text-align: center;
color: white;
padding: 10px;
}

h2 {
font-size: 1.5em;
/* text-decoration: underline; */
Expand Down Expand Up @@ -147,6 +160,11 @@ h4 {
margin: 0;
}

.neighborhood-info {
text-align: left;
margin: 0;
}

.placeholder {
padding: 20px 30px;
color: rgb(256, 256, 256, .5);
Expand Down
12 changes: 6 additions & 6 deletions src/components/Neighborhoods.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ class Neighborhoods extends Component {
drawMap() {

if(this.state.neighborhood) {
d3.select('.bike-info')
d3.select('.neighborhood-info')
.html('')

d3.select('.bike-info')
d3.select('.neighborhood-info')
.append('text')
.html(() => `
<li>neighborhood: <b>${this.state.neighborhood.properties.name}</b></li>
Expand Down Expand Up @@ -342,10 +342,10 @@ class Neighborhoods extends Component {
.on('click', function(d) {
that.setState({ neighborhood: d });

d3.select('.bike-info')
d3.select('.neighborhood-info')
.html('');

d3.select('.bike-info')
d3.select('.neighborhood-info')
.append('text')
.html(() => `
<li>neighborhood: <b>${d.properties.name}</b></li>
Expand Down Expand Up @@ -435,8 +435,8 @@ class Neighborhoods extends Component {
<button className={`btn btn-sm ${!this.state.showDetails ? 'visible' : 'invisible'}`} onClick={this.revealDetails}>Show Neighborhood Details</button>
<button className={`btn btn-sm ${this.state.showDetails ? 'visible' : 'invisible'}`} onClick={this.hideDetails}>Hide Neighborhood Details</button>
</div>
<div className={`current-bike ${this.state.showDetails ? 'visible' : 'invisible'}`}>
<ul className="bike-info">
<div className={`current-neighborhood ${this.state.showDetails ? 'visible' : 'invisible'}`}>
<ul className="neighborhood-info">
</ul>
</div>
</section>
Expand Down

0 comments on commit 4999c71

Please sign in to comment.