|
@@ -0,0 +1,54 @@
|
|
|
+import React from "react";
|
|
|
+import ConfirmBattle from "../components/ConfirmBattle";
|
|
|
+
|
|
|
+class ConfirmBattleContainer extends React.Component {
|
|
|
+ constructor(props) {
|
|
|
+ console.log("Constructor (getInitialState)");
|
|
|
+ super(props);
|
|
|
+ this.state = {
|
|
|
+ isLoading: true,
|
|
|
+ playerInfo: []
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ componentWillMount() {
|
|
|
+ console.log("componentWillMount");
|
|
|
+ }
|
|
|
+
|
|
|
+ componentDidMount() {
|
|
|
+ console.log("componentDidMount");
|
|
|
+ const query = this.props.location.query;
|
|
|
+ // Fetch info from Github then update state.
|
|
|
+ this.setState({
|
|
|
+ isLoading: true
|
|
|
+ });
|
|
|
+ setTimeout(() => { this.setState({ isLoading: false }); }, 2000);
|
|
|
+ }
|
|
|
+
|
|
|
+ componentWillReceiveProps() {
|
|
|
+ console.log("componentWillReceiveProps");
|
|
|
+ }
|
|
|
+
|
|
|
+ componentWillUnmount() {
|
|
|
+ console.log("componentWillUnmount");
|
|
|
+ }
|
|
|
+
|
|
|
+ componentWillUpdate(nextProps, nextState) {
|
|
|
+ console.log("componentWillUpdate: loading ?", nextState.isLoading);
|
|
|
+ }
|
|
|
+
|
|
|
+ render() {
|
|
|
+ return (
|
|
|
+ <ConfirmBattle
|
|
|
+ isLoading={this.state.isLoading}
|
|
|
+ playerInfo={this.state.playerInfo}
|
|
|
+ />
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+ConfirmBattleContainer.contextTypes = {
|
|
|
+ router: React.PropTypes.object.isRequired
|
|
|
+};
|
|
|
+
|
|
|
+export default ConfirmBattleContainer;
|