Skip to content

Commit 9253138

Browse files
feat: refactor project structure and components, migrate to new directory organization, and update authentication flow
Co-authored-by: Drobinson1999 <Drobinson1999@users.noreply.github.com>
1 parent 327f564 commit 9253138

10 files changed

Lines changed: 20 additions & 18 deletions

File tree

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ export default function ProjectHeader({
99
projectTitle: string;
1010
}) {
1111
const { colorMode } = useColorMode();
12+
1213
return (
13-
<Container h={"10vh"}>
14+
<Container h={"10vh"} position={"fixed"}>
1415
<HStack alignItems={"center"} justifyContent={"space-between"} h={"100%"}>
1516
<Heading size={"5xl"}>{projectTitle}</Heading>
1617
<ColorModeButton
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
"use client";
12

23
import { auth } from "@/app/auth";
3-
import ProjectHeader from "@/app/components/Header";
4-
import SignInButton from "@/app/components/SignInButton";
5-
import SignOutButton from "@/app/components/SignOutButton";
4+
import ProjectHeader from "@/app/(Components)/Header";
5+
import SignInButton from "@/app/(Components)/SignInButton";
6+
import SignOutButton from "@/app/(Components)/SignOutButton";
67
import {
78
Container,
89
Card,
@@ -16,7 +17,7 @@ import {
1617
Text,
1718
} from "@chakra-ui/react";
1819
import { LuX, LuCheck } from "react-icons/lu";
19-
import ApproveFetch from "@/app/components/ApproveFetch";
20+
import ApproveFetch from "@/app/(Components)/ApproveFetch";
2021

2122
export default async function Home() {
2223
const session = await auth();
@@ -27,16 +28,16 @@ export default async function Home() {
2728
const items = [
2829
{
2930
label: "Hireable",
30-
value: session.user?.hireable
31+
value: session?.user?.hireable
3132
? "Available for hire"
3233
: "Not available for hire",
3334
},
34-
{ label: "Location", value: session.user?.location },
35+
{ label: "Location", value: session?.user?.location },
3536
{ label: "Total Repos", value: total_repos.toString() },
3637
{ label: "Phone", value: "1234567890" },
3738
{ label: "Address", value: "1234 Main St, Anytown, USA" },
3839
];
39-
40+
4041
return (
4142
<Stack>
4243
<ProjectHeader projectTitle="OpenSignal" />
@@ -85,7 +86,7 @@ export default async function Home() {
8586
<LuX />
8687
Decline
8788
</Button>
88-
<ApproveFetch/>
89+
<ApproveFetch />
8990
</Card.Footer>
9091
</Card.Root>
9192

app/(dashboard)/settings/page.tsx renamed to app/(User Dashboard)/profile/settings/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { auth } from "@/app/auth";
2-
import ProjectFooter from "@/app/components/Footer";
3-
import ProjectHeader from "@/app/components/Header";
4-
import SignInButton from "@/app/components/SignInButton";
5-
import SignOutButton from "@/app/components/SignOutButton";
2+
import ProjectFooter from "@/app/(Components)/Footer";
3+
import ProjectHeader from "@/app/(Components)/Header";
4+
import SignInButton from "@/app/(Components)/SignInButton";
5+
import SignOutButton from "@/app/(Components)/SignOutButton";
66
import { Container, Card, AbsoluteCenter, Avatar } from "@chakra-ui/react";
77

88
export default async function Home() {

app/lib/actions/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { signIn, signOut } from "next-auth/react";
22

33
export const loginWithGitHub = async () => {
44
try {
5-
await signIn("github", { callbackUrl: "/home" });
5+
await signIn("github", { callbackUrl: "/dashboard" });
66
} catch (error) {
77
console.error("Error during GitHub sign-in:", error);
88
}

app/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"use server";
22

3-
import ProjectHeader from "./components/Header";
4-
import ProjectFooter from "./components/Footer";
3+
import ProjectHeader from "./(Components)/Header";
4+
import ProjectFooter from "./(Components)/Footer";
55
import { Card, AbsoluteCenter, Container, Avatar } from "@chakra-ui/react";
66
import { auth } from "./auth";
7-
import SignInButton from "./components/SignInButton";
8-
import SignOutButton from "./components/SignOutButton";
7+
import SignInButton from "./(Components)/SignInButton";
8+
import SignOutButton from "./(Components)/SignOutButton";
99

1010
export default async function Home() {
1111
const session = await auth();

0 commit comments

Comments
 (0)