mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-19 07:55:25 +02:00
current stand
This commit is contained in:
parent
38a6ded8ae
commit
69dadf1122
@ -17,8 +17,46 @@
|
|||||||
"ecmaVersion": 13,
|
"ecmaVersion": 13,
|
||||||
"sourceType": "module"
|
"sourceType": "module"
|
||||||
},
|
},
|
||||||
"plugins": ["react", "@typescript-eslint"],
|
"plugins": ["ordered-imports", "react", "@typescript-eslint"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"react/react-in-jsx-scope": "off"
|
"react/react-in-jsx-scope": "off",
|
||||||
|
"ordered-imports/ordered-imports": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"symbols-first": true,
|
||||||
|
"declaration-ordering": ["type", {
|
||||||
|
"ordering": ["namespace", "destructured", "default", "side-effect"],
|
||||||
|
"secondaryOrdering": ["name", "lowercase-last"]
|
||||||
|
}],
|
||||||
|
"specifier-ordering": "lowercase-last",
|
||||||
|
"group-ordering": [
|
||||||
|
{
|
||||||
|
"name": "third-party named",
|
||||||
|
"match": "^@",
|
||||||
|
"order": 20
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "project",
|
||||||
|
"match": "^\\~",
|
||||||
|
"order": 30
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "parent directories",
|
||||||
|
"match": "^\\.\\.",
|
||||||
|
"order": 40
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "current directory",
|
||||||
|
"match": "^\\.",
|
||||||
|
"order": 50
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "third-party",
|
||||||
|
"match": ".*",
|
||||||
|
"order": 10
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@emotion/react": "^11.10.4",
|
||||||
|
"@emotion/styled": "^11.10.4",
|
||||||
"@mui/lab": "^5.0.0-alpha.103",
|
"@mui/lab": "^5.0.0-alpha.103",
|
||||||
"@mui/material": "^5.10.9",
|
"@mui/material": "^5.10.9",
|
||||||
"@tanstack/react-query": "^4.12.0",
|
"@tanstack/react-query": "^4.12.0",
|
||||||
@ -39,6 +41,7 @@
|
|||||||
"eslint": "8.22.0",
|
"eslint": "8.22.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-compat": "^4.0.2",
|
"eslint-plugin-compat": "^4.0.2",
|
||||||
|
"eslint-plugin-ordered-imports": "^0.6.0",
|
||||||
"eslint-plugin-react": "^7.31.10",
|
"eslint-plugin-react": "^7.31.10",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"typescript": "^4.6.4",
|
"typescript": "^4.6.4",
|
||||||
|
16
src/App.tsx
16
src/App.tsx
@ -1,16 +1,17 @@
|
|||||||
import {createBrowserRouter, RouterProvider} from "react-router-dom";
|
import {RouterProvider, createBrowserRouter} from "react-router-dom"
|
||||||
import RootRoute from "~/routes/Root";
|
import React, {ReactElement} from "react"
|
||||||
import React, {ReactElement} from "react";
|
|
||||||
import {QueryClientProvider} from "@tanstack/react-query";
|
import {QueryClientProvider} from "@tanstack/react-query"
|
||||||
import {queryClient} from "~/constants/react-query";
|
|
||||||
|
import {queryClient} from "~/constants/react-query"
|
||||||
|
import RootRoute from "~/routes/Root"
|
||||||
|
|
||||||
const router = createBrowserRouter([
|
const router = createBrowserRouter([
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
element: <RootRoute />,
|
element: <RootRoute />,
|
||||||
},
|
},
|
||||||
]);
|
])
|
||||||
|
|
||||||
|
|
||||||
export default function App(): ReactElement {
|
export default function App(): ReactElement {
|
||||||
return (
|
return (
|
||||||
@ -21,4 +22,3 @@ export default function App(): ReactElement {
|
|||||||
</React.StrictMode>
|
</React.StrictMode>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
import {Typography} from "@mui/material";
|
import React, {ReactElement} from "react"
|
||||||
import {ReactElement} from "react";
|
|
||||||
import {SingleElementWrapper} from "~/components";
|
import {Typography} from "@mui/material"
|
||||||
|
|
||||||
|
import {SingleElementWrapper} from "~/components"
|
||||||
|
|
||||||
export default function LoadingScreen(): ReactElement {
|
export default function LoadingScreen(): ReactElement {
|
||||||
return (
|
return (
|
||||||
<SingleElementWrapper>
|
<SingleElementWrapper>
|
||||||
<Typography variant="h1" component="h1">Loading...</Typography>
|
<Typography variant="caption" component="p">
|
||||||
|
Loading...
|
||||||
|
</Typography>
|
||||||
</SingleElementWrapper>
|
</SingleElementWrapper>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
import {ServerSettings} from "~/types";
|
|
||||||
|
import {ServerSettings} from "~/types"
|
||||||
|
|
||||||
export default async function getServerSettings(): Promise<ServerSettings> {
|
export default async function getServerSettings(): Promise<ServerSettings> {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import {AuthenticationDetails} from "~/types"
|
|
||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
|
|
||||||
|
import {AuthenticationDetails} from "~/types"
|
||||||
|
|
||||||
export interface ValidateTokenData {
|
export interface ValidateTokenData {
|
||||||
email: string
|
email: string
|
||||||
token: string
|
token: string
|
||||||
|
@ -1,5 +1,13 @@
|
|||||||
import React, {forwardRef, ReactElement, useEffect, useRef, useState} from "react"
|
import React, {
|
||||||
|
ReactElement,
|
||||||
|
forwardRef,
|
||||||
|
useEffect,
|
||||||
|
useRef,
|
||||||
|
useState,
|
||||||
|
} from "react"
|
||||||
|
|
||||||
import {Paper} from "@mui/material"
|
import {Paper} from "@mui/material"
|
||||||
|
|
||||||
import {whenElementHasBounds} from "~/utils"
|
import {whenElementHasBounds} from "~/utils"
|
||||||
|
|
||||||
export interface MultiStepFormProps {
|
export interface MultiStepFormProps {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import {Box, Container} from "@mui/material"
|
|
||||||
import React, {ReactElement} from "react"
|
import React, {ReactElement} from "react"
|
||||||
|
|
||||||
|
import {Box, Container} from "@mui/material"
|
||||||
|
|
||||||
export interface MultiStepFormElementProps {
|
export interface MultiStepFormElementProps {
|
||||||
children: ReactElement
|
children: ReactElement
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import {ReactElement} from "react"
|
|
||||||
import UAParser from "ua-parser-js"
|
|
||||||
import {Button} from "@mui/material"
|
|
||||||
import {APP_LINK_MAP} from "~/utils"
|
|
||||||
import {IoMdMailOpen} from "react-icons/io"
|
import {IoMdMailOpen} from "react-icons/io"
|
||||||
|
import React, {ReactElement} from "react"
|
||||||
|
import UAParser from "ua-parser-js"
|
||||||
|
|
||||||
|
import {Button} from "@mui/material"
|
||||||
|
|
||||||
|
import {APP_LINK_MAP} from "~/utils"
|
||||||
|
|
||||||
export interface OpenMailButtonProps {
|
export interface OpenMailButtonProps {
|
||||||
domain: string
|
domain: string
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
|
import {MdVisibility, MdVisibilityOff} from "react-icons/md"
|
||||||
|
import React, {ReactElement, useState} from "react"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
IconButton,
|
IconButton,
|
||||||
InputAdornment,
|
InputAdornment,
|
||||||
TextField,
|
TextField,
|
||||||
TextFieldProps,
|
TextFieldProps,
|
||||||
} from "@mui/material"
|
} from "@mui/material"
|
||||||
import {ReactElement, useState} from "react"
|
|
||||||
import {MdVisibility, MdVisibilityOff} from "react-icons/md"
|
|
||||||
|
|
||||||
export interface PasswordFieldProps extends Omit<TextFieldProps, "type"> {}
|
export interface PasswordFieldProps extends Omit<TextFieldProps, "type"> {}
|
||||||
|
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
import {MdChevronRight} from "react-icons/md"
|
||||||
|
import {TiCancel} from "react-icons/ti"
|
||||||
|
import React, {ReactElement, useEffect, useState} from "react"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Alert,
|
Alert,
|
||||||
Button,
|
Button,
|
||||||
@ -6,11 +10,8 @@ import {
|
|||||||
Typography,
|
Typography,
|
||||||
TypographyProps,
|
TypographyProps,
|
||||||
} from "@mui/material"
|
} from "@mui/material"
|
||||||
import {ReactElement, useEffect, useState} from "react"
|
|
||||||
import {LoadingButton} from "@mui/lab"
|
import {LoadingButton} from "@mui/lab"
|
||||||
import {MdChevronRight} from "react-icons/md"
|
|
||||||
import {OverrideProps} from "@mui/types"
|
import {OverrideProps} from "@mui/types"
|
||||||
import {TiCancel} from "react-icons/ti"
|
|
||||||
|
|
||||||
export interface SimpleFormProps {
|
export interface SimpleFormProps {
|
||||||
title: string
|
title: string
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import {ReactElement} from "react"
|
import React, {ReactElement} from "react"
|
||||||
|
|
||||||
import {Box} from "@mui/material"
|
import {Box} from "@mui/material"
|
||||||
|
|
||||||
export interface SingleElementWrapperProps {
|
export interface SingleElementWrapperProps {
|
||||||
|
1
src/constants/development.ts
Normal file
1
src/constants/development.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export const isDev = true
|
@ -1 +1,3 @@
|
|||||||
|
import {QueryClient} from "@tanstack/react-query"
|
||||||
|
|
||||||
export const queryClient = new QueryClient()
|
export const queryClient = new QueryClient()
|
||||||
|
19
src/main.tsx
19
src/main.tsx
@ -1,17 +1,8 @@
|
|||||||
import React from "react";
|
import React from "react"
|
||||||
import ReactDOM from "react-dom/client";
|
import ReactDOM from "react-dom/client"
|
||||||
import {createBrowserRouter, RouterProvider,} from "react-router-dom";
|
|
||||||
import RootRoute from "~/routes/Root";
|
|
||||||
|
|
||||||
const router = createBrowserRouter([
|
import App from "~/App"
|
||||||
{
|
|
||||||
path: "/",
|
|
||||||
element: <RootRoute />,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById("root") as HTMLDivElement).render(
|
ReactDOM.createRoot(document.getElementById("root") as HTMLDivElement).render(
|
||||||
<React.StrictMode>
|
<App />,
|
||||||
<RouterProvider router={router} />
|
)
|
||||||
</React.StrictMode>
|
|
||||||
);
|
|
||||||
|
@ -1,7 +1,23 @@
|
|||||||
import {ReactElement, useCallback, useEffect, useRef, useState} from "react"
|
|
||||||
import {Alert, Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Grid,} from "@mui/material"
|
|
||||||
import {MdCheck} from "react-icons/md"
|
import {MdCheck} from "react-icons/md"
|
||||||
import {useSessionStorage} from "react-use"
|
import {useSessionStorage} from "react-use"
|
||||||
|
import React, {
|
||||||
|
ReactElement,
|
||||||
|
useCallback,
|
||||||
|
useEffect,
|
||||||
|
useRef,
|
||||||
|
useState,
|
||||||
|
} from "react"
|
||||||
|
|
||||||
|
import {
|
||||||
|
Alert,
|
||||||
|
Button,
|
||||||
|
Dialog,
|
||||||
|
DialogActions,
|
||||||
|
DialogContent,
|
||||||
|
DialogContentText,
|
||||||
|
DialogTitle,
|
||||||
|
Grid,
|
||||||
|
} from "@mui/material"
|
||||||
|
|
||||||
export interface DetectEmailAutofillServiceProps {
|
export interface DetectEmailAutofillServiceProps {
|
||||||
domains: string[]
|
domains: string[]
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
import {ReactElement} from "react"
|
|
||||||
import {useFormik} from "formik"
|
import {useFormik} from "formik"
|
||||||
import useSchema, {Form} from "./use-schema"
|
|
||||||
import {signup} from "~/apis"
|
|
||||||
import {MdEmail} from "react-icons/md"
|
import {MdEmail} from "react-icons/md"
|
||||||
|
import React, {ReactElement} from "react"
|
||||||
|
|
||||||
import {InputAdornment, TextField} from "@mui/material"
|
import {InputAdornment, TextField} from "@mui/material"
|
||||||
import DetectEmailAutofillService from "./DetectEmailAutofillService"
|
|
||||||
import {handleErrors} from "~/utils"
|
|
||||||
import {MultiStepFormElement, SimpleForm} from "~/components"
|
import {MultiStepFormElement, SimpleForm} from "~/components"
|
||||||
import {ServerSettings} from "~/types";
|
import {ServerSettings} from "~/types"
|
||||||
|
import {signup} from "~/apis"
|
||||||
|
import {handleErrors} from "~/utils"
|
||||||
|
|
||||||
|
import DetectEmailAutofillService from "./DetectEmailAutofillService"
|
||||||
|
import useSchema, {Form} from "./use-schema"
|
||||||
|
|
||||||
interface EmailFormProps {
|
interface EmailFormProps {
|
||||||
serverSettings: ServerSettings
|
serverSettings: ServerSettings
|
1
src/route-widgets/root/EmailForm/index.ts
Normal file
1
src/route-widgets/root/EmailForm/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {default as EmailForm} from "./EmailForm"
|
@ -1,6 +1,7 @@
|
|||||||
import * as yup from "yup"
|
import * as yup from "yup"
|
||||||
|
|
||||||
import {checkIsDomainDisposable} from "~/apis"
|
import {checkIsDomainDisposable} from "~/apis"
|
||||||
import {ServerSettings} from "~/types";
|
import {ServerSettings} from "~/types"
|
||||||
|
|
||||||
export interface Form {
|
export interface Form {
|
||||||
email: string
|
email: string
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import {ReactElement} from "react"
|
|
||||||
import {Box, Button, Grid, Typography} from "@mui/material"
|
|
||||||
import {FaLongArrowAltRight} from "react-icons/fa"
|
import {FaLongArrowAltRight} from "react-icons/fa"
|
||||||
import {TiCancel} from "react-icons/ti"
|
import {TiCancel} from "react-icons/ti"
|
||||||
|
import React, {ReactElement} from "react"
|
||||||
|
|
||||||
|
import {Box, Button, Grid, Typography} from "@mui/material"
|
||||||
|
|
||||||
export interface GenerateEmailReportsFormProps {
|
export interface GenerateEmailReportsFormProps {
|
||||||
onYes: () => void
|
onYes: () => void
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
import {ReactElement, useMemo} from "react"
|
|
||||||
import * as yup from "yup"
|
import * as yup from "yup"
|
||||||
import {useFormik} from "formik"
|
import {useFormik} from "formik"
|
||||||
import {Box, Grid, InputAdornment, Typography} from "@mui/material"
|
|
||||||
import {MdCheckCircle, MdChevronRight, MdLock} from "react-icons/md"
|
import {MdCheckCircle, MdChevronRight, MdLock} from "react-icons/md"
|
||||||
import {LoadingButton} from "@mui/lab"
|
|
||||||
import {PasswordField} from "components"
|
|
||||||
import {encryptString, handleErrors} from "~/utils"
|
|
||||||
import {generateKey} from "openpgp"
|
import {generateKey} from "openpgp"
|
||||||
|
import React, {ReactElement, useMemo} from "react"
|
||||||
|
|
||||||
|
import {LoadingButton} from "@mui/lab"
|
||||||
|
import {Box, Grid, InputAdornment, Typography} from "@mui/material"
|
||||||
|
|
||||||
|
import {PasswordField} from "~/components"
|
||||||
|
import {encryptString, handleErrors} from "~/utils"
|
||||||
|
import {isDev} from "~/constants/development"
|
||||||
|
|
||||||
export interface PasswordFormProps {
|
export interface PasswordFormProps {
|
||||||
email: string
|
email: string
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import {ReactElement} from "react"
|
import React, {ReactElement} from "react"
|
||||||
|
|
||||||
import {Grid, Typography} from "@mui/material"
|
import {Grid, Typography} from "@mui/material"
|
||||||
|
|
||||||
import {MultiStepFormElement, OpenMailButton} from "~/components"
|
import {MultiStepFormElement, OpenMailButton} from "~/components"
|
||||||
|
|
||||||
export interface YouGotMailProps {
|
export interface YouGotMailProps {
|
||||||
|
@ -1,29 +1,24 @@
|
|||||||
import {ReactElement} from "react";
|
import React, {ReactElement} from "react"
|
||||||
import SingleElementWrapper from "~/components/SingleElementWrapper";
|
|
||||||
import MultiStepForm from "~/components/MultiStepForm";
|
import {MultiStepForm, SingleElementWrapper} from "~/components"
|
||||||
import EmailForm from "~/route-widgets/root/EmailForm";
|
import EmailForm from "~/route-widgets/root/EmailForm/EmailForm"
|
||||||
import YouGotMail from "~/route-widgets/root/YouGotMail";
|
import LoadingScreen from "~/LoadingScreen"
|
||||||
import LoadingScreen from "~/LoadingScreen";
|
import YouGotMail from "~/route-widgets/root/YouGotMail"
|
||||||
|
|
||||||
export default function RootRoute(): ReactElement {
|
export default function RootRoute(): ReactElement {
|
||||||
return (
|
return <LoadingScreen />
|
||||||
<LoadingScreen />
|
|
||||||
)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SingleElementWrapper>
|
<SingleElementWrapper>
|
||||||
<MultiStepForm
|
<MultiStepForm
|
||||||
steps={[
|
steps={[
|
||||||
() => (
|
() => (
|
||||||
<EmailForm
|
<EmailForm serverSettings={{}} onSignUp={() => null} />
|
||||||
serverSettings={{}}
|
|
||||||
onSignUp={() => null}
|
|
||||||
/>
|
|
||||||
),
|
),
|
||||||
() => <YouGotMail domain={""} />,
|
() => <YouGotMail domain={""} />,
|
||||||
]}
|
]}
|
||||||
index={0}
|
index={0}
|
||||||
/>
|
/>
|
||||||
</SingleElementWrapper>
|
</SingleElementWrapper>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { defineConfig } from 'vite'
|
import * as path from "path"
|
||||||
import react from '@vitejs/plugin-react'
|
import {defineConfig} from "vite"
|
||||||
import * as path from "path";
|
|
||||||
|
import react from "@vitejs/plugin-react"
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
@ -8,6 +9,6 @@ export default defineConfig({
|
|||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"~": path.resolve(__dirname, "src"),
|
"~": path.resolve(__dirname, "src"),
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user