Hide client behind context.

Use idb for saving data.
Allow logins.
This commit is contained in:
Paul
2021-06-18 22:47:25 +01:00
parent 68a35751b3
commit ec97dbebd0
13 changed files with 474 additions and 187 deletions

View File

@@ -1,12 +1,15 @@
import { RevoltClient } from "../../../context/revoltjs/RevoltClient";
import { AppContext } from "../../../context/revoltjs/RevoltClient";
import { useContext } from "preact/hooks";
import { Form } from "./Form";
export function FormCreate() {
const { client } = useContext(AppContext);
return (
<Form
page="create"
callback={async data => {
await RevoltClient.register(process.env.API_SERVER as string, data);
await client.register(import.meta.env.VITE_API_URL, data);
}}
/>
);