Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion view/next-project/src/components/users/DeleteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { multiDel } from '@api/api_methods';
import { Modal, CloseButton, OutlinePrimaryButton, PrimaryButton } from '@components/common';
import { User } from '@type/common';

interface ModalProps {
export interface ModalProps {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export interface ModalProps {
interface ModalProps {

多分exportいらないです!

setShowModal: Dispatch<SetStateAction<boolean>>;
children?: React.ReactNode;
deleteUsers?: { users: User[]; ids: number[] };
Expand Down
2 changes: 1 addition & 1 deletion view/next-project/src/components/users/EditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ROLES } from '@/constants/role';
import { put } from '@api/user';
import { Bureau, User } from '@type/common';

interface ModalProps {
export interface ModalProps {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export interface ModalProps {
interface ModalProps {

ここも!

setShowModal: Dispatch<SetStateAction<boolean>>;
id: number | string;
bureaus: Bureau[];
Expand Down
4 changes: 4 additions & 0 deletions view/next-project/src/components/users/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { default as DeleteModal } from './DeleteModal';
export { default as EditModal } from './EditModal';
export { default as OpenDeleteModalButton } from './OpenDeleteModalButton';
export { default as OpenEditModalButton } from './OpenEditModalButton';
18 changes: 18 additions & 0 deletions view/next-project/src/stories/users/DeleteModal.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Meta } from '@storybook/react';
import { DeleteModal } from '@components/users/';

const meta: Meta<typeof DeleteModal> = {
title: 'FinanSu/users/DeleteModal',
component: DeleteModal,
tags: ['autodocs'],
argTypes: {},
};

export default meta;

export const Primary = {
args: {
className: 'm-10',
children: <h1>children</h1>,
},
};
31 changes: 31 additions & 0 deletions view/next-project/src/stories/users/EditModal.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Meta, StoryFn } from '@storybook/react';
import { EditModal } from '@components/users'; // 名前のインポートを修正

const meta: Meta<typeof EditModal> = {
title: 'FinanSu/users/EditModal',
component: EditModal,
tags: ['autodocs'],
argTypes: {},
};

export default meta;

const Template: StoryFn<typeof EditModal> = (args) => <EditModal {...args} />;

export const Primary = Template.bind({});
Primary.args = {
setShowModal: () => {
// Add your implementation here
},
id: 1,
bureaus: [
{ id: 1, name: 'Bureau 1' },
{ id: 2, name: 'Bureau 2' },
],
user: {
id: 1,
name: 'John Doe',
bureauID: 1,
roleID: 1,
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Meta } from '@storybook/react';
import { OpenDeleteModalButton } from '@components/users';

const meta: Meta<typeof OpenDeleteModalButton> = {
title: 'FinanSu/users/OpenDeleteModalButton',
component: OpenDeleteModalButton,
tags: ['autodocs'],
argTypes: {},
};

export default meta;

export const Primary = {
args: {
className: 'm-10',
children: <h1>children</h1>,
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Meta } from '@storybook/react';
import { OpenEditModalButton } from '@components/users';

const meta: Meta<typeof OpenEditModalButton> = {
title: 'FinanSu/users/OpenEditModalButton',
component: OpenEditModalButton,
tags: ['autodocs'],
argTypes: {},
};

export default meta;

export const Primary = {
args: {
className: 'm-10',
children: <h1>children</h1>,
},
};