From 6467491b743dea2dfaf990d780596ea45360e83b Mon Sep 17 00:00:00 2001 From: NicoSerranoP Date: Sat, 17 Jun 2023 16:20:33 -0400 Subject: [PATCH] frontend(fix): do not use first (-1) project --- packages/frontend/src/pages/Projects.tsx | 46 ++++++------------------ 1 file changed, 11 insertions(+), 35 deletions(-) diff --git a/packages/frontend/src/pages/Projects.tsx b/packages/frontend/src/pages/Projects.tsx index 953bf7f..2ad2a25 100644 --- a/packages/frontend/src/pages/Projects.tsx +++ b/packages/frontend/src/pages/Projects.tsx @@ -2,49 +2,25 @@ import { styled } from 'styled-components' import Header from '../components/Header' import Row from '../components/projects/Row' import TopDescription from '../components/projects/TopDescription' +import data from '../../../../projects-partipants.json' +import { useEffect, useState } from 'react' +import { Project } from '../types/projects' const Projects = () => { - // TODO: read from contract directly - const projects = [ - { - id: 0, - name: 'Hack All Da IPs', - description: 'Hack the planet', - challenge: 'Will it blend?', - deliverables: 'Stuxnet executable', - repoUrl: - 'https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition', - members: [ - { - participantId: 2, - }, - ], - }, - { - id: 1, - name: 'Beaknet', - description: 'Skynet, but with Furbies', - challenge: 'What if AI was soft & cute?', - deliverables: 'Fluffy extinction', - repoUrl: - 'https://github.com/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', - members: [ - { - participantId: 3, - }, - { - participantId: 4, - }, - ], - }, - ] + const [shownProjects, setShownProjects] = useState([]) + + useEffect(() => { + const { projects } = data + projects.shift() + setShownProjects(projects) + }, []) return (
- {projects.map((project, i) => ( + {shownProjects.map((project, i) => ( ))}