Skip to content

Commit

Permalink
fixed issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayla Hamakawa authored and Kayla Hamakawa committed Mar 1, 2024
1 parent 8e20119 commit 7274089
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 17 deletions.
48 changes: 32 additions & 16 deletions src/components/MenuBar/ButtonBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +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, hothStart, hothEnd } 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 @@ -35,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 @@ -82,22 +94,26 @@ function ButtonBar({ isMobile }) {
{link.name}
</PoppinLink>)}

{Date.now() < hothStart.getTime() ? (
{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>
):(
Apply
</BorderLink> :
<BorderLink
disabled={Date.now() < hothStart.getTime() || Date.now() > hothEnd.getTime()}
href='/submissions'
disabled={
Date.now() < hothStart.getTime() || Date.now() > hothEnd.getTime()
}
href="/submissions"
>
Submit
Submit
</BorderLink>
)}
}
</>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/constants.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const hothStart = new Date('2024-03-03T08:00:00-08:00');
export const hothEnd = new Date('2024-03-03T23:00:00-08:00');
export const applyDeadline = new Date('2024-02-26T23:59:59-08:00');
export const applyDeadline = new Date('2024-02-28T23:59:59-08:00');
export const applicationOpen = new Date('2024-01-29T08:00:00-08:00');
export const scheduleAvailableTime = new Date('2024-02-26T08:00:00-08:00');

0 comments on commit 7274089

Please sign in to comment.