
added placeholders for inputs import declaration for png next button now has tooltip providing info about whats missing a lot more of examples for UI testing added qr dependency for totp rendering added email and field input types added all auth method setup screens added modal when there is not auth provider merge continent and country into location section others improvements as well...
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
/* eslint-disable @typescript-eslint/camelcase */
|
|
import { h, VNode } from "preact";
|
|
import { useAnastasisContext } from "../../context/anastasis";
|
|
import { AnastasisClientFrame, withProcessLabel } from "./index";
|
|
|
|
export function CountrySelectionScreen(): VNode {
|
|
const reducer = useAnastasisContext()
|
|
if (!reducer) {
|
|
return <div>no reducer in context</div>
|
|
}
|
|
if (!reducer.currentReducerState || !("countries" in reducer.currentReducerState)) {
|
|
return <div>invalid state</div>
|
|
}
|
|
const sel = (x: any): void => reducer.transition("select_country", {
|
|
country_code: x.code,
|
|
currencies: [x.currency],
|
|
});
|
|
return (
|
|
<AnastasisClientFrame hideNext title={withProcessLabel(reducer, "Select Country")} >
|
|
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
{reducer.currentReducerState.countries!.map((x: any) => (
|
|
<div key={x.name}>
|
|
<button class="button" onClick={() => sel(x)} >
|
|
{x.name} ({x.currency})
|
|
</button>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</AnastasisClientFrame>
|
|
);
|
|
}
|