-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add project-page UI * update icons source to react-icon * fix(mock): updated mock getMock * delete project-page * update project page * update (proejcts): changed some styling * fix(projects): added tags * wip(filterstore): projects filterstore wip * feat(projects): projects overview and global filtering * fix(filterstore): updated filterstore with filterobject * wip(filterscreen): added filterscreen in the interactive projects overview * fix(filters): updated filters through ui * wip(filtersidebar): changed sidebar filter to use react-hook-form and no more localstate * fix(filters): updated filters in projects with new filterscreen * fix(filtering): adjusted reset filter states * fix(scroll): added scrolling bar in projects overview and tags in legend based on maintag --------- Co-authored-by: Haxfx <[email protected]>
- Loading branch information
Showing
37 changed files
with
758 additions
and
414 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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
export const ChartSkeleton = () => { | ||
return ( | ||
<div className="skeleton-container flex h-full w-full flex-col items-center justify-center gap-4 overflow-hidden bg-primary text-center text-gray-800"> | ||
<p> | ||
With a large amount of nodes it might take time for the graph to load. | ||
</p> | ||
<p>Loading the visualization of projects in the SEI Ecosystem</p> | ||
</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,89 @@ | ||
"use client" | ||
|
||
import { FilterScreen } from "@/components/filter" | ||
import Spinner from "@/components/spinner" | ||
import { AspectRatio } from "@/components/ui/aspect-ratio" | ||
import { Project } from "@/database/schemas/projects.schema" | ||
import { useFilterStore } from "@/stores/project-filter-store" | ||
import Image from "next/image" | ||
import Link from "next/link" | ||
import React, { useEffect } from "react" | ||
|
||
export default function FilterProjects({ | ||
initialProjects, | ||
}: { | ||
initialProjects: Project[] | ||
}) { | ||
const { | ||
projects, | ||
filter, | ||
resetFilters, | ||
setProjects, | ||
updateFilter, | ||
filteredProjects, | ||
isLoading, | ||
} = useFilterStore() | ||
|
||
useEffect(() => { | ||
// Fetch and set projects from db here | ||
if (projects.length === 0) { | ||
setProjects(initialProjects) | ||
} | ||
}, [setProjects]) | ||
|
||
const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => { | ||
updateFilter({ searchTerm: event.target.value }) | ||
} | ||
|
||
if (isLoading) { | ||
return <Spinner /> | ||
} | ||
|
||
return ( | ||
<div className="flex h-[85vh] gap-4 overflow-hidden"> | ||
<div className="flex w-[23.2rem] items-center gap-4"> | ||
<FilterScreen close={false} /> | ||
</div> | ||
|
||
{filteredProjects.length === 0 ? ( | ||
<div className="mt-10 flex w-full justify-center"> | ||
No Projects found | ||
</div> | ||
) : ( | ||
<div className="projects-grid overflow-y-scroll"> | ||
<div className="grid grid-cols-2 gap-4 overflow-hidden md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"> | ||
{filteredProjects.map((project) => ( | ||
<Link | ||
key={project.id} | ||
href={`/projects/${project.slug}`} | ||
className="flex flex-col rounded-md shadow-xl" | ||
> | ||
<AspectRatio ratio={1} className="relative"> | ||
<Image | ||
src={"/images/image1.png"} | ||
alt={project.name} | ||
fill | ||
className="rounded-t-md" | ||
/> | ||
<div className="absolute right-4 top-4 bg-white px-2 py-1 text-xs text-neutral-950 opacity-90"> | ||
{project.mainTag} | ||
</div> | ||
</AspectRatio> | ||
<div className="flex items-center gap-4 bg-neutral-800 px-4 py-2 text-center"> | ||
<Image | ||
src={"/images/sei.jpg"} | ||
alt={project.name} | ||
width={30} | ||
height={30} | ||
className="rounded-full" | ||
/> | ||
<p className="text-sm font-medium">{project.name}</p> | ||
</div> | ||
</Link> | ||
))} | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Button } from "@/components/ui/button" | ||
import { projectTagSchema } from "@/database/schemas/projects.schema" | ||
import { useFilterStore } from "@/stores/project-filter-store" | ||
|
||
const TagFilter = () => { | ||
const { filter, toggleMainTagFilter } = useFilterStore() | ||
|
||
console.log("filter", filter) | ||
|
||
return ( | ||
<div className="flex h-44 w-full flex-wrap gap-2 leading-none"> | ||
{projectTagSchema.options.map((tag) => ( | ||
<Button | ||
key={tag} | ||
variant="outline" | ||
onClick={() => toggleMainTagFilter(tag)} | ||
className={`my-1 w-auto px-3 py-2 ${filter.mainTag.includes(tag) ? "bg-white text-neutral-800" : ""}`} | ||
> | ||
{tag} | ||
</Button> | ||
))} | ||
</div> | ||
) | ||
} | ||
|
||
export default TagFilter |
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,19 +1,40 @@ | ||
import { Projects } from "@/components/pages/projects" | ||
import { Button } from "@/components/ui/button" | ||
import { appMetadata } from "@/config/meteada.config" | ||
import { getAllProjectsAction } from "@/server-actions/projects/projects.actions" | ||
import { mockProjects } from "@/mocks/projects.mocks" | ||
import { Fullscreen } from "lucide-react" | ||
import { Metadata } from "next" | ||
|
||
export const dynamic = "force-dynamic" | ||
import Link from "next/link" | ||
import FilterProjects from "./ProjectsFilter" | ||
|
||
export const metadata: Metadata = { | ||
...appMetadata.projects, | ||
} | ||
|
||
export default async function ProjectsPage() { | ||
const { projects } = await getAllProjectsAction() | ||
// const { projects } = await getAllProjectsAction() | ||
const projectsList = mockProjects(50) | ||
|
||
return ( | ||
<> | ||
<Projects projects={projects}></Projects> | ||
</> | ||
<div className="relative sm:p-6"> | ||
<div className="flex w-full flex-col justify-between gap-2 sm:flex-row sm:items-center"> | ||
<h1 className="py-6 pb-12 text-lg sm:text-2xl"> | ||
Journey Through the SEI Ecosystem | ||
</h1> | ||
</div> | ||
<div> | ||
<FilterProjects initialProjects={projectsList} /> | ||
</div> | ||
<Link href="/ecosystem"> | ||
<div className="h-18 w-18 fixed bottom-4 right-4 m-4 bg-white p-0"> | ||
<Button | ||
className="z-50 m-0 h-12 w-12 p-0 text-neutral-800" | ||
size="sm" | ||
variant="ghost" | ||
> | ||
<Fullscreen /> | ||
</Button> | ||
</div> | ||
</Link> | ||
</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
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
Oops, something went wrong.