/* * Copyright (c) 2020 - present Cloudogu GmbH * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, version 3. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. */ import React, { useState } from "react"; import { storiesOf } from "@storybook/react"; import Toast from "./Toast"; import ToastButtons from "./ToastButtons"; import ToastButton from "./ToastButton"; import { types } from "./themes"; import ToastArea from "./ToastArea"; import ToastNotification from "./ToastNotification"; const toastStories = storiesOf("Toast", module); const AnimatedToast = () => ( Awesome animated Toast ); const Animator = () => { const [display, setDisplay] = useState(false); return (
{display && }
); }; const Closeable = () => { const [show, setShow] = useState(true); const hide = () => { setShow(false); }; if (!show) { return null; } return (

Close the message with a click

Click to close
); }; toastStories.add("Open/Close", () => ); toastStories.add("Click to close", () => ); types.forEach((type) => { toastStories.add(type.charAt(0).toUpperCase() + type.slice(1), () => (

The underlying Pull-Request has changed. Press reload to see the changes.

Warning: Non saved modification will be lost.

Reload Ignore
)); }); toastStories.add("Multiple", () => ( {types.map((type) => (

The notification received.

))}
));