Skip to content

Commit

Permalink
add /join redirect to get membership from EUSA shop
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasmaillo committed Nov 10, 2024
1 parent b68a8b9 commit 51ba506
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
35 changes: 35 additions & 0 deletions app/join/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
'use client'

import { useEffect, useState } from 'react'
import { redirect } from 'next/navigation'
import { EUSA_MEMBERSHIP_URL } from '@/constants/socials'
import Heading from '@/components/heading'

export default function JoinPage() {
useEffect(() => {
redirect(EUSA_MEMBERSHIP_URL)
}, [])

// For the unlikely event that the redirect fails, show an error button
const [showErrorButton, setShowErrorButton] = useState(false)

useEffect(() => {
setTimeout(() => {
setShowErrorButton(true)
}, 750)
}, [])

return (
<div
className={`max-w-xl mx-auto mt-12 flex flex-col gap-6 ${showErrorButton ? 'opacity-100' : 'opacity-0'} transition-opacity duration-250`}
>
<Heading title="Become an official member" />
<p>If you did not get redirected, please click the button below.</p>
<a href={EUSA_MEMBERSHIP_URL}>
<button className="bg-csred text-white px-4 py-2 rounded-md">
Become a member ↗
</button>
</a>
</div>
)
}
2 changes: 2 additions & 0 deletions constants/socials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ export const DISCORD_INVITE_URL = 'https://discord.gg/fmp7p9Ca4y'
export const INSTAGRAM_URL = 'https://www.instagram.com/comp_soc/'
export const LINKEDIN_URL = 'https://uk.linkedin.com/company/compsoc'
export const X_URL = 'https://mobile.x.com/CompSoc'
export const EUSA_MEMBERSHIP_URL =
'https://www.eusa.ed.ac.uk/shop?activity_id=96'

0 comments on commit 51ba506

Please sign in to comment.