diff --git a/middleware.js b/middleware.js
index ab966e6a..31188417 100644
--- a/middleware.js
+++ b/middleware.js
@@ -1,27 +1,16 @@
import { NextResponse } from 'next/server'
-import country from 'country-list-js';
+import country from 'country-list-js'
const partners = ['gb_help_desk']
export function middleware(request) {
- if (request.nextUrl.pathname.startsWith('/bank')) {
- const url = request.nextUrl.clone()
- if (url.pathname === '/bank/') {
- if (partners.includes(url.searchParams.get('ref'))) {
- url.pathname = '/bank/partner'
- } else {
- url.pathname = '/bank/index'
- }
- return NextResponse.rewrite(url)
- }
- }
if (request.nextUrl.pathname.startsWith('/slack')) {
let url = request.nextUrl
- if(!url.searchParams.get("continent")){
- let continent = country.findByIso2(request.geo.country || "AU").continent
- if(continent == "Oceania"){
- continent = "Australia"
+ if (!url.searchParams.get('continent')) {
+ let continent = country.findByIso2(request.geo.country || 'AU').continent
+ if (continent == 'Oceania') {
+ continent = 'Australia'
}
- url.searchParams.set("continent", continent)
+ url.searchParams.set('continent', continent)
return NextResponse.redirect(url)
}
}
diff --git a/pages/bank/[type].js b/pages/bank/index.js
similarity index 65%
rename from pages/bank/[type].js
rename to pages/bank/index.js
index 9be920f6..646b96a3 100644
--- a/pages/bank/[type].js
+++ b/pages/bank/index.js
@@ -22,7 +22,7 @@ const styles = `
}
`
-export default function Bank({ isPartner, stats }) {
+export default function Bank({ stats }) {
return (
<>
@@ -34,28 +34,20 @@ export default function Bank({ isPartner, stats }) {
description="Hack Club Bank is the largest fiscal sponsor of teen-led organizations in the US. Get a 501(c)(3) status-backed fund optimized for events, nonprofits, and more."
image="/bank/og-image.png"
>
- Hack Club Bank — Fiscal Sponsorship
+ Fiscal Sponsorship — Hack Club Bank
- {isPartner ? (
-
- ) : (
-
- )}
- {isPartner ? (
-
- ) : (
-
- )}
+
+
+
+
- {isPartner ? (
-
- ) : (
-
- )}
- {!isPartner && }
+
+
+
+
@@ -63,20 +55,12 @@ export default function Bank({ isPartner, stats }) {
)
}
-export async function getStaticPaths() {
- return {
- paths: [{ params: { type: 'partner' } }, { params: { type: 'index' } }],
- fallback: false
- }
-}
-
export async function getStaticProps(context) {
const res = await fetch(`https://bank.hackclub.com/stats`)
const stats = await res.json()
return {
props: {
- isPartner: context.params.type === 'partner',
stats
}
}