Skip to content

Commit

Permalink
Updated ListSelector button to display name of chosen list
Browse files Browse the repository at this point in the history
  • Loading branch information
ripetoast committed Oct 15, 2019
1 parent 75cb5ed commit c1391fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion public/data/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@
"ぶらじる",
"中国・ちゅうごく",
"かんこく",
"たい"
"たい",
"すぺいん",
"いたりあ",
"すうええでん",
"おらんだ"
],
"Jobs": [
"いしや",
Expand Down
2 changes: 1 addition & 1 deletion src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class App extends React.Component{
<img src="./ListGen.svg" alt="logo" style={{ "width": "30rem" }} />
</div>
<br/>
<ListSelector rerenderList={this.rerenderList} onListSelect={this.onListSelect} buttons={this.state.buttons} />
<ListSelector chosenList={this.state.selectedList} rerenderList={this.rerenderList} onListSelect={this.onListSelect} buttons={this.state.buttons} />
<br />
{this.state.selectedList === null ? "" : <List listData={this.state.list} />}
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/ListSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const ListSelector = (props) => {
<ul className="nav justify-content-around">
{/* dropdown */}
<div className="btn-group dropright">
<button type="button" className="list-name btn btn-outline-primary">Lists</button>
{console.log(props.chosenList)}
<button type="button" className="list-name btn btn-outline-primary">{props.chosenList === null ? "Lists" : props.chosenList}</button>
<button type="button" className="btn btn-outline-primary dropdown-toggle dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span className="sr-only">Toggle Dropdown</span>
</button>
Expand Down

0 comments on commit c1391fd

Please sign in to comment.