-
Notifications
You must be signed in to change notification settings - Fork 2
Feat/kobayashi/creatingstories file/teacher #879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Ryotakobayash
wants to merge
5
commits into
develop
Choose a base branch
from
feat/kobayashi/CreatingstoriesFile/Teacher
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ee5ecd7
[add]index.ts
Ryotakobayash 3c4d3f9
[add]AddModal.stories.tsx
Ryotakobayash f435f04
[add]DeleteModal.stories.tsx
Ryotakobayash c038cc4
[add]EditModal.stories.tsx
Ryotakobayash 45ca4df
[add]Open(Add,Delete,Edit)ModalButton.stories.tsx
Ryotakobayash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,6 @@ | ||
| export { default as AddModal } from './AddModal'; | ||
| export { default as DeleteModal } from './DeleteModal'; | ||
| export { default as EditModal } from './EditModal'; | ||
| export { default as OpenAddModalButton } from './OpenAddModalButton'; | ||
| export { default as OpenDeleteModalButton } from './OpenDeleteModalButton'; | ||
| export { default as OpenEditModalButton } from './OpenEditModalButton'; |
36 changes: 36 additions & 0 deletions
36
view/next-project/src/stories/teacher/AddModal.stories.tsx
This file contains hidden or 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,36 @@ | ||||||||||||||||
| import { Meta, StoryFn } from '@storybook/react'; | ||||||||||||||||
| import { SetStateAction } from 'react'; | ||||||||||||||||
| import { AddModal } from '@components/teacher'; | ||||||||||||||||
| import { Department } from '@type/common'; | ||||||||||||||||
|
|
||||||||||||||||
| export default { | ||||||||||||||||
| title: 'FinanSu/teacher/AddModal', | ||||||||||||||||
| component: AddModal, | ||||||||||||||||
| argTypes: {}, | ||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
booleanを切り替えできるようにしたいです。 |
||||||||||||||||
| tags: ['autodocs'], | ||||||||||||||||
| } as Meta<typeof AddModal>; | ||||||||||||||||
|
|
||||||||||||||||
| const sampleDepartments: Department[] = [ | ||||||||||||||||
| { | ||||||||||||||||
| id: 0, | ||||||||||||||||
| name: '機械工学分野', | ||||||||||||||||
| }, | ||||||||||||||||
| { | ||||||||||||||||
| id: 1, | ||||||||||||||||
| name: '機械工学科', | ||||||||||||||||
| }, | ||||||||||||||||
| ]; | ||||||||||||||||
|
|
||||||||||||||||
| export const Primary: StoryFn<typeof AddModal> = (args) => <AddModal {...args} />; | ||||||||||||||||
| Primary.args = { | ||||||||||||||||
| departments: sampleDepartments, | ||||||||||||||||
| setShowModal: (value: SetStateAction<boolean>) => { | ||||||||||||||||
| if (typeof value === 'boolean') { | ||||||||||||||||
| console.log('Modal is now', value ? 'open' : 'closed'); | ||||||||||||||||
| } else { | ||||||||||||||||
| // value が関数の場合、前の状態を仮定して新しい状態を計算 | ||||||||||||||||
| const newState = value(false); // ここでの false は仮の前状態 | ||||||||||||||||
| console.log('Modal is now', newState ? 'open' : 'closed'); | ||||||||||||||||
| } | ||||||||||||||||
| }, | ||||||||||||||||
| }; | ||||||||||||||||
18 changes: 18 additions & 0 deletions
18
view/next-project/src/stories/teacher/DeleteModal.stories.tsx
This file contains hidden or 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,18 @@ | ||
| import { Meta } from '@storybook/react'; | ||
| import { DeleteModal } from '@components/teacher'; | ||
|
|
||
| const meta: Meta<typeof DeleteModal> = { | ||
| title: 'FinanSu/teacher/DeleteModal', | ||
| component: DeleteModal, | ||
| tags: ['autodocs'], | ||
| argTypes: {}, | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| export const Primary = { | ||
| args: { | ||
| className: 'm-10', | ||
| children: <h1>children</h1>, | ||
| }, | ||
| }; |
50 changes: 50 additions & 0 deletions
50
view/next-project/src/stories/teacher/EditModal.stories.tsx
This file contains hidden or 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,50 @@ | ||
| import { Meta, StoryFn } from '@storybook/react'; | ||
| import { SetStateAction } from 'react'; | ||
| import EditModal from '@components/teacher/EditModal'; | ||
| import { Teacher, Department } from '@type/common'; | ||
|
|
||
| export default { | ||
| title: 'FinanSu/teacher/EditModal', | ||
| component: EditModal, | ||
| argTypes: {}, | ||
| } as Meta<typeof EditModal>; | ||
|
|
||
| const sampleTeacher: Teacher = { | ||
| id: 123, | ||
| name: '小笠原優心', | ||
| position: '准教授', | ||
| departmentID: 123, | ||
| room: 'string', | ||
| isBlack: true, | ||
| remark: 'test', | ||
| isDeleted: false, | ||
| createdAt: '2021-01-01T00:00:00', | ||
| updatedAt: '2021-01-01T00:00:00', | ||
| }; | ||
|
|
||
| const sampleDepartments: Department[] = [ | ||
| { | ||
| id: 123, | ||
| name: '情報工学科', | ||
| }, | ||
| { | ||
| id: 124, | ||
| name: '機械工学科', | ||
| }, | ||
| ]; | ||
|
|
||
| export const Primary: StoryFn<typeof EditModal> = (args) => <EditModal {...args} />; | ||
| Primary.args = { | ||
| id: 123, | ||
| teacher: sampleTeacher, | ||
| departments: sampleDepartments, | ||
| setShowModal: (value: SetStateAction<boolean>) => { | ||
| if (typeof value === 'boolean') { | ||
| console.log('Modal is now', value ? 'open' : 'closed'); | ||
| } else { | ||
| // value が関数の場合、前の状態を仮定して新しい状態を計算 | ||
| const newState = value(false); // ここでの false は仮の前状態 | ||
| console.log('Modal is now', newState ? 'open' : 'closed'); | ||
| } | ||
| }, | ||
| }; |
18 changes: 18 additions & 0 deletions
18
view/next-project/src/stories/teacher/OpenAddModalButton.stories.tsx
This file contains hidden or 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,18 @@ | ||
| import { Meta } from '@storybook/react'; | ||
| import { OpenAddModalButton } from '@components/teacher'; | ||
|
|
||
| const meta: Meta<typeof OpenAddModalButton> = { | ||
| title: 'FinanSu/teacher/OpenAddModalButton', | ||
| component: OpenAddModalButton, | ||
| tags: ['autodocs'], | ||
| argTypes: {}, | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| export const Primary = { | ||
| args: { | ||
| className: 'm-10', | ||
| children: <h1>children</h1>, | ||
| }, | ||
| }; |
18 changes: 18 additions & 0 deletions
18
view/next-project/src/stories/teacher/OpenDeleteModalButton.stories.tsx
This file contains hidden or 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,18 @@ | ||
| import { Meta } from '@storybook/react'; | ||
| import { OpenDeleteModalButton } from '@components/teacher'; | ||
|
|
||
| const meta: Meta<typeof OpenDeleteModalButton> = { | ||
| title: 'FinanSu/teacher/OpenDeleteModalButton', | ||
| component: OpenDeleteModalButton, | ||
| tags: ['autodocs'], | ||
| argTypes: {}, | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| export const Primary = { | ||
| args: { | ||
| className: 'm-10', | ||
| children: <h1>children</h1>, | ||
| }, | ||
| }; |
18 changes: 18 additions & 0 deletions
18
view/next-project/src/stories/teacher/OpenEditModalButton.stories.tsx
This file contains hidden or 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,18 @@ | ||
| import { Meta } from '@storybook/react'; | ||
| import { OpenEditModalButton } from '@components/teacher'; | ||
|
|
||
| const meta: Meta<typeof OpenEditModalButton> = { | ||
| title: 'FinanSu/teacher/OpenEditModalButton', | ||
| component: OpenEditModalButton, | ||
| tags: ['autodocs'], | ||
| argTypes: {}, | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| export const Primary = { | ||
| args: { | ||
| className: 'm-10', | ||
| children: <h1>children</h1>, | ||
| }, | ||
| }; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
治し方いまいち分からなかったんですがdocs開いたときにモーダルの表示範囲が異様に小さくて見えないのがきになりました。
