mirror of
https://github.com/System-End/site.git
synced 2026-04-19 22:05:11 +00:00
button and stuff DISAPPEARS!! only temp for now
This commit is contained in:
parent
f7729544b4
commit
605b00273d
1 changed files with 8 additions and 11 deletions
|
|
@ -13,7 +13,6 @@ import { useRouter } from 'next/router'
|
|||
import useForm from '../../lib/use-form'
|
||||
import Submit from '../submit'
|
||||
import { getCookie, hasCookie } from 'cookies-next'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
const JoinForm = ({ sx = {} }) => {
|
||||
const router = useRouter()
|
||||
|
|
@ -30,8 +29,6 @@ const JoinForm = ({ sx = {} }) => {
|
|||
})
|
||||
|
||||
const eventReferrer = useField('event').value
|
||||
const isAdult = useField('educationLevel').value === 'tertiary'
|
||||
const useWaitlist = process.env.NEXT_PUBLIC_OPEN !== 'true'
|
||||
|
||||
const createNums = (start, end) => {
|
||||
let nums = []
|
||||
|
|
@ -46,19 +43,19 @@ const JoinForm = ({ sx = {} }) => {
|
|||
const months = createNums(1, 12)
|
||||
const days = createNums(1, 31)
|
||||
|
||||
const month = useField('birthday').value
|
||||
const month = useField('month').value
|
||||
const day = useField('day').value
|
||||
const year = useField('year').value
|
||||
|
||||
const birthday = new Date(year, month - 1, day)
|
||||
|
||||
const age = new Date().getFullYear() - birthday.getFullYear()
|
||||
|
||||
const isPersonAdult = age >= 18
|
||||
let isAdult = age >= 18
|
||||
if (month === '' || day === '' || year === '') {
|
||||
isAdult = false
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
console.log(isPersonAdult)
|
||||
})
|
||||
const useWaitlist = process.env.NEXT_PUBLIC_OPEN !== 'true' || isAdult
|
||||
|
||||
return (
|
||||
<Card sx={{ maxWidth: 'narrow', mx: 'auto', label: { mb: 3 }, ...sx }}>
|
||||
|
|
@ -170,7 +167,7 @@ const JoinForm = ({ sx = {} }) => {
|
|||
/>
|
||||
</Label>
|
||||
|
||||
{isAdult && (
|
||||
{/*{isAdult && (
|
||||
<Text
|
||||
variant="caption"
|
||||
color="secondary"
|
||||
|
|
@ -184,7 +181,7 @@ const JoinForm = ({ sx = {} }) => {
|
|||
a email at{' '}
|
||||
<Link href="mailto:team@hackclub.com">team@hackclub.com</Link>.
|
||||
</Text>
|
||||
)}
|
||||
)}*/}
|
||||
|
||||
{!isAdult && (
|
||||
<Box>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue