Skip to content

Commit

Permalink
Kayla/submissions page (#415)
Browse files Browse the repository at this point in the history
* added submissions info page and button for when hoth xi starts

* changed format for links

* fixed issue

* link style change and format change

* lint fix again

* link tag change and format change

---------

Co-authored-by: Kayla Hamakawa <[email protected]>
  • Loading branch information
kaylahama and Kayla Hamakawa authored Mar 3, 2024
1 parent a1536e8 commit 6a3ba89
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 8 deletions.
41 changes: 33 additions & 8 deletions src/components/MenuBar/ButtonBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import { makeStyles } from '@material-ui/core/styles';
import { Link as GatsbyLink } from 'gatsby';
import { Link as MUILink } from '@material-ui/core';

import { applicationOpen, applyDeadline } from '../constants.js';
import {
applicationOpen,
applyDeadline,
hothStart,
hothEnd
} from '../constants.js';

const useStyles = makeStyles(theme => {
const menuBarAdaptiveThreshold = theme.breakpoints.values.sm * 1.3;
Expand Down Expand Up @@ -34,19 +39,27 @@ function ButtonBar({ isMobile }) {
const classes = useStyles();

const PoppinLink = ({ ...props }) =>
<Button component={GatsbyLink} role='link' fullWidth={isMobile} className={classes.btn} {...props} />;
<Button
component={GatsbyLink}
role="link"
fullWidth={isMobile}
className={classes.btn}
{...props}
/>;


const BorderLink = ({ ...props }) =>
<Button
component={MUILink}
role='link'
role="link"
className={classes.borderBtn}
style={{ margin: 10, textDecoration: 'none' }}
variant='contained'
variant="contained"
{...props}
color='secondary'
color="secondary"
/>;


const links = [
{
name: 'Home',
Expand Down Expand Up @@ -80,13 +93,25 @@ function ButtonBar({ isMobile }) {
<PoppinLink to={link.to} key={`nav-${index}`}>
{link.name}
</PoppinLink>)}
{

{Date.now() < hothStart.getTime() ?
<BorderLink
disabled={Date.now() < applicationOpen.getTime() || Date.now() > applyDeadline.getTime()}
disabled={
Date.now() < applicationOpen.getTime() ||
Date.now() > applyDeadline.getTime()
}
href={'https://forms.gle/VMhdCzMov8RvGUfP8'}
target='_blank'
target="_blank"
>
Apply
</BorderLink> :
<BorderLink
disabled={
Date.now() < hothStart.getTime() || Date.now() > hothEnd.getTime()
}
href="/submissions"
>
Submit
</BorderLink>
}
</>
Expand Down
94 changes: 94 additions & 0 deletions src/components/SubmissionsPage/Submissions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import React, { useState } from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import Container from '@material-ui/core/Container';
import Link from '@material-ui/core/Link';

const useStyles = makeStyles(theme => ({
title: {
fontWeight: theme.typography.fontWeightBold,
paddingTop: theme.spacing(11),
[theme.breakpoints.down('sm')]: {
paddingTop: theme.spacing(4)
},
paddingBottom: theme.spacing(4)
},
info: {
paddingTop: theme.spacing(4)
},
link: {
color: theme.palette.secondary.main
},
linkClicked: {
color: theme.palette.secondary.dark
}
}));

const SubmissionsPage = () => {
const classes = useStyles();

const [formClicked, setFormClicked] = useState(false);
const [devPostClicked, setDevPostClicked] = useState(false);

const handleFormClick = () => {
setFormClicked(true);
};

const handleDevPostClick = () => {
setDevPostClicked(true);
};

return (
<Container maxWidth="md">
<Typography
align="left"
variant="h4"
component="h1"
className={classes.title}
>
Submission Info
</Typography>

<Typography align="left" variant="h5" component="h2">
Follow These 2 Final Steps to Submit Your Project:
</Typography>

<Typography className={classes.info}>
1{')'} Submit the project on the HOTH XI{' '}
<Link
href="https://hoth-xi.devpost.com/?ref_feature=challenge&ref_medium=discover"
target="_blank"
className={devPostClicked ? classes.linkClicked : classes.link}
onClick={handleDevPostClick}
rel="noopener noreferrer"
>
Devpost
</Link>
</Typography>

<Typography className={classes.info}>
2{')'} Fill out the HOTH XI{' '}
<Link
href="https://forms.gle/VPBHtLTyPo1pn7pn9"
target="_blank"
className={formClicked ? classes.linkClicked : classes.link}
onClick={handleFormClick}
rel="noopener noreferrer"
>
Submission Google Form
</Link>
</Typography>

<Typography
className={classes.info}
align="left"
variant="h6"
component="h3"
>
Thank You for Participating in HOTH XI!
</Typography>
</Container>
);
};

export default SubmissionsPage;
15 changes: 15 additions & 0 deletions src/pages/submissions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';

import Layout from '../components/layout';
import SEO from '../components/seo';
import Submissions from '../components/SubmissionsPage/Submissions';


const SubmissionsPage = () => {
return <Layout>
<SEO title='Submissions' />
<Submissions/>
</Layout>;
};

export default SubmissionsPage;

0 comments on commit 6a3ba89

Please sign in to comment.