-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
129c195
commit 9b001c4
Showing
12 changed files
with
1,510 additions
and
114 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,6 @@ yarn-error.log* | |
|
||
# vscode | ||
.vscode | ||
|
||
#Jetbrians | ||
.idea |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,43 @@ | ||
export default function Page() { | ||
return <span>howdy</span>; | ||
import AccountSettings from "@/components/settings/AccountSettings"; | ||
import { users } from "db/schema"; | ||
import { eq } from "db/drizzle"; | ||
import { auth } from "@clerk/nextjs"; | ||
import { db } from "db"; | ||
import { redirect } from "next/navigation"; | ||
import ProfileSettings from "@/components/settings/ProfileSettings"; | ||
import RegistrationSettings from "@/components/settings/RegistrationSettings"; | ||
|
||
export default async function Page() { | ||
const { userId } = auth(); | ||
if (!userId) return redirect("/sign-in"); | ||
const user = await db.query.users.findFirst({ | ||
with: { | ||
registrationData: true, | ||
profileData: true, | ||
}, | ||
where: eq(users.clerkID, userId!), | ||
}); | ||
if (!user) return redirect("/sign-in"); | ||
|
||
function Header({ tag }: { tag: string }) { | ||
return ( | ||
<h1 | ||
id={tag.toLowerCase()} | ||
className="mt-10 pb-5 text-4xl font-bold" | ||
> | ||
{tag} | ||
</h1> | ||
); | ||
} | ||
|
||
return ( | ||
<div> | ||
<Header tag="Account" /> | ||
<AccountSettings user={user} /> | ||
<Header tag="Profile" /> | ||
<ProfileSettings profile={user.profileData} /> | ||
<Header tag={"Registration"} /> | ||
<RegistrationSettings /> | ||
</div> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
17 changes: 10 additions & 7 deletions
17
apps/web/src/app/settings/account/page.tsx → ...eb/src/app/settings/registration/page.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 |
---|---|---|
@@ -1,18 +1,21 @@ | ||
import AccountSettings from "@/components/settings/AccountSettings"; | ||
import { users } from "db/schema"; | ||
import { eq } from "db/drizzle"; | ||
import RegisterFormSettings from "@/components/settings/RegistrationForm/RegisterFormSettings"; | ||
import { auth } from "@clerk/nextjs"; | ||
import { db } from "db"; | ||
import { eq } from "db/drizzle"; | ||
import { users } from "db/schema"; | ||
import { redirect } from "next/navigation"; | ||
|
||
export default async function Page() { | ||
const { userId } = auth(); | ||
if (!userId) return redirect("/sign-in"); | ||
const user = await db.query.users.findFirst({ | ||
with: { registrationData: true }, | ||
with: { | ||
registrationData: true, | ||
profileData: true, | ||
}, | ||
where: eq(users.clerkID, userId!), | ||
}); | ||
if (!user) return redirect("/sign-in"); | ||
return <AccountSettings user={user} />; | ||
} | ||
|
||
export const runtime = "edge"; | ||
return <RegisterFormSettings data={user.registrationData} />; | ||
} |
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
Oops, something went wrong.