summaryrefslogtreecommitdiff
path: root/packages/anastasis-webui/src/pages/home/index.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2021-10-26 12:08:03 -0300
committerSebastian <sebasjm@gmail.com>2021-10-26 12:08:08 -0300
commit21b60c8f6ff69bf114779a767a3ac3355f69a34f (patch)
treec548dd7601b24d9dae4173d725656d35ce4bc26e /packages/anastasis-webui/src/pages/home/index.tsx
parent835ac85a28dc11b5d7f5cff041ff7973d244e07e (diff)
downloadwallet-core-21b60c8f6ff69bf114779a767a3ac3355f69a34f.tar.gz
wallet-core-21b60c8f6ff69bf114779a767a3ac3355f69a34f.tar.bz2
wallet-core-21b60c8f6ff69bf114779a767a3ac3355f69a34f.zip
added core validators, worked on look and feel
Diffstat (limited to 'packages/anastasis-webui/src/pages/home/index.tsx')
-rw-r--r--packages/anastasis-webui/src/pages/home/index.tsx42
1 files changed, 8 insertions, 34 deletions
diff --git a/packages/anastasis-webui/src/pages/home/index.tsx b/packages/anastasis-webui/src/pages/home/index.tsx
index 4cec47ec8..5cef4ee9c 100644
--- a/packages/anastasis-webui/src/pages/home/index.tsx
+++ b/packages/anastasis-webui/src/pages/home/index.tsx
@@ -11,10 +11,7 @@ import {
VNode
} from "preact";
import {
- useErrorBoundary,
- useLayoutEffect,
- useRef
-} from "preact/hooks";
+ useErrorBoundary} from "preact/hooks";
import { Menu } from "../../components/menu";
import { AnastasisProvider, useAnastasisContext } from "../../context/anastasis";
import {
@@ -25,6 +22,7 @@ import { AttributeEntryScreen } from "./AttributeEntryScreen";
import { AuthenticationEditorScreen } from "./AuthenticationEditorScreen";
import { BackupFinishedScreen } from "./BackupFinishedScreen";
import { ChallengeOverviewScreen } from "./ChallengeOverviewScreen";
+import { ChallengePayingScreen } from "./ChallengePayingScreen";
import { ContinentSelectionScreen } from "./ContinentSelectionScreen";
import { CountrySelectionScreen } from "./CountrySelectionScreen";
import { PoliciesPayingScreen } from "./PoliciesPayingScreen";
@@ -118,9 +116,9 @@ export function AnastasisClientFrame(props: AnastasisClientFrameProps): VNode {
<ErrorBanner />
{props.children}
{!props.hideNav ? (
- <div>
- <button onClick={() => reducer.back()}>Back</button>
- {!props.hideNext ? <button onClick={next}>Next</button> : null}
+ <div style={{marginTop: '2em', display:'flex', justifyContent:'space-between'}}>
+ <button class="button" onClick={() => reducer.back()}>Back</button>
+ {!props.hideNext ? <button class="button is-info"onClick={next}>Next</button> : null}
</div>
) : null}
</div>
@@ -222,7 +220,9 @@ const AnastasisClientImpl: FunctionalComponent = () => {
<RecoveryFinishedScreen />
);
}
-
+ if (state.recovery_state === RecoveryStates.ChallengePaying) {
+ return <ChallengePayingScreen />;
+ }
console.log("unknown state", reducer.currentReducerState);
return (
<AnastasisClientFrame hideNav title="Bug">
@@ -234,32 +234,6 @@ const AnastasisClientImpl: FunctionalComponent = () => {
);
};
-interface LabeledInputProps {
- label: string;
- grabFocus?: boolean;
- bind: [string, (x: string) => void];
-}
-
-export function LabeledInput(props: LabeledInputProps): VNode {
- const inputRef = useRef<HTMLInputElement>(null);
- useLayoutEffect(() => {
- if (props.grabFocus) {
- inputRef.current?.focus();
- }
- }, [props.grabFocus]);
- return (
- <label>
- {props.label}
- <input
- value={props.bind[0]}
- onChange={(e) => props.bind[1]((e.target as HTMLInputElement).value)}
- ref={inputRef}
- style={{ display: "block" }}
- />
- </label>
- );
-}
-
/**
* Show a dismissible error banner if there is a current error.
*/