-
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 #128 from UoaWDCC/108_projects-page
108 Projects Page
- Loading branch information
Showing
13 changed files
with
181 additions
and
123 deletions.
There are no files selected for viewing
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,18 @@ | ||
import Project from "@/components/projects/Project"; | ||
import { projectSchema } from "@/schemas/collection/Project"; | ||
import fetchStrapi from "@/util/strapi"; | ||
import { notFound } from "next/navigation"; | ||
import { z } from "zod"; | ||
|
||
export default async function CurrentProjectPage() { | ||
const firstDay = new Date(new Date().getFullYear(), 0, 1); | ||
const lastDay = new Date(new Date().getFullYear(), 11, 31); | ||
|
||
const projects = await fetchStrapi("project-pages", z.array(projectSchema), { | ||
"filters[Date][$gte]": firstDay.toISOString().split("T")[0], | ||
"[$lte]": lastDay.toISOString().split("T")[0], | ||
}); | ||
|
||
if (projects.length === 0) notFound(); | ||
return <Project type={"current"} projects={projects} />; | ||
} |
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,16 @@ | ||
import Project from "@/components/projects/Project"; | ||
import { projectSchema } from "@/schemas/collection/Project"; | ||
import fetchStrapi from "@/util/strapi"; | ||
import { notFound } from "next/navigation"; | ||
import { z } from "zod"; | ||
|
||
export default async function CurrentProjectPage() { | ||
const firstDay = new Date(new Date().getFullYear(), 0, 1); | ||
|
||
const projects = await fetchStrapi("project-pages", z.array(projectSchema), { | ||
"filters[Date][$lt]": firstDay.toISOString().split("T")[0], | ||
}); | ||
|
||
if (projects.length === 0) notFound(); | ||
return <Project type={"old"} projects={projects} />; | ||
} |
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,20 +1,16 @@ | ||
import DateBlob from "@/components/projects/DateBlob"; | ||
import Timeline from "@/components/projects/Timeline"; | ||
import { ProjectType } from "@/schemas/collection/Project"; | ||
|
||
|
||
const timelineElements = [ | ||
{ date: new Date("2023-12-25") }, | ||
{ date: new Date("2023-10-27") }, | ||
{ date: new Date("2023-11-30") }, | ||
{ date: new Date("2023-11-30") }, | ||
{ date: new Date("2023-11-30") }, | ||
{ date: new Date("2023-11-30") }, | ||
{ date: new Date("2023-11-30") }, | ||
const timelineElements: ProjectType[] = [ | ||
// { Date: new Date("2023-12-25") }, | ||
// { Date: new Date("2023-10-27") }, | ||
// { Date: new Date("2023-11-30") }, | ||
// { Date: new Date("2023-11-30") }, | ||
// { Date: new Date("2023-11-30") }, | ||
// { Date: new Date("2023-11-30") }, | ||
// { Date: new Date("2023-11-30") }, | ||
]; | ||
|
||
export default async function TestPage() { | ||
|
||
return ( | ||
<Timeline timelineElements={timelineElements} /> | ||
); | ||
return <Timeline timelineElements={timelineElements} />; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { ProjectType } from "@/schemas/collection/Project"; | ||
import BGBlob from "../svg/BGBlob"; | ||
import Timeline from "./Timeline"; | ||
|
||
export default function Project({ | ||
type, | ||
projects, | ||
}: { | ||
type: "current" | "old"; | ||
projects: ProjectType[]; | ||
}) { | ||
return ( | ||
<div className="h-full w-full"> | ||
<div className="absolute -z-10 top-[60%] w-1/6 -left-44"> | ||
<BGBlob /> | ||
</div> | ||
<div className="mt-header"> | ||
<div className="flex flex-col items-center justify-center text-center w-full"> | ||
{type == "current" ? ( | ||
<p className="text-6xl font-bold leading-[0.95]">ACTIVE PROJECTS</p> | ||
) : ( | ||
<p className="text-6xl font-bold leading-[0.95]">PAST PROJECTS</p> | ||
)} | ||
<div className="max-w-4xl"> | ||
<p className="text-base p-10 text-wrap"> | ||
A group of young people eager to enact growing change in the | ||
Devonport Takapuna comunity following in youth voices and youth | ||
leadership. | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
<div> | ||
<Timeline timelineElements={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
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,34 @@ | ||
export default function BGBlob() { | ||
return ( | ||
// <div className="absolute top-3/4 -left-28 -z-10 w-80"> | ||
<svg | ||
width="691" | ||
height="685" | ||
viewBox="0 0 691 685" | ||
fill="none" | ||
preserveAspectRatio="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
className="relative w-full h-full left-0 bottom-60" | ||
> | ||
<path | ||
fill-rule="evenodd" | ||
clip-rule="evenodd" | ||
d="M688.69 422.741C700.91 520.057 630.121 614.768 548.543 662.581C474.726 705.846 384.484 674.538 302.224 649.252C237.58 629.382 188.017 586.212 139.787 536.936C81.9466 477.841 -8.4448 424.134 0.859565 341.351C10.1537 258.659 119.65 245.46 178.782 189.984C245.227 127.647 273.339 -12.303 362.886 1.70646C453.158 15.8293 437.927 165.223 495.421 239.521C552.207 312.905 677.044 329.994 688.69 422.741Z" | ||
fill="url(#paint0_linear_28_50)" | ||
/> | ||
<defs> | ||
<linearGradient | ||
id="paint0_linear_28_50" | ||
x1="152.99" | ||
y1="542.874" | ||
x2="427.952" | ||
y2="44.3011" | ||
gradientUnits="userSpaceOnUse" | ||
> | ||
<stop stop-color="#6EACC4" /> | ||
<stop offset="1" stop-color="#6EACC4" stop-opacity="0" /> | ||
</linearGradient> | ||
</defs> | ||
</svg> | ||
); | ||
} |
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,12 +1,12 @@ | ||
import { z } from "zod"; | ||
import { imageSchema } from "../Image"; | ||
|
||
export const projectSchema = z.object({ | ||
slug: z.string(), | ||
title: z.string(), | ||
Date: z.any(), | ||
image: z.any(), | ||
blocks: z.array(z.any()), | ||
Date: z.coerce.date(), | ||
image: imageSchema, | ||
Description: z.string(), | ||
}); | ||
|
||
export type Project = z.infer<typeof projectSchema>; | ||
export type ProjectType = z.infer<typeof projectSchema>; |
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