Update Create.stories.js
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import React, { useState } from "react";
|
|
||||||
import Create from "../app/components/Create";
|
import Create from "../app/components/Create";
|
||||||
import Input from "../app/components/Input";
|
import Input from "../app/components/Input";
|
||||||
|
|
||||||
@@ -44,20 +43,10 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const Template = (args) => {
|
const Template = (args) => {
|
||||||
const [isOpen, setIsOpen] = useState(args.isOpen || false);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p-8">
|
<Create {...args} isOpen={true} onClose={() => {}}>
|
||||||
<button
|
|
||||||
onClick={() => setIsOpen(true)}
|
|
||||||
className="px-4 py-2 bg-blue-500 text-white rounded"
|
|
||||||
>
|
|
||||||
Open Create Dialog
|
|
||||||
</button>
|
|
||||||
<Create {...args} isOpen={isOpen} onClose={() => setIsOpen(false)}>
|
|
||||||
{args.children}
|
{args.children}
|
||||||
</Create>
|
</Create>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user