Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APAC hackathons to /apac page #78

Merged
merged 23 commits into from
Nov 13, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Get user location"
This reverts commit dd95963.
  • Loading branch information
exu3 committed Nov 6, 2021
commit 0405f250061e6c74954716aebede30aab510334f
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"@hackclub/theme": "^0.3.3",
"@mdx-js/loader": "^1.6.22",
"@next/mdx": "^10.0.4",
"geoip-country": "^4.0.93",
"lodash": "^4.17.21",
"next": "^12.0.2",
"next-compose-plugins": "^2.2.1",
Expand Down
16 changes: 0 additions & 16 deletions pages/api/country.js

This file was deleted.

20 changes: 4 additions & 16 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import Meta from '@hackclub/meta'
import Signup from '../components/signup'
import Years from '../components/years'
import Regions from '../components/regions'
import { filter, orderBy, slice, last } from 'lodash'
import { filter, orderBy, slice, last, remove } from 'lodash'
import { timeSince, humanizedDateRange } from '../lib/util'
import { getGroupingData } from '../lib/data'
import Banner from '../components/banner'
import { sendJson } from 'next/dist/server/api-utils'

const title = `High School Hackathons in ${new Date().getFullYear()}`
const eventsPreview = events =>
Expand Down Expand Up @@ -55,13 +53,6 @@ export default ({ stats, emailStats, events }) => (
</Link>{' '}
staff.
</Text>
<Banner
copy="Looking for hackathons in the APAC (Asia-Pacific) region?"
caption="They've been moved to a new page!"
href="/apac"
iconRight="enter"
color="primary"
/>
</>
}
events={events}
Expand All @@ -83,9 +74,6 @@ export default ({ stats, emailStats, events }) => (

export const getStaticProps = async () => {
let { events, emailStats } = await getGroupingData()
const location = await fetch('https://localhost:3000/api/country')
const userLocation = JSON.stringify(location)
console.log(userLocation)
let stats = {
total: events.length,
state: new Set(
Expand All @@ -106,7 +94,7 @@ export const getStaticProps = async () => {
filter(events, e => new Date(e.start) >= new Date()),
'start'
)
// APAC Hackathons are now on the /apac page
events = filter(events, ['apac', false])
return { props: { events, stats, emailStats, userLocation }, revalidate: 1 }
// Filter out apac hackathons. Moved to /apac as of 2021-11-05
events = filter(events, 'country')
return { props: { events, stats, emailStats }, revalidate: 1 }
}
Loading