-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better components structure, add responsive
- Loading branch information
1 parent
fd38723
commit ef66518
Showing
5 changed files
with
87 additions
and
64 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
|
||
export default function Restart(props) { | ||
return ( | ||
<div className="action"> | ||
<button className="action-btn m-top-big" onClick={props.onClick}> | ||
Restart the game | ||
</button> | ||
</div> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
|
||
export default function Status(props) { | ||
const value = sign => ( | ||
<span className={sign === 'X' ? 'is-x' : 'is-o'}> {sign}</span> | ||
); | ||
|
||
let status; | ||
if (props.winner) { | ||
status = <>Winner:{value(props.winner)}</>; | ||
} else if (!props.gameOver) { | ||
status = <>Next player:{value(props.xIsNext ? 'X' : 'O')}</>; | ||
} else { | ||
status = `That's a draw!`; | ||
} | ||
return <div className="status">{status}</div>; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
|
||
export default function TopButton(props) { | ||
return ( | ||
<div className="action"> | ||
<button | ||
className="action-btn m-bottom-small" | ||
disabled={props.playing} | ||
onClick={props.onClick} | ||
> | ||
Let computer starts | ||
</button> | ||
</div> | ||
); | ||
} |
ef66518
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to following URLs: