mirror of
https://github.com/NicoSerranoP/voteathon.git
synced 2026-01-11 05:38:05 -05:00
frontend(fix): do not use first (-1) project
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user