Skip to content

Commit

Permalink
Merge pull request #134 from interactive-tactical-decision-games/add-…
Browse files Browse the repository at this point in the history
…search-placeholder

Add Search placeholder
  • Loading branch information
eric79 committed Apr 30, 2018
2 parents 2aa5b30 + 14dc395 commit 6d5780f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions support/lobby/lib/ActiveSessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ const columns = [ {
return row[ filter.id ] !== undefined ?
String( row[ filter.id ].state.scenarioTitle ).toLowerCase().indexOf( filter.value.toLowerCase() ) >= 0 : true
},
Filter: ( {filter, onChange} ) => (
<input
type="text"
placeholder="Search"
value={ filter ? filter.value : "" }
onChange={ event => onChange( event.target.value ) } />
),
}, {
Header:
"Company",
Expand Down
7 changes: 7 additions & 0 deletions support/lobby/lib/PreviousSessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ const columns = [ {
"state.scenarioTitle",
Cell:
function Cell( props ) { return <TextCell { ...props }/> },
Filter: ( {filter, onChange} ) => (
<input
type="text"
placeholder="Search"
value={ filter ? filter.value : "" }
onChange={ event => onChange( event.target.value ) } />
)
}, {
Header:
"Company",
Expand Down
8 changes: 8 additions & 0 deletions support/lobby/lib/Scenarios.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class Application extends React.Component {
this.props.onServerChange && this.props.onServerChange() } ).
catch( error => {
console.log( error.message ) } );
this.setState( { title: "" } );
event.preventDefault();
}

Expand Down Expand Up @@ -120,6 +121,13 @@ const columns = [ {
"Scenario",
accessor:
"scenario.state.scenarioTitle",
Filter: ( {filter, onChange} ) => (
<input
type="text"
placeholder="Search"
value={ filter ? filter.value : "" }
onChange={ event => onChange( event.target.value ) } />
),
}, {
Header:
"Company",
Expand Down

0 comments on commit 6d5780f

Please sign in to comment.