From 38a6ded8aedc3af4b4e661b12bf30c4040f0b793 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Fri, 14 Oct 2022 10:40:01 +0200 Subject: [PATCH] fixed paths --- package.json | 4 +- src/App.tsx | 24 + src/LoadingScreen.tsx | 11 + src/components/OpenMailButton.tsx | 2 +- src/constants/react-query.ts | 1 + .../EmailForm/DetectEmailAutofillService.tsx | 13 +- src/route-widgets/root/EmailForm/index.tsx | 6 +- .../root/EmailForm/use-schema.ts | 4 +- src/route-widgets/root/PasswordForm.tsx | 4 +- src/routes/Root.tsx | 5 + yarn.lock | 2733 ----------------- 11 files changed, 53 insertions(+), 2754 deletions(-) create mode 100644 src/App.tsx create mode 100644 src/LoadingScreen.tsx create mode 100644 src/constants/react-query.ts delete mode 100755 yarn.lock diff --git a/package.json b/package.json index 3ff6dc9..d90c692 100755 --- a/package.json +++ b/package.json @@ -11,7 +11,9 @@ "dependencies": { "@mui/lab": "^5.0.0-alpha.103", "@mui/material": "^5.10.9", + "@tanstack/react-query": "^4.12.0", "axios": "^1.1.2", + "crypto-js": "^4.1.1", "formik": "^2.2.9", "openpgp": "^5.5.0", "react": "^18.2.0", @@ -34,7 +36,7 @@ "@typescript-eslint/eslint-plugin": "^5.40.0", "@typescript-eslint/parser": "^5.40.0", "@vitejs/plugin-react": "^2.1.0", - "eslint": "^8.25.0", + "eslint": "8.22.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-compat": "^4.0.2", "eslint-plugin-react": "^7.31.10", diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..9db4840 --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,24 @@ +import {createBrowserRouter, RouterProvider} from "react-router-dom"; +import RootRoute from "~/routes/Root"; +import React, {ReactElement} from "react"; +import {QueryClientProvider} from "@tanstack/react-query"; +import {queryClient} from "~/constants/react-query"; + +const router = createBrowserRouter([ + { + path: "/", + element: , + }, +]); + + +export default function App(): ReactElement { + return ( + + + + + + ) +} + diff --git a/src/LoadingScreen.tsx b/src/LoadingScreen.tsx new file mode 100644 index 0000000..f283692 --- /dev/null +++ b/src/LoadingScreen.tsx @@ -0,0 +1,11 @@ +import {Typography} from "@mui/material"; +import {ReactElement} from "react"; +import {SingleElementWrapper} from "~/components"; + +export default function LoadingScreen(): ReactElement { + return ( + + Loading... + + ) +} diff --git a/src/components/OpenMailButton.tsx b/src/components/OpenMailButton.tsx index 8654327..2f0edb2 100644 --- a/src/components/OpenMailButton.tsx +++ b/src/components/OpenMailButton.tsx @@ -1,7 +1,7 @@ import {ReactElement} from "react" import UAParser from "ua-parser-js" import {Button} from "@mui/material" -import {APP_LINK_MAP} from "utils" +import {APP_LINK_MAP} from "~/utils" import {IoMdMailOpen} from "react-icons/io" export interface OpenMailButtonProps { diff --git a/src/constants/react-query.ts b/src/constants/react-query.ts new file mode 100644 index 0000000..eb58589 --- /dev/null +++ b/src/constants/react-query.ts @@ -0,0 +1 @@ +export const queryClient = new QueryClient() diff --git a/src/route-widgets/root/EmailForm/DetectEmailAutofillService.tsx b/src/route-widgets/root/EmailForm/DetectEmailAutofillService.tsx index d71726d..57f76ef 100644 --- a/src/route-widgets/root/EmailForm/DetectEmailAutofillService.tsx +++ b/src/route-widgets/root/EmailForm/DetectEmailAutofillService.tsx @@ -1,16 +1,7 @@ import {ReactElement, useCallback, useEffect, useRef, useState} from "react" -import { - Alert, - Button, - Dialog, - DialogActions, - DialogContent, - DialogContentText, - DialogTitle, - Grid, -} from "@mui/material" +import {Alert, Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Grid,} from "@mui/material" import {MdCheck} from "react-icons/md" -import useSessionStorage from "hooks/use-session-storage" +import {useSessionStorage} from "react-use" export interface DetectEmailAutofillServiceProps { domains: string[] diff --git a/src/route-widgets/root/EmailForm/index.tsx b/src/route-widgets/root/EmailForm/index.tsx index a584363..e64840d 100644 --- a/src/route-widgets/root/EmailForm/index.tsx +++ b/src/route-widgets/root/EmailForm/index.tsx @@ -1,12 +1,12 @@ import {ReactElement} from "react" import {useFormik} from "formik" import useSchema, {Form} from "./use-schema" -import signup from "~/apis/signup" +import {signup} from "~/apis" import {MdEmail} from "react-icons/md" import {InputAdornment, TextField} from "@mui/material" import DetectEmailAutofillService from "./DetectEmailAutofillService" -import handleErrors from "utils/handle-errors" -import {MultiStepFormElement, SimpleForm} from "components" +import {handleErrors} from "~/utils" +import {MultiStepFormElement, SimpleForm} from "~/components" import {ServerSettings} from "~/types"; interface EmailFormProps { diff --git a/src/route-widgets/root/EmailForm/use-schema.ts b/src/route-widgets/root/EmailForm/use-schema.ts index f34eaae..153d2fb 100644 --- a/src/route-widgets/root/EmailForm/use-schema.ts +++ b/src/route-widgets/root/EmailForm/use-schema.ts @@ -1,6 +1,6 @@ import * as yup from "yup" -import {ServerSettings} from "apis/get-server-settings" -import checkIsDomainDisposable from "apis/check-is-domain-disposable" +import {checkIsDomainDisposable} from "~/apis" +import {ServerSettings} from "~/types"; export interface Form { email: string diff --git a/src/route-widgets/root/PasswordForm.tsx b/src/route-widgets/root/PasswordForm.tsx index 7f85c3d..223afeb 100644 --- a/src/route-widgets/root/PasswordForm.tsx +++ b/src/route-widgets/root/PasswordForm.tsx @@ -5,10 +5,8 @@ import {Box, Grid, InputAdornment, Typography} from "@mui/material" import {MdCheckCircle, MdChevronRight, MdLock} from "react-icons/md" import {LoadingButton} from "@mui/lab" import {PasswordField} from "components" -import handleErrors from "utils/handle-errors" +import {encryptString, handleErrors} from "~/utils" import {generateKey} from "openpgp" -import {isDev} from "constants/values" -import encryptString from "utils/encrypt-string" export interface PasswordFormProps { email: string diff --git a/src/routes/Root.tsx b/src/routes/Root.tsx index 8471d79..84a1299 100644 --- a/src/routes/Root.tsx +++ b/src/routes/Root.tsx @@ -3,8 +3,13 @@ import SingleElementWrapper from "~/components/SingleElementWrapper"; import MultiStepForm from "~/components/MultiStepForm"; import EmailForm from "~/route-widgets/root/EmailForm"; import YouGotMail from "~/route-widgets/root/YouGotMail"; +import LoadingScreen from "~/LoadingScreen"; export default function RootRoute(): ReactElement { + return ( + + ) + return (