From 2ec2161a7e1c0787b5e9ea14311f19c6b6a52d63 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Fri, 22 Oct 2021 01:31:46 -0300
Subject: some storybook exmaples

---
 packages/anastasis-webui/src/pages/home/SolveSmsEntry.tsx | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

(limited to 'packages/anastasis-webui/src/pages/home/SolveSmsEntry.tsx')

diff --git a/packages/anastasis-webui/src/pages/home/SolveSmsEntry.tsx b/packages/anastasis-webui/src/pages/home/SolveSmsEntry.tsx
index d0cd41332..163e0d1f3 100644
--- a/packages/anastasis-webui/src/pages/home/SolveSmsEntry.tsx
+++ b/packages/anastasis-webui/src/pages/home/SolveSmsEntry.tsx
@@ -1,14 +1,17 @@
 import { h, VNode } from "preact";
 import { useState } from "preact/hooks";
+import { useAnastasisContext } from "../../context/anastasis";
 import { AnastasisClientFrame, LabeledInput } from "./index";
 import { SolveEntryProps } from "./SolveScreen";
 
-export function SolveSmsEntry(props: SolveEntryProps): VNode {
+export function SolveSmsEntry({ challenge, feedback }: SolveEntryProps): VNode {
   const [answer, setAnswer] = useState("");
-  const { reducer, challenge, feedback } = props;
-  const next = (): void => reducer.transition("solve_challenge", {
-    answer,
-  });
+  const reducer = useAnastasisContext()
+  const next = (): void => {
+    if (reducer) reducer.transition("solve_challenge", {
+      answer,
+    })
+  };
   return (
     <AnastasisClientFrame
       title="Recovery: Solve challenge"
-- 
cgit v1.2.3

