From fd7f00b1a523d057d0a56215095a7913601b2fa4 Mon Sep 17 00:00:00 2001
From: ChaotiCryptidz
Date: Fri, 21 Jan 2022 19:58:15 +0000
Subject: [PATCH] split unseal page into seporate form and qr files
---
src/ui/pages/Unseal.tsx | 36 ++++--------------------------------
src/ui/pages/Unseal_Form.tsx | 33 +++++++++++++++++++++++++++++++++
src/ui/pages/Unseal_QR.tsx | 9 +++++++++
3 files changed, 46 insertions(+), 32 deletions(-)
create mode 100644 src/ui/pages/Unseal_Form.tsx
create mode 100644 src/ui/pages/Unseal_QR.tsx
diff --git a/src/ui/pages/Unseal.tsx b/src/ui/pages/Unseal.tsx
index fc0e349..eae84f2 100644
--- a/src/ui/pages/Unseal.tsx
+++ b/src/ui/pages/Unseal.tsx
@@ -1,47 +1,19 @@
import { Button } from "../elements/Button";
import { Component, JSX } from "preact";
import { DefaultPageProps } from "../../types/DefaultPageProps";
-import { Form } from "../elements/Form";
-import { MarginInline } from "../elements/MarginInline";
import { PageTitle } from "../elements/PageTitle";
-import { QRScanner } from "../elements/QRScanner";
import { route } from "preact-router";
import { setErrorText } from "../../pageUtils";
import { toStr } from "../../utils";
import i18next from "i18next";
+import { UnsealForm } from "./Unseal_Form";
+import { UnsealQR } from "./Unseal_QR";
const UnsealInputModes = {
FORM_INPUT: "FORM_INPUT",
QR_INPUT: "QR_INPUT",
};
-export type UnsealFormInputProps = {
- onSubmit: (code: string) => void;
-};
-
-export function UnsealFormInput(props: UnsealFormInputProps): JSX.Element {
- return (
-
- );
-}
-
type UnsealPageState = {
mode: string;
keys_submitted: number;
@@ -115,11 +87,11 @@ export class Unseal extends Component {
{this.state.mode == UnsealInputModes.FORM_INPUT && (
- this.submitKey(code)} />
+ this.submitKey(code)} />
)}
{this.state.mode == UnsealInputModes.QR_INPUT && (
- this.submitKey(code)} />
+ this.submitKey(code)} />
)}