Updated login page, added ProtectedRoute object for wrapping in layouts, added ProtectedRoute authorization verification to Admin route root
This commit is contained in:
parent
f055e77eea
commit
efa42a53b2
5 changed files with 65 additions and 17 deletions
25
components/ui/Form.tsx
Normal file
25
components/ui/Form.tsx
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import React from "react";
|
||||
|
||||
import RoundedContainer from "./RoundedContainer";
|
||||
|
||||
export default function Form({
|
||||
action,
|
||||
children,
|
||||
submitText,
|
||||
}: {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
action?: string | ((formData: FormData) => void | Promise<void>);
|
||||
children: React.ReactNode;
|
||||
submitText: string;
|
||||
}) {
|
||||
return (
|
||||
<div>
|
||||
<form action={action}>
|
||||
<RoundedContainer slim={false}>
|
||||
{children}
|
||||
<button type="submit">{submitText}</button>
|
||||
</RoundedContainer>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue