frontend(fix): do not use first (-1) project

This commit is contained in:
NicoSerranoP
2023-06-17 16:20:33 -04:00
parent 1d564e8b94
commit 6467491b74

View File

@@ -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<Project[]>([])
useEffect(() => {
const { projects } = data
projects.shift()
setShownProjects(projects)
}, [])
return (
<div>
<Header />
<Container>
<TopDescription />
{projects.map((project, i) => (
{shownProjects.map((project, i) => (
<Row key={'project-' + i} index={i} project={project}></Row>
))}
</Container>