-
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.
Satisfies User Settings w/ New Schema (#112)
- Loading branch information
1 parent
11c5602
commit 19d324c
Showing
18 changed files
with
1,731 additions
and
144 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 was deleted.
Oops, something went wrong.
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,32 @@ | ||
export default function Page() { | ||
return <span>howdy</span>; | ||
import AccountSettings from "@/components/settings/AccountSettings"; | ||
import { auth } from "@clerk/nextjs"; | ||
import { redirect } from "next/navigation"; | ||
import ProfileSettings from "@/components/settings/ProfileSettings"; | ||
import RegistrationSettings from "@/components/settings/RegistrationSettings"; | ||
import { getUser } from "db/functions"; | ||
|
||
export default async function Page() { | ||
const { userId } = auth(); | ||
if (!userId) return redirect("/sign-in"); | ||
const user = await getUser(userId); | ||
if (!user) return redirect("/sign-in"); | ||
|
||
return ( | ||
<main> | ||
<Header tag="Account" /> | ||
<AccountSettings user={user} /> | ||
<Header tag="Profile" /> | ||
<ProfileSettings profile={user} /> | ||
<Header tag={"Registration"} /> | ||
<RegistrationSettings /> | ||
</main> | ||
); | ||
} | ||
|
||
function Header({ tag }: { tag: string }) { | ||
return ( | ||
<h1 id={tag.toLowerCase()} className="mt-10 pb-5 text-4xl font-bold"> | ||
{tag} | ||
</h1> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
import { auth } from "@clerk/nextjs"; | ||
import { redirect } from "next/navigation"; | ||
import RegistrationFormSettings from "@/components/settings/RegistrationForm/RegisterFormSettings"; | ||
import { getHackerData, getUser } from "db/functions"; | ||
|
||
export default async function Page() { | ||
const { userId } = auth(); | ||
if (!userId) return redirect("/sign-in"); | ||
const user = await getUser(userId); | ||
if (!user) return redirect("/sign-in"); | ||
const hackerData = await getHackerData(userId); | ||
if (!hackerData) return redirect("/sign-in"); | ||
|
||
return <RegistrationFormSettings user={user} data={hackerData} />; | ||
} |
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.