Created
February 9, 2017 20:46
-
-
Save LiamDotPro/2f3545c411d7de3aeb5388d4f70f85d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class UserPane extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
ip:"pending", | |
loc: "pending" | |
}; | |
} | |
updateCall() { | |
console.log(this.updateID); | |
} | |
componentDidMount() { | |
this.response = () => this.getIP(); | |
this.setState({ | |
ip: this.response.ip, | |
loc: this.response.loc | |
}); | |
} | |
async getIP() { | |
const result = await fetch("http://ipinfo.io","jsonp"); | |
return await {ip: result.ip, loc:result.id}; | |
} | |
render() { | |
const loc = "Pending"; | |
const ip = "Pending"; | |
return ( | |
<div className="col-xs-12 col-md-3 home-pane-user nopad"> | |
<UserTile userName="Annonymous" loc={loc} ip={ip} /> | |
<UserReadingList /> | |
<UserQuestion /> | |
</div> | |
); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment