-
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.
Showing
16 changed files
with
122 additions
and
612 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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
import '../App.css'; | ||
import PropTypes from 'prop-types'; | ||
|
||
export default function Square({value, onSquareClick}) { | ||
function Square({value, onSquareClick}) { | ||
return (<button className="square" onClick={onSquareClick}>{value}</button>); | ||
} | ||
|
||
export default Square; |
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,64 @@ | ||
import Board from '../components/Board'; | ||
|
||
export default { | ||
title: 'Board', | ||
component: Board | ||
} | ||
|
||
const Template = args => <Board {...args} /> | ||
|
||
export const Empty = Template.bind({}) | ||
Empty.args = { | ||
xIsNext: true, | ||
squares: Array(9).fill(null), | ||
onplay: () => null | ||
} | ||
|
||
export const AllRound = Template.bind({}) | ||
AllRound.args = { | ||
xIsNext: true, | ||
squares: Array(9).fill('O'), | ||
onplay: () => null | ||
} | ||
|
||
export const AllCross = Template.bind({}) | ||
AllCross.args = { | ||
xIsNext: true, | ||
squares: Array(9).fill('X'), | ||
onplay: () => null | ||
} | ||
|
||
export const AllTriangle = Template.bind({}) | ||
AllTriangle.args = { | ||
xIsNext: true, | ||
squares: Array(9).fill('△'), | ||
onplay: () => null | ||
} | ||
|
||
export const RoundAndCross = Template.bind({}) | ||
RoundAndCross.args = { | ||
xIsNext: true, | ||
squares: ['X', 'O', 'X', 'X', 'O', 'O', 'O', 'X', 'O',], | ||
onplay: () => null | ||
} | ||
|
||
export const RoundAndTriangle = Template.bind({}) | ||
RoundAndTriangle.args = { | ||
xIsNext: true, | ||
squares: ['△', 'O', '△', '△', 'O', 'O', 'O', '△', 'O',], | ||
onplay: () => null | ||
} | ||
|
||
export const CrossAndTriangle = Template.bind({}) | ||
CrossAndTriangle.args = { | ||
xIsNext: true, | ||
squares: ['X', '△', 'X', 'X', '△', '△', '△', 'X', '△',], | ||
onplay: () => null | ||
} | ||
|
||
export const RoundAndCrossAndTriangle = Template.bind({}) | ||
RoundAndCrossAndTriangle.args = { | ||
xIsNext: true, | ||
squares: ['X', 'O', 'O', '△', 'O', '△', 'X', 'X', '△',], | ||
onplay: () => null | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
import Game from '../components/Game'; | ||
import PropTypes from 'prop-types'; | ||
|
||
export default { | ||
title: 'Game', | ||
component: Game | ||
} | ||
|
||
const Template = args => <Game {...args} /> | ||
|
||
export const Empty = Template.bind() | ||
Empty.args = { | ||
value: '' | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.