From e9902f7c01aeb58bc2ed7ddfe425558e79a44936 Mon Sep 17 00:00:00 2001 From: YamazakiYusuke Date: Tue, 11 Jul 2023 08:00:35 +0900 Subject: [PATCH] =?UTF-8?q?storybook=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stories/Board.stories.js | 16 ++++++++-------- src/stories/Game.stories.js | 6 +----- src/stories/Square.stories.js | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/stories/Board.stories.js b/src/stories/Board.stories.js index 2a78bb2..3511a96 100644 --- a/src/stories/Board.stories.js +++ b/src/stories/Board.stories.js @@ -11,54 +11,54 @@ export const Empty = Template.bind({}) Empty.args = { xIsNext: true, squares: Array(9).fill(null), - onplay: () => null + onPlay: () => null } export const AllRound = Template.bind({}) AllRound.args = { xIsNext: true, squares: Array(9).fill('O'), - onplay: () => null + onPlay: () => null } export const AllCross = Template.bind({}) AllCross.args = { xIsNext: true, squares: Array(9).fill('X'), - onplay: () => null + onPlay: () => null } export const AllTriangle = Template.bind({}) AllTriangle.args = { xIsNext: true, squares: Array(9).fill('△'), - onplay: () => null + onPlay: () => null } export const RoundAndCross = Template.bind({}) RoundAndCross.args = { xIsNext: true, squares: ['X', 'O', 'X', 'X', 'O', 'O', 'O', 'X', 'O',], - onplay: () => null + onPlay: () => null } export const RoundAndTriangle = Template.bind({}) RoundAndTriangle.args = { xIsNext: true, squares: ['△', 'O', '△', '△', 'O', 'O', 'O', '△', 'O',], - onplay: () => null + onPlay: () => null } export const CrossAndTriangle = Template.bind({}) CrossAndTriangle.args = { xIsNext: true, squares: ['X', '△', 'X', 'X', '△', '△', '△', 'X', '△',], - onplay: () => null + onPlay: () => null } export const RoundAndCrossAndTriangle = Template.bind({}) RoundAndCrossAndTriangle.args = { xIsNext: true, squares: ['X', 'O', 'O', '△', 'O', '△', 'X', 'X', '△',], - onplay: () => null + onPlay: () => null } \ No newline at end of file diff --git a/src/stories/Game.stories.js b/src/stories/Game.stories.js index 1743c57..e517d52 100644 --- a/src/stories/Game.stories.js +++ b/src/stories/Game.stories.js @@ -1,5 +1,4 @@ import Game from '../components/Game'; -import PropTypes from 'prop-types'; export default { title: 'Game', @@ -8,7 +7,4 @@ export default { const Template = args => -export const Empty = Template.bind() -Empty.args = { - value: '' -} +export const Default = Template.bind() \ No newline at end of file diff --git a/src/stories/Square.stories.js b/src/stories/Square.stories.js index 8710962..0f9b60e 100644 --- a/src/stories/Square.stories.js +++ b/src/stories/Square.stories.js @@ -28,6 +28,6 @@ SelectedByTriangle.args = { value: '△' } -Template.prototype = { +Template.propTypes = { value: PropTypes.oneOf(['', 'O', 'X', '△']) } \ No newline at end of file