-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
286 additions
and
26 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,41 @@ | ||
import { Box, Heading, Text, VStack } from "@chakra-ui/react" | ||
import ActionCard from "../../components/ActionCard" | ||
import ProjectsList from "@/components/ProjectsList" | ||
|
||
export default function Projects() { | ||
return ( | ||
<VStack> | ||
<VStack h="393" w="100%" justify="end" align="left" spacing="40"> | ||
<Box | ||
zIndex="-1" | ||
left="0" | ||
w="100%" | ||
h="393" | ||
pos="absolute" | ||
bgImg="url('./section-3.png')" | ||
bgSize="100%" | ||
bgPos="center" | ||
bgRepeat="no-repeat" | ||
/> | ||
|
||
<VStack align="left" spacing="4" pb="16"> | ||
<Heading fontSize="72px">Built with Semaphore</Heading> | ||
<Text fontSize="20px"> | ||
Discover a curated showcase of innovative projects <br /> and applications developed using the | ||
Semaphore Protocol. | ||
</Text> | ||
</VStack> | ||
</VStack> | ||
|
||
<ProjectsList w="100%" align="left" pt="16" spacing="14" /> | ||
|
||
<VStack my={"128"}> | ||
<ActionCard | ||
title="Show what you have built" | ||
description="We are missing your project! Add your project to this page and show your awesomeness to the world." | ||
buttonText="Submit your project" | ||
/> | ||
</VStack> | ||
</VStack> | ||
) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
"use client" | ||
|
||
import { Button, Grid, GridItem, HStack, IconButton, Link, Text, VStack } from "@chakra-ui/react" | ||
import { useCallback, useEffect, useState } from "react" | ||
import ProjectCard from "../components/ProjectCard" | ||
import allProjects from "../data/projects.json" | ||
import IconChevronLeft from "../icons/IconChevronLeft" | ||
import IconChevronRight from "../icons/IconChevronRight" | ||
import IconCommunity from "../icons/IconCommunity" | ||
import { chunkArray } from "../utils/chunkArray" | ||
import { getProjectTags } from "../utils/getProjectTags" | ||
|
||
export default function ProjectsList(props: any) { | ||
const [projects, setProjects] = useState<(typeof allProjects)[]>(chunkArray(allProjects)) | ||
const [index, setIndex] = useState<number>(0) | ||
const [selectedTag, setSelectedTag] = useState<string | null>(null) | ||
const [onlyPSE, setOnlyPSE] = useState<boolean | null>(null) | ||
|
||
const filterProjects = useCallback(() => { | ||
let filteredProjects = allProjects | ||
|
||
if (selectedTag) { | ||
filteredProjects = allProjects.filter((project) => project.tags.includes(selectedTag)) | ||
} | ||
|
||
if (onlyPSE === true) { | ||
filteredProjects = allProjects.filter((project) => project.pse) | ||
} else if (onlyPSE === false) { | ||
filteredProjects = allProjects.filter((project) => !project.pse) | ||
} | ||
|
||
setProjects(chunkArray(filteredProjects)) | ||
}, [selectedTag, onlyPSE]) | ||
|
||
useEffect(() => { | ||
filterProjects() | ||
}, [selectedTag, onlyPSE]) | ||
|
||
return ( | ||
<VStack {...props}> | ||
<VStack align="left" spacing="6"> | ||
<Text fontSize="20">Projects created by</Text> | ||
|
||
<HStack spacing="4"> | ||
<Button | ||
size="lg" | ||
variant={onlyPSE === true ? "solid" : "outline"} | ||
colorScheme={onlyPSE === true ? "primary" : "inherit"} | ||
onClick={() => setOnlyPSE(onlyPSE === true ? null : true)} | ||
> | ||
PSE | ||
</Button> | ||
<Button | ||
size="lg" | ||
leftIcon={<IconCommunity />} | ||
variant={onlyPSE === false ? "solid" : "outline"} | ||
colorScheme={onlyPSE === false ? "primary" : "inherit"} | ||
onClick={() => setOnlyPSE(onlyPSE === false ? null : false)} | ||
> | ||
Community | ||
</Button> | ||
</HStack> | ||
</VStack> | ||
|
||
<HStack spacing="5"> | ||
<Text fontSize="20">Category</Text> | ||
|
||
<HStack spacing="3"> | ||
{getProjectTags(allProjects).map((tag) => ( | ||
<Button | ||
key={tag} | ||
size="sm" | ||
variant={tag === selectedTag ? "solid" : "outline"} | ||
colorScheme={tag === selectedTag ? "primary" : "inherit"} | ||
onClick={() => setSelectedTag(tag === selectedTag ? null : tag)} | ||
> | ||
{tag} | ||
</Button> | ||
))} | ||
</HStack> | ||
</HStack> | ||
|
||
<Grid templateColumns="repeat(3, 1fr)" gap={6}> | ||
{projects[index].map((project, i) => ( | ||
<GridItem key={project.name + i}> | ||
<Link href={project.links.github} target="_blank"> | ||
<ProjectCard title={project.name} description={project.tagline} tags={project.tags} /> | ||
</Link> | ||
</GridItem> | ||
))} | ||
</Grid> | ||
|
||
{projects.length > 1 && ( | ||
<HStack w="100%"> | ||
<HStack flex="1" justify="center"> | ||
{index > 0 && <IconButton variant="link" aria-label="Arrow left" icon={<IconChevronLeft />} />} | ||
|
||
<HStack spacing="5"> | ||
{projects.map((_, i) => ( | ||
<Text | ||
key={i} | ||
onClick={() => setIndex(i)} | ||
cursor="pointer" | ||
color={i === index ? "primary.600" : "text.400"} | ||
> | ||
{i + 1} | ||
</Text> | ||
))} | ||
</HStack> | ||
|
||
{index < projects.length - 1 && ( | ||
<IconButton variant="link" aria-label="Arrow right" icon={<IconChevronRight />} /> | ||
)} | ||
</HStack> | ||
</HStack> | ||
)} | ||
</VStack> | ||
) | ||
} |
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,13 @@ | ||
import { Icon, IconProps } from "@chakra-ui/react" | ||
import React from "react" | ||
|
||
export default function IconChevronLeft(props: IconProps): JSX.Element { | ||
return ( | ||
<Icon viewBox="0 0 8 14" {...props}> | ||
<path | ||
d="M2.828 6.99999L7.778 11.95L6.364 13.364L0 6.99999L6.364 0.635986L7.778 2.04999L2.828 6.99999Z" | ||
fill="currentColor" | ||
/> | ||
</Icon> | ||
) | ||
} |
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.