-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from SwiichyCode/projects
Projects
- Loading branch information
Showing
80 changed files
with
1,827 additions
and
89 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"use client"; | ||
|
||
export default function ProjectError() { | ||
return <div>Error occured</div>; | ||
} |
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,9 @@ | ||
import type { PropsWithChildren } from "react"; | ||
|
||
export default function ProjectLayout({ children }: PropsWithChildren) { | ||
return ( | ||
<div className="h-[calc(100vh-73px)] max-w-full bg-[#0D1117] p-6"> | ||
{children} | ||
</div> | ||
); | ||
} |
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,39 @@ | ||
import { useFetchProjectPage } from "@/modules/projects/hooks/use-fetch-project-page"; | ||
import { Column } from "@/modules/projects/components/Column/_index"; | ||
import { ProjectProvider } from "@/modules/projects/context/projectContext"; | ||
import { ColumnProvider } from "@/modules/projects/context/columnContext"; | ||
import { ColumnsLayout } from "@/modules/projects/components/Column/_layout"; | ||
import { DeleteColumnDialog } from "@/modules/projects/components/DeleteColumnDialog"; | ||
|
||
import { | ||
useQueryParserProjectPage, | ||
type SearchParamsType, | ||
} from "@/modules/projects/hooks/use-query-parser-project-page"; | ||
|
||
type PageProps = { | ||
params: { | ||
id: string; | ||
}; | ||
} & SearchParamsType; | ||
|
||
export default async function ProjectPage({ params, searchParams }: PageProps) { | ||
const { project } = await useFetchProjectPage({ projectId: params.id }); | ||
const { projectId, columnId } = useQueryParserProjectPage({ searchParams }); | ||
|
||
if (!project) return null; | ||
|
||
return ( | ||
<ProjectProvider project={project}> | ||
<ColumnsLayout> | ||
{project?.columns.map((column) => ( | ||
<ColumnProvider key={column.id} column={column}> | ||
<Column key={column.id} /> | ||
</ColumnProvider> | ||
))} | ||
</ColumnsLayout> | ||
|
||
{/* All dialog action */} | ||
<DeleteColumnDialog projectId={projectId} columnId={columnId} /> | ||
</ProjectProvider> | ||
); | ||
} |
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,5 @@ | ||
"use client"; | ||
|
||
export default function ProjectsError() { | ||
return <div>Error occured</div>; | ||
} |
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,5 @@ | ||
import type { PropsWithChildren } from "react"; | ||
|
||
export default function ProjectsLayout({ children }: PropsWithChildren) { | ||
return <div>{children}</div>; | ||
} |
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,29 @@ | ||
import { useFetchProjectsPage } from "@/modules/projects/hooks/use-fetch-projects-page"; | ||
import { PresentationalCard } from "@/modules/projects/components/PresentationalCard"; | ||
import { ProjectsTable } from "@/modules/projects/components/_tables/projects-table"; | ||
import { AddProjectForm } from "@/modules/projects/components/_forms/add-project-form"; | ||
import { ProjectsNavigation } from "@/modules/projects/components/ProjectsNavigation"; | ||
|
||
export default async function ProjectsPage({ | ||
searchParams, | ||
}: { | ||
searchParams: Record<string, string | string[] | undefined>; | ||
}) { | ||
const { query } = searchParams; | ||
|
||
const { projects } = await useFetchProjectsPage(); | ||
|
||
return ( | ||
<div className="m-auto max-w-3xl space-y-8 p-14"> | ||
<PresentationalCard /> | ||
<AddProjectForm /> | ||
|
||
{projects && ( | ||
<div className="flex flex-col gap-6"> | ||
<ProjectsNavigation /> | ||
<ProjectsTable projects={projects} /> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} |
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
Oops, something went wrong.