diff options
author | Sebastian <sebasjm@gmail.com> | 2022-08-26 12:59:00 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-08-26 12:59:09 -0300 |
commit | cf894f1dd309e48d8be380c56175219027c84fb7 (patch) | |
tree | 8aa434c47d4ed366f4b3d5f0bd89fc696a388b9d /packages/anastasis-webui/src/pages/home/ChallengeOverviewScreen.tsx | |
parent | eef2d4702019b9de64efc01fff097b437e65ce39 (diff) | |
download | wallet-core-cf894f1dd309e48d8be380c56175219027c84fb7.tar.xz |
fix #7065
Diffstat (limited to 'packages/anastasis-webui/src/pages/home/ChallengeOverviewScreen.tsx')
-rw-r--r-- | packages/anastasis-webui/src/pages/home/ChallengeOverviewScreen.tsx | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/packages/anastasis-webui/src/pages/home/ChallengeOverviewScreen.tsx b/packages/anastasis-webui/src/pages/home/ChallengeOverviewScreen.tsx index 8de0ceb08..5b9c11bab 100644 --- a/packages/anastasis-webui/src/pages/home/ChallengeOverviewScreen.tsx +++ b/packages/anastasis-webui/src/pages/home/ChallengeOverviewScreen.tsx @@ -17,22 +17,25 @@ import { ChallengeFeedback, ChallengeFeedbackStatus, } from "@gnu-taler/anastasis-core"; -import { h, VNode } from "preact"; +import { Fragment, h, VNode } from "preact"; import { AsyncButton } from "../../components/AsyncButton.js"; import { useAnastasisContext } from "../../context/anastasis.js"; import { authMethods, KnownAuthMethods } from "./authMethod/index.js"; import { AnastasisClientFrame } from "./index.js"; -function OverviewFeedbackDisplay(props: { feedback?: ChallengeFeedback }) { +function OverviewFeedbackDisplay(props: { + feedback?: ChallengeFeedback; +}): VNode { const { feedback } = props; if (!feedback) { - return null; + return <Fragment />; } + switch (feedback.state) { case ChallengeFeedbackStatus.Solved: return <div />; case ChallengeFeedbackStatus.IbanInstructions: - return null; + return <div class="block has-text-info">Payment required.</div>; case ChallengeFeedbackStatus.ServerFailure: return <div class="block has-text-danger">Server error.</div>; case ChallengeFeedbackStatus.RateLimitExceeded: @@ -51,12 +54,20 @@ function OverviewFeedbackDisplay(props: { feedback?: ChallengeFeedback }) { case ChallengeFeedbackStatus.TruthUnknown: return ( <div class="block has-text-danger"> - Provider doesn't recognize the challenge of the policy. Contact - the provider for further information. + Provider doesn't recognize the type of challenge. Use another + version or contact the provider. </div> ); - default: - return <div />; + case ChallengeFeedbackStatus.IncorrectAnswer: + return ( + <div class="block has-text-danger">The answer was not correct.</div> + ); + case ChallengeFeedbackStatus.CodeInFile: + return <div class="block has-text-info">code in file</div>; + case ChallengeFeedbackStatus.CodeSent: + return <div class="block has-text-info">Code sent</div>; + case ChallengeFeedbackStatus.TalerPayment: + return <div class="block has-text-info">Payment required</div>; } } |