-
- Start Over
-
-
- Play Again!
-
+class ReplayScreen extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ }
+
+ handlePlayAgain = () => {
+ let { name, inviteCode } = this.props.userData;
+ this.props.closeReplay();
+
+ let option = {
+ headers: HEADERS,
+ method: "POST",
+ body: JSON.stringify({ name })
+ };
+ fetch(`${API_ROOT}/v1/games/${inviteCode}/players`, option)
+ .then(response => response.json())
+ .then(result => {
+ this.props.handleUserInit(result, inviteCode);
+ });
+ };
+
+ render() {
+ return (
+
+
+
+ {this.props.winner.toUpperCase()} team wins!
+
+
})
+
+
+ Start Over
+
+
+ Play Again!
+
+
-
- );
+ );
+ }
};
export default ReplayScreen;
\ No newline at end of file