|
@@ -6,32 +6,9 @@ import Navigation from './Navigation';
|
|
import Footer from './Footer';
|
|
import Footer from './Footer';
|
|
import Home from './Home';
|
|
import Home from './Home';
|
|
import About from './About';
|
|
import About from './About';
|
|
|
|
+import Pigeon from './Pigeon';
|
|
|
|
|
|
export class App extends React.Component{
|
|
export class App extends React.Component{
|
|
- constructor(props){
|
|
|
|
- super(props)
|
|
|
|
- this.state = {
|
|
|
|
- userList: [
|
|
|
|
- {name: "Hugo", counter: 0},
|
|
|
|
- {name: "Bert", counter: 0},
|
|
|
|
- {name: "Sepp", counter: 0},
|
|
|
|
- {name: "Lisa", counter: 0},
|
|
|
|
- {name: "Susi", counter: 0},
|
|
|
|
-
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- doClick(idx){
|
|
|
|
- let listCopy = this.state.userList.slice();
|
|
|
|
- listCopy[idx].counter++;
|
|
|
|
- this.setState({userList: listCopy})
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- hello(){
|
|
|
|
- return <p>hello</p>
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
render(){
|
|
render(){
|
|
return (
|
|
return (
|
|
<div>
|
|
<div>
|
|
@@ -40,20 +17,10 @@ export class App extends React.Component{
|
|
<Switch>
|
|
<Switch>
|
|
<Route path="/" exact component={Home} />
|
|
<Route path="/" exact component={Home} />
|
|
<Route path="/about" exact component={About} />
|
|
<Route path="/about" exact component={About} />
|
|
|
|
+ <Route path="/pigeon-map" exact component={Pigeon} />
|
|
</Switch>
|
|
</Switch>
|
|
<Footer />
|
|
<Footer />
|
|
</Router>
|
|
</Router>
|
|
-
|
|
|
|
- {this.props.title}
|
|
|
|
- {this.state.userList.map((user, idx) =>
|
|
|
|
- <User
|
|
|
|
- name={user.name}
|
|
|
|
- counter={user.counter}
|
|
|
|
- doClick={() => this.doClick(idx)}
|
|
|
|
- app={this}
|
|
|
|
- title={this.props.title}
|
|
|
|
- />
|
|
|
|
- )}
|
|
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
}
|
|
}
|