From a1c5917e626856f2abd9dbe6ddaa71c1458334c6 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Fri, 26 Apr 2024 14:31:48 -0300
Subject: update code to match others

---
 packages/aml-backoffice-ui/src/stories.tsx | 51 +++++++++++++++++++-----------
 1 file changed, 32 insertions(+), 19 deletions(-)

(limited to 'packages/aml-backoffice-ui/src/stories.tsx')

diff --git a/packages/aml-backoffice-ui/src/stories.tsx b/packages/aml-backoffice-ui/src/stories.tsx
index 017a31ffa..a66396696 100644
--- a/packages/aml-backoffice-ui/src/stories.tsx
+++ b/packages/aml-backoffice-ui/src/stories.tsx
@@ -1,6 +1,6 @@
 /*
  This file is part of GNU Taler
- (C) 2022 Taler Systems S.A.
+ (C) 2022-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
@@ -22,10 +22,14 @@ import { strings } from "./i18n/strings.js";
 
 import * as pages from "./pages/index.stories.js";
 
-import { renderStories } from "@gnu-taler/web-util/browser";
+import {
+  ExchangeApiProviderTesting,
+  ExchangeContextType,
+  renderStories,
+} from "@gnu-taler/web-util/browser";
 
+import { TalerExchangeApi } from "@gnu-taler/taler-util";
 import { ComponentChildren, FunctionComponent, VNode, h } from "preact";
-import { ExchangeApiContextTesting } from "./context/config.js";
 import "./scss/main.css";
 
 function main(): void {
@@ -40,24 +44,33 @@ function main(): void {
 
 function getWrapperForGroup(): FunctionComponent {
   return function All({ children }: { children?: ComponentChildren }): VNode {
+    const config: TalerExchangeApi.ExchangeVersionResponse = {
+      currency: "ARS",
+      currency_specification: {
+        alt_unit_names: {},
+        name: "ARS",
+        num_fractional_input_digits: 2,
+        num_fractional_normal_digits: 2,
+        num_fractional_trailing_zero_digits: 2,
+      },
+      name: "taler-exchange",
+      supported_kyc_requirements: [],
+      version: "asd",
+    };
+    const value: ExchangeContextType = {
+      cancelRequest: () => null,
+      config,
+      url: new URL("/", "http://locahost"),
+      hints: [],
+      lib: {
+        exchange: undefined!, //FIXME: mock
+      },
+      onActivity: () => null!,
+    };
     return (
-      <ExchangeApiContextTesting
-        config={{
-          currency: "ARS",
-          currency_specification: {
-            alt_unit_names: {},
-            name: "ARS",
-            num_fractional_input_digits: 2,
-            num_fractional_normal_digits: 2,
-            num_fractional_trailing_zero_digits: 2,
-          },
-          name: "taler-exchange",
-          supported_kyc_requirements: [],
-          version: "asd",
-        }}
-      >
+      <ExchangeApiProviderTesting value={value}>
         {children}
-      </ExchangeApiContextTesting>
+      </ExchangeApiProviderTesting>
     );
   };
 }
-- 
cgit v1.2.3

