2020-10-06 19:51:21 +00:00
|
|
|
import React from "react";
|
|
|
|
import { Meta } from "@storybook/react";
|
|
|
|
|
2020-10-27 11:25:54 +00:00
|
|
|
import serverInfo from "../context/server-info/__tests__/mock.json";
|
|
|
|
import { ServerInfoContext } from "../context/server-info/ServerInfoProvider";
|
|
|
|
|
2020-10-06 19:51:21 +00:00
|
|
|
import {
|
|
|
|
DownloadDialog,
|
|
|
|
useDownloadDialog,
|
|
|
|
} from "../components/download-dialog/DownloadDialog";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
title: "Download Dialog",
|
|
|
|
component: DownloadDialog,
|
|
|
|
} as Meta;
|
|
|
|
|
|
|
|
const Test = () => {
|
|
|
|
const [toggle, Dialog] = useDownloadDialog({
|
|
|
|
id: "58577281-7af7-410c-a085-61ff3040be6d",
|
|
|
|
});
|
|
|
|
return (
|
2020-10-27 11:25:54 +00:00
|
|
|
<ServerInfoContext.Provider value={serverInfo}>
|
2020-10-06 19:51:21 +00:00
|
|
|
<button id="show" onClick={toggle}>
|
|
|
|
Show
|
|
|
|
</button>
|
|
|
|
<Dialog />
|
2020-10-27 11:25:54 +00:00
|
|
|
</ServerInfoContext.Provider>
|
2020-10-06 19:51:21 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const Show = () => <Test />;
|