From 75ff04672c011cf4c47b8f07d327adbf59323396 Mon Sep 17 00:00:00 2001 From: Nic Eigel Date: Mon, 24 Jun 2024 09:16:33 +0200 Subject: fixing merge-error --- .../notifications/CreatedSuccessfully.tsx | 57 ------------------- .../notifications/Notifications.stories.tsx | 62 --------------------- .../src/components/notifications/index.tsx | 65 ---------------------- 3 files changed, 184 deletions(-) delete mode 100644 packages/auditor-backoffice-ui/src/components/notifications/CreatedSuccessfully.tsx delete mode 100644 packages/auditor-backoffice-ui/src/components/notifications/Notifications.stories.tsx delete mode 100644 packages/auditor-backoffice-ui/src/components/notifications/index.tsx (limited to 'packages/auditor-backoffice-ui/src/components/notifications') diff --git a/packages/auditor-backoffice-ui/src/components/notifications/CreatedSuccessfully.tsx b/packages/auditor-backoffice-ui/src/components/notifications/CreatedSuccessfully.tsx deleted file mode 100644 index 5cd8a237b..000000000 --- a/packages/auditor-backoffice-ui/src/components/notifications/CreatedSuccessfully.tsx +++ /dev/null @@ -1,57 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021-2024 Taler Systems S.A. - - GNU Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - GNU Taler 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along with - GNU Taler; see the file COPYING. If not, see - */ -/** - * - * @author Sebastian Javier Marchano (sebasjm) - */ -import { ComponentChildren, h, VNode } from "preact"; - -interface Props { - onCreateAnother?: () => void; - onConfirm: () => void; - children: ComponentChildren; -} - -export function CreatedSuccessfully({ - children, - onConfirm, - onCreateAnother, -}: Props): VNode { - return ( -
-
-
-
-
-

Success.

-
-
{children}
-
-
- {onCreateAnother && ( - - )} - -
-
-
-
- ); -} diff --git a/packages/auditor-backoffice-ui/src/components/notifications/Notifications.stories.tsx b/packages/auditor-backoffice-ui/src/components/notifications/Notifications.stories.tsx deleted file mode 100644 index d75c5ced2..000000000 --- a/packages/auditor-backoffice-ui/src/components/notifications/Notifications.stories.tsx +++ /dev/null @@ -1,62 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021-2024 Taler Systems S.A. - - GNU Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - GNU Taler 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along with - GNU Taler; see the file COPYING. If not, see - */ - -/** - * - * @author Sebastian Javier Marchano (sebasjm) - */ - -import { h } from "preact"; -import { Notifications } from "./index.js"; - -export default { - title: "Components/Notification", - component: Notifications, - argTypes: { - removeNotification: { action: "removeNotification" }, - }, -}; - -export const Info = (a: any) => ; -Info.args = { - notifications: [ - { - message: "Title", - description: "Some large description", - type: "INFO", - }, - ], -}; -export const Warn = (a: any) => ; -Warn.args = { - notifications: [ - { - message: "Title", - description: "Some large description", - type: "WARN", - }, - ], -}; -export const Error = (a: any) => ; -Error.args = { - notifications: [ - { - message: "Title", - description: "Some large description", - type: "ERROR", - }, - ], -}; diff --git a/packages/auditor-backoffice-ui/src/components/notifications/index.tsx b/packages/auditor-backoffice-ui/src/components/notifications/index.tsx deleted file mode 100644 index 0c4e0d761..000000000 --- a/packages/auditor-backoffice-ui/src/components/notifications/index.tsx +++ /dev/null @@ -1,65 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021-2024 Taler Systems S.A. - - GNU Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - GNU Taler 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along with - GNU Taler; see the file COPYING. If not, see - */ - -/** - * - * @author Sebastian Javier Marchano (sebasjm) - */ - -import { h, VNode } from "preact"; -import { MessageType, Notification } from "../../utils/types.js"; - -interface Props { - notifications: Notification[]; - removeNotification?: (n: Notification) => void; -} - -function messageStyle(type: MessageType): string { - switch (type) { - case "INFO": - return "message is-info"; - case "WARN": - return "message is-warning"; - case "ERROR": - return "message is-danger"; - case "SUCCESS": - return "message is-success"; - default: - return "message"; - } -} - -export function Notifications({ - notifications, - removeNotification, -}: Props): VNode { - return ( -
- {notifications.map((n, i) => ( -
-
-

{n.message}

-
- {n.description &&
{n.description}
} -
- ))} -
- ); -} -- cgit v1.2.3