Skip to content

Commit

Permalink
chore: run fix and remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
supapesh committed Apr 4, 2022
1 parent 24cb8ea commit e3e54a4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
46 changes: 23 additions & 23 deletions frontend/src/pages/FormPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { FileText, Login } from 'tabler-icons-react'
import { Form } from '../components/ApplicationForm'
import { useNavigate } from 'react-router-dom'
import { useEffect, useState } from 'react'
import axios from 'axios'
import { isApplicationPeriodActive } from '../services/Applications'

const useStyles = createStyles((theme) => ({
Expand Down Expand Up @@ -135,7 +134,7 @@ const useStyles = createStyles((theme) => ({
loading: {
margin: 'auto',
width: '100%',
}
},
}))

function FormBox() {
Expand All @@ -151,11 +150,10 @@ function FormBox() {
const response = await isApplicationPeriodActive()
setPeriodOpen(response)
setIsLoading(false)
} catch(err) {
} catch (err) {
setPeriodOpen(false)
setIsLoading(false)
}

}
getApplicationPeriodActiveAsync()
}, [])
Expand All @@ -176,24 +174,26 @@ function FormBox() {
Intern
</Button>
</Box>
{isLoading ? <Loader size='xl' color='yellow' className={classes.loading} /> : periodOpen ? (
<Box className={classes.formTitleAndBodyWrapper}>
<h2 className={classes.formTitle}>
<FileText />
Søknad til NTNUI Admin
</h2>
<Form />
</Box>
) : (
<Box className={classes.closedPeriod}>
<h1 className={classes.formTitle}>Hei, kjære søker!</h1>
<p className={classes.closedText}>
Så gøy at du vil være en del av NTNUI. Opptaket er for tiden stengt, men
gjerne sjekk igjen ved en senere anledning!
</p>
</Box>
)}
</>
{isLoading ? (
<Loader size='xl' color='yellow' className={classes.loading} />
) : periodOpen ? (
<Box className={classes.formTitleAndBodyWrapper}>
<h2 className={classes.formTitle}>
<FileText />
Søknad til NTNUI Admin
</h2>
<Form />
</Box>
) : (
<Box className={classes.closedPeriod}>
<h1 className={classes.formTitle}>Hei, kjære søker!</h1>
<p className={classes.closedText}>
Så gøy at du vil være en del av NTNUI. Opptaket er for tiden stengt, men
gjerne sjekk igjen ved en senere anledning!
</p>
</Box>
)}
</>
)
}
export default FormBox
export default FormBox
2 changes: 1 addition & 1 deletion frontend/src/services/Applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ export {
getApplication,
getAdmissionPeriod,
putAdmissionPeriod,
isApplicationPeriodActive
isApplicationPeriodActive,
}

0 comments on commit e3e54a4

Please sign in to comment.