diff options
author | Sebastian <sebasjm@gmail.com> | 2021-07-01 00:35:41 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-07-01 00:35:50 -0300 |
commit | a8e4f2d612fcf29c1b19bed999441211ed51ac08 (patch) | |
tree | 92c3cc110f6a723f659523f1b6d891ee361c0694 /packages/taler-wallet-webextension/src/popup | |
parent | 23dab91ee9e2ffcac381cc27183716b6881e0a88 (diff) | |
download | wallet-core-a8e4f2d612fcf29c1b19bed999441211ed51ac08.tar.xz |
take backup info from wallet-core
Diffstat (limited to 'packages/taler-wallet-webextension/src/popup')
-rw-r--r-- | packages/taler-wallet-webextension/src/popup/Backup.stories.tsx | 5 | ||||
-rw-r--r-- | packages/taler-wallet-webextension/src/popup/BackupPage.tsx | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/packages/taler-wallet-webextension/src/popup/Backup.stories.tsx b/packages/taler-wallet-webextension/src/popup/Backup.stories.tsx index 0f51f3897..856360ebf 100644 --- a/packages/taler-wallet-webextension/src/popup/Backup.stories.tsx +++ b/packages/taler-wallet-webextension/src/popup/Backup.stories.tsx @@ -19,6 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ +import { ProviderPaymentType } from '@gnu-taler/taler-wallet-core/src/operations/backup'; import { FunctionalComponent } from 'preact'; import { BackupView as TestedComponent } from './BackupPage'; @@ -52,7 +53,7 @@ export const Example = createExample(TestedComponent, { "43Q5WWRJPNS4SE9YKS54H9THDS94089EDGXW9EHBPN6E7M184XEG" ], "paymentStatus": { - "type": 'paid', + "type": ProviderPaymentType.Paid, "paidUntil": { "t_ms": 1656599921000 } @@ -68,7 +69,7 @@ export const Example = createExample(TestedComponent, { "syncProviderBaseUrl": "http://sync.demo.taler.net/", "paymentProposalIds": [], "paymentStatus": { - "type": 'unpaid', + "type": ProviderPaymentType.Unpaid, }, "terms": { "annualFee": "KUDOS:0.1", diff --git a/packages/taler-wallet-webextension/src/popup/BackupPage.tsx b/packages/taler-wallet-webextension/src/popup/BackupPage.tsx index d13f5244d..9900720d9 100644 --- a/packages/taler-wallet-webextension/src/popup/BackupPage.tsx +++ b/packages/taler-wallet-webextension/src/popup/BackupPage.tsx @@ -19,11 +19,14 @@ import { Timestamp } from "@gnu-taler/taler-util"; // import { ProviderPaymentStatus } from "@gnu-taler/taler-wallet-core/src/operations/backup"; import { formatDuration, intervalToDuration } from "date-fns"; import { JSX, VNode } from "preact"; -import { ProvidersByCurrency, useProvidersByCurrency } from "../hooks/useProvidersByCurrency"; +import { ProvidersByCurrency, useBackupStatus } from "../hooks/useProvidersByCurrency"; export function BackupPage(): VNode { - const providers = useProvidersByCurrency() - return <BackupView deviceName={"thisdevicename"} providers={providers}/>; + const status = useBackupStatus() + if (!status) { + return <div>Loading...</div> + } + return <BackupView deviceName={status.deviceName} providers={status.providers}/>; } export interface ViewProps { |