aboutsummaryrefslogtreecommitdiff
path: root/packages/anastasis-webui/src/pages/home/CountrySelectionScreen.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/anastasis-webui/src/pages/home/CountrySelectionScreen.tsx')
-rw-r--r--packages/anastasis-webui/src/pages/home/CountrySelectionScreen.tsx23
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/anastasis-webui/src/pages/home/CountrySelectionScreen.tsx b/packages/anastasis-webui/src/pages/home/CountrySelectionScreen.tsx
new file mode 100644
index 000000000..dbe4b7616
--- /dev/null
+++ b/packages/anastasis-webui/src/pages/home/CountrySelectionScreen.tsx
@@ -0,0 +1,23 @@
+/* eslint-disable @typescript-eslint/camelcase */
+import { h, VNode } from "preact";
+import { CommonReducerProps, AnastasisClientFrame, withProcessLabel } from "./index";
+
+export function CountrySelectionScreen(props: CommonReducerProps): VNode {
+ const { reducer, reducerState } = props;
+ const sel = (x: any): void => reducer.transition("select_country", {
+ country_code: x.code,
+ currencies: [x.currency],
+ });
+ return (
+ <AnastasisClientFrame
+ hideNext
+ title={withProcessLabel(reducer, "Select Country")}
+ >
+ {reducerState.countries.map((x: any) => (
+ <button onClick={() => sel(x)} key={x.name}>
+ {x.name} ({x.currency})
+ </button>
+ ))}
+ </AnastasisClientFrame>
+ );
+}