import type { ReactView } from "@ethicdevs/react-monolith";
import React from "react";
import type { CommonProps } from "../../types";
import { Button, Layout, PageWrapper } from "../../components";
export interface RegisterViewProps extends CommonProps {
initialValues?: {
username?: string;
password?: string;
};
}
const RegisterView: ReactView<RegisterViewProps> = ({
commonProps,
initialValues = undefined,
}) => {
return (
<Layout {...commonProps} showSideMenu={false}>
<PageWrapper>
<form action={`/auth/register`} method={"POST"}>
<div>
<label htmlFor={"username"}>Username:</label>
<input
type={"text"}
name={"username"}
placeholder={"Choose a username (i.e. john.doe)..."}
defaultValue={initialValues?.username}
/>
</div>
<div>
<label htmlFor={"username"}>Password:</label>
<input
type={"password"}
name={"password"}
placeholder={"Choose a great password..."}
defaultValue={initialValues?.password}
/>
</div>
<Button type={"submit"}>Create my Account</Button>
</form>
</PageWrapper>
</Layout>
);
};
RegisterView.displayName = "RegisterView";
export default RegisterView;