diff options
Diffstat (limited to 'packages/anastasis-webui/src/pages/home/ContinentSelectionScreen.tsx')
-rw-r--r-- | packages/anastasis-webui/src/pages/home/ContinentSelectionScreen.tsx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/packages/anastasis-webui/src/pages/home/ContinentSelectionScreen.tsx b/packages/anastasis-webui/src/pages/home/ContinentSelectionScreen.tsx index 2fed23d4e..ad529a4a7 100644 --- a/packages/anastasis-webui/src/pages/home/ContinentSelectionScreen.tsx +++ b/packages/anastasis-webui/src/pages/home/ContinentSelectionScreen.tsx @@ -1,15 +1,16 @@ import { h, VNode } from "preact"; -import { CommonReducerProps, AnastasisClientFrame, withProcessLabel } from "./index"; +import { useAnastasisContext } from "../../context/anastasis"; +import { AnastasisClientFrame, withProcessLabel } from "./index"; -export function ContinentSelectionScreen(props: CommonReducerProps): VNode { - const { reducer, reducerState } = props; +export function ContinentSelectionScreen(): VNode { + const reducer = useAnastasisContext() + if (!reducer || !reducer.currentReducerState || !("continents" in reducer.currentReducerState)) { + return <div /> + } const sel = (x: string): void => reducer.transition("select_continent", { continent: x }); return ( - <AnastasisClientFrame - hideNext - title={withProcessLabel(reducer, "Select Continent")} - > - {reducerState.continents.map((x: any) => ( + <AnastasisClientFrame hideNext title={withProcessLabel(reducer, "Select Continent")}> + {reducer.currentReducerState.continents.map((x: any) => ( <button onClick={() => sel(x.name)} key={x.name}> {x.name} </button> |