diff options
author | Sebastian <sebasjm@gmail.com> | 2021-11-08 09:56:06 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-11-08 09:56:06 -0300 |
commit | 6ef5fd21fc365d780da42170ce85042f874ed1dc (patch) | |
tree | e9b86dc8949e1ad38d13f3b13814f3770de45675 /packages/anastasis-webui/src/pages/home/AuthenticationEditorScreen.tsx | |
parent | 292d647aa917ecef7fee3f1ebeee0411b4c9a0d6 (diff) | |
download | wallet-core-6ef5fd21fc365d780da42170ce85042f874ed1dc.tar.xz |
some solve challenge examples, WIP
Diffstat (limited to 'packages/anastasis-webui/src/pages/home/AuthenticationEditorScreen.tsx')
-rw-r--r-- | packages/anastasis-webui/src/pages/home/AuthenticationEditorScreen.tsx | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/packages/anastasis-webui/src/pages/home/AuthenticationEditorScreen.tsx b/packages/anastasis-webui/src/pages/home/AuthenticationEditorScreen.tsx index 93ca81194..a71220c55 100644 --- a/packages/anastasis-webui/src/pages/home/AuthenticationEditorScreen.tsx +++ b/packages/anastasis-webui/src/pages/home/AuthenticationEditorScreen.tsx @@ -1,10 +1,8 @@ -/* eslint-disable @typescript-eslint/camelcase */ import { AuthMethod } from "anastasis-core"; import { ComponentChildren, Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; -import { TextInput } from "../../components/fields/TextInput"; import { useAnastasisContext } from "../../context/anastasis"; -import { authMethods, KnownAuthMethods } from "./authMethod"; +import { authMethods, AuthMethodSetupProps, AuthMethodWithRemove, KnownAuthMethods } from "./authMethod"; import { AnastasisClientFrame } from "./index"; @@ -14,7 +12,7 @@ const getKeys = Object.keys as <T extends object>(obj: T) => Array<keyof T> export function AuthenticationEditorScreen(): VNode { const [noProvidersAck, setNoProvidersAck] = useState(false) const [selectedMethod, setSelectedMethod] = useState<KnownAuthMethods | undefined>(undefined); - const [addingProvider, setAddingProvider] = useState<string | undefined>(undefined) + // const [addingProvider, setAddingProvider] = useState<string | undefined>(undefined) const reducer = useAnastasisContext() if (!reducer) { @@ -63,7 +61,7 @@ export function AuthenticationEditorScreen(): VNode { setSelectedMethod(undefined); }; - const AuthSetup = authMethods[selectedMethod].screen ?? AuthMethodNotImplemented; + const AuthSetup = authMethods[selectedMethod].setup ?? AuthMethodNotImplemented; return (<Fragment> <AuthSetup cancel={cancel} @@ -88,10 +86,6 @@ export function AuthenticationEditorScreen(): VNode { ); } - if (addingProvider !== undefined) { - return <div /> - } - function MethodButton(props: { method: KnownAuthMethods }): VNode { if (authMethods[props.method].skip) return <div /> @@ -169,14 +163,6 @@ export function AuthenticationEditorScreen(): VNode { ); } -type AuthMethodWithRemove = AuthMethod & { remove: () => void } -export interface AuthMethodSetupProps { - method: string; - addAuthMethod: (x: any) => void; - configured: AuthMethodWithRemove[]; - cancel: () => void; -} - function AuthMethodNotImplemented(props: AuthMethodSetupProps): VNode { return ( <AnastasisClientFrame hideNav title={`Add ${props.method} authentication`}> |