forked from will2hew/docmost
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* seo friendly urls * custom client serve-static module * database fixes * fix recent pages * other fixes
- Loading branch information
1 parent
eefe63d
commit 9c7c2f1
Showing
102 changed files
with
897 additions
and
512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
apps/client/src/components/layouts/dashboard/dashboard-layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
apps/client/src/components/layouts/settings/settings-layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
apps/client/src/features/auth/components/setup-workspace-form.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import * as React from "react"; | ||
import * as z from "zod"; | ||
|
||
import { useForm, zodResolver } from "@mantine/form"; | ||
import { | ||
Container, | ||
Title, | ||
TextInput, | ||
Button, | ||
PasswordInput, | ||
Box, | ||
} from "@mantine/core"; | ||
import { ISetupWorkspace } from "@/features/auth/types/auth.types"; | ||
import useAuth from "@/features/auth/hooks/use-auth"; | ||
import classes from "@/features/auth/components/auth.module.css"; | ||
|
||
const formSchema = z.object({ | ||
workspaceName: z.string().min(2).max(60), | ||
name: z.string().min(2).max(60), | ||
email: z | ||
.string() | ||
.min(1, { message: "email is required" }) | ||
.email({ message: "Invalid email address" }), | ||
password: z.string().min(8), | ||
}); | ||
|
||
export function SetupWorkspaceForm() { | ||
const { setupWorkspace, isLoading } = useAuth(); | ||
// useRedirectIfAuthenticated(); | ||
|
||
const form = useForm<ISetupWorkspace>({ | ||
validate: zodResolver(formSchema), | ||
initialValues: { | ||
workspaceName: "", | ||
name: "", | ||
email: "", | ||
password: "", | ||
}, | ||
}); | ||
|
||
async function onSubmit(data: ISetupWorkspace) { | ||
await setupWorkspace(data); | ||
} | ||
|
||
return ( | ||
<Container size={420} my={40} className={classes.container}> | ||
<Box p="xl" mt={200}> | ||
<Title order={2} ta="center" fw={500} mb="md"> | ||
Create workspace | ||
</Title> | ||
|
||
<form onSubmit={form.onSubmit(onSubmit)}> | ||
<TextInput | ||
id="workspaceName" | ||
type="text" | ||
label="Workspace Name" | ||
placeholder="e.g ACME Inc" | ||
variant="filled" | ||
mt="md" | ||
{...form.getInputProps("workspaceName")} | ||
/> | ||
|
||
<TextInput | ||
id="name" | ||
type="text" | ||
label="Your Name" | ||
placeholder="enter your full name" | ||
variant="filled" | ||
mt="md" | ||
{...form.getInputProps("name")} | ||
/> | ||
|
||
<TextInput | ||
id="email" | ||
type="email" | ||
label="Your Email" | ||
placeholder="[email protected]" | ||
variant="filled" | ||
mt="md" | ||
{...form.getInputProps("email")} | ||
/> | ||
|
||
<PasswordInput | ||
label="Password" | ||
placeholder="Enter a strong password" | ||
variant="filled" | ||
mt="md" | ||
{...form.getInputProps("password")} | ||
/> | ||
<Button type="submit" fullWidth mt="xl" loading={isLoading}> | ||
Setup workspace | ||
</Button> | ||
</form> | ||
</Box> | ||
</Container> | ||
); | ||
} |
Oops, something went wrong.