Removal of ignore notation in storybook eslint and transition to actions function (#489)

* fix: desprecated .storybook/main.ts and actions-addons

* remove: ignore notation in storybook eslint and transition to actions function

* remove: unnecessary eslint ignore code
This commit is contained in:
kame
2023-11-05 00:53:26 +09:00
committed by GitHub
parent de1915e1c2
commit 4c84b795a0
8 changed files with 32 additions and 38 deletions

View File

@@ -1,4 +1,4 @@
/* eslint-disable no-console */
import { action } from "@storybook/addon-actions";
import { StoryObj, StoryFn, Meta } from "@storybook/react";
import Modal, { ModalAction, ModalButtonStyle } from "./Modal";
@@ -23,14 +23,14 @@ const confirmModalActions: ModalAction[] = [
id: "1",
text: "Cancel",
callback: () => {
console.log("confirmModal: clicked Cancel");
action("cancelCallback")("confirmModal: clicked Cancel");
},
},
{
id: "2",
text: "Confirm",
callback: () => {
console.log("confirmModal: clicked Confirm");
action("confirmCallback")("confirmModal: clicked Confirm");
},
variant: ModalButtonStyle.info,
},
@@ -53,14 +53,14 @@ const customModalActions: ModalAction[] = [
className:
"text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800",
callback: () => {
console.log("confirmModal: clicked custom button 1");
action("clickCustomButton")("confirmModal: clicked custom button 1");
},
},
{
id: "2",
text: "custom button 2",
callback: () => {
console.log("confirmModal: clicked custom button 2");
action("clickCustomButton")("confirmModal: clicked custom button 2");
},
variant: ModalButtonStyle.error,
},
@@ -76,7 +76,7 @@ export const CustomModal: StoryObj<typeof Modal> = {
<button
className="bg-cyan-500 p-2"
type="button"
onClick={() => console.log("just a button")}
onClick={() => action("onClick")("just a button")}
>
Just a button
</button>