Skip to content

Commit

Permalink
updating hackathons list to be in chronological order
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyab committed Dec 3, 2023
1 parent c04cfeb commit ddf6198
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 2 additions & 4 deletions components/index/cards/hackathons.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import CardModel from './card-model'
import { Box, Flex, Grid, Image, Link, Text } from 'theme-ui'
import { useState, useEffect } from 'react'
import {Box, Flex, Grid, Image, Link, Text} from 'theme-ui'
import Buttons from './button'
import ScrollingHackathons from '../../hackathons/scrolling-hackathons'
import Dot from '../../dot'
import { formatDate } from '../../../lib/dates'
import {formatDate} from '../../../lib/dates'

/** @jsxImportSource theme-ui */
const Cover = () => (
Expand Down
7 changes: 4 additions & 3 deletions pages/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Badge, Box, Button, Card, Flex, Grid, Heading, Link, Text } from 'theme-ui'
import React, { useEffect, useRef, useState } from 'react'
import {Badge, Box, Button, Card, Flex, Grid, Heading, Link, Text} from 'theme-ui'
import React, {useEffect, useRef, useState} from 'react'
import Head from 'next/head'
import { useRouter } from 'next/router'
import {useRouter} from 'next/router'
import Meta from '@hackclub/meta'
import Nav from '../components/nav'
import BGImg from '../components/background-image'
Expand Down Expand Up @@ -1225,6 +1225,7 @@ export async function getStaticProps() {
} catch (error) {
hackathonsData = [] // or some default value if an error occurs
}
hackathonsData.sort((a, b) => new Date(a.start) - new Date(b.start));

let events = await fetch(
'https://events.hackclub.com/api/events/upcoming/'
Expand Down

0 comments on commit ddf6198

Please sign in to comment.