Skip to content

Commit

Permalink
Merge pull request #177 from m2mathew/fix/move_july_1_to_august_1
Browse files Browse the repository at this point in the history
Fix/move july 1 to august 1
  • Loading branch information
m2mathew authored Jul 2, 2023
2 parents d1458ce + 573eee4 commit 4d12b07
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tmac-website",
"description": "Website for the Texas Music Administrators Conference",
"version": "2.25.0",
"version": "2.26.0",
"repository": {
"type": "git",
"url": "https://github.com/m2mathew/tmac-website"
Expand Down
1 change: 0 additions & 1 deletion src/components/about/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import Motifs from '../shared/Motifs';

// Local Variables
const StyledRoot = styled.section(({ theme }) => ({

address: {
'& > p': {
fontWeight: 500,
Expand Down
9 changes: 6 additions & 3 deletions src/components/register/MemberRegisterContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { useEffect, useReducer } from 'react';
import styled from 'styled-components';

// Internal Dependencies
import { isTodayAfterJune30th } from '../../utils/helpers';
import { isTodayAfterJuly31st } from '../../utils/helpers';
import { useGetAuthUser } from '../../utils/hooks/useGetAuthUser';
import Container from '../shared/container';
import RegisterEmail from './RegisterEmail';
Expand Down Expand Up @@ -212,8 +212,11 @@ const MemberRegisterContent: React.FC = () => {

const hasCompletedAllMemberSteps = completedMemberSteps.length >= 3;

// We normally shut down registration and sponsorship after TMEA each year and open it up on 7/1
const showMembershipCompleteNote = isTodayAfterJune30th;
console.log('isTodayAfterJuly31st', isTodayAfterJuly31st);

// We normally shut down registration and sponsorship after TMEA each year and open it up on 8/1.
// This might change, so we need to talk to the Executive Secretary for the most up-to-date info.
const showMembershipCompleteNote = isTodayAfterJuly31st;

/* Children change depending on which step is active */
return (
Expand Down
4 changes: 2 additions & 2 deletions src/components/register/RegisterEmail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';

// Internal Dependencies
import { appNameShort } from '../../utils/app-constants';
import { isTodayAfterJune30th } from '../../utils/helpers';
import { isTodayAfterJuly31st } from '../../utils/helpers';
import { MemberFormValues } from './MemberRegisterContent';
import { SponsorFormValues } from './SponsorRegisterContent';
import FormDivider from '../shared/FormDivider';
Expand Down Expand Up @@ -84,7 +84,7 @@ const RegisterEmail: React.FC<Props> = ({
]);

// We normally shut down registration and sponsorship after TMEA each year and open it up on 7/1
if (!isTodayAfterJune30th) {
if (!isTodayAfterJuly31st) {
return <RegistrationPausedAlert />;
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/register/RegisterStepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import styled from 'styled-components';

// Internal Dependencies
import { appNameShort } from '../../utils/app-constants';
import { isTodayAfterJune30th } from '../../utils/helpers';
import { isTodayAfterJuly31st } from '../../utils/helpers';
import DrumBanner from '../shared/DrumBanner';
import EnhancedCard from '../shared/EnhancedCard';

Expand Down Expand Up @@ -102,7 +102,7 @@ const RegisterStepper: React.FC<Props> = ({
const steps = getSteps(isAuthenticated, isViewingSponsors);

// We normally shut down registration and sponsorship after TMEA each year and open it up on 7/1
if (!isTodayAfterJune30th) {
if (!isTodayAfterJuly31st) {
return <DrumBanner drumBannerTitle="Registration Closed" />;
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/register/register-member-form-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
MemberFormValues,
} from './MemberRegisterContent';
import { appNameShort } from '../../utils/app-constants';
import { isTodayAfterJune30th } from '../../utils/helpers';
import { isTodayAfterJuly31st } from '../../utils/helpers';
import FormDivider from '../shared/FormDivider';
import FormTitle from '../shared/FormTitle';
import RegisterForm from './register-member-form';
Expand All @@ -31,7 +31,7 @@ const MemberFormValuesWrapper: React.FC<Props> = ({
}

// We normally shut down registration and sponsorship after TMEA each year and open it up on 7/1
const showMembershipForm = isTodayAfterJune30th;
const showMembershipForm = isTodayAfterJuly31st;

if (!showMembershipForm) {
return <RegistrationPausedAlert />;
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/RegistrationPausedAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const RegistrationPausedAlert: React.FC<Props> = ({ isMembership = true }) => {
return (
<Box mt={3}>
<EnhancedAlert title={`${type} Notice`}>
{appNameShort} {type} will open up again on July 1st.
{appNameShort} {type} will open up again on August 1st.
</EnhancedAlert>
</Box>
);
Expand Down
8 changes: 4 additions & 4 deletions src/pages/members/join.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React from 'react';
import styled from 'styled-components';

// Internal Dependencies
import { isTodayAfterJune30th } from '../../utils/helpers';
import { isTodayAfterJuly31st } from '../../utils/helpers';
import ArrowForwardIcon from '../../components/shared/ArrowForwardIcon';
import AuthUserContext from '../../components/session/AuthUserContext';
import CardHeadline from '../../components/shared/cards/card-headline';
Expand Down Expand Up @@ -56,11 +56,11 @@ const JoinContainer = ({ location }) => {
<div className="topContent">
<CardHeadline>Join TMAC</CardHeadline>

{!isTodayAfterJune30th
{!isTodayAfterJuly31st
? (
<Box mt={3}>
<EnhancedAlert title="Membership Notice">
TMAC Membership will open up again on July 1st.
TMAC Membership will open up again on August 1st.
</EnhancedAlert>
</Box>
) : (
Expand Down Expand Up @@ -103,7 +103,7 @@ const JoinContainer = ({ location }) => {
)}
</div>

{isTodayAfterJune30th && (
{isTodayAfterJuly31st && (
<>
<div className="bottomContent">
<CtaButton
Expand Down
4 changes: 2 additions & 2 deletions src/pages/members/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const StyledRoot = styled.div(({ theme }) => ({
flexDirection: 'column',
flexWrap: 'wrap',
justifyContent: 'space-around',
overflow: 'hidden',
position: 'relative',
width: '100vw',
}));
Expand All @@ -66,11 +67,10 @@ const Login: React.FC<Props> = ({ location }) => {
>
<ReCaptchaProvider>
<StyledRoot>
<Motifs small />

<DrumBanner drumBannerTitle="Member Log In" />

<div className="loginContent">
<Motifs small />

<Typography
className="loginTitle"
Expand Down
4 changes: 2 additions & 2 deletions src/pages/sponsors/sponsor-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import styled from 'styled-components';

// Internal Dependencies
import { appNameShort } from '../../utils/app-constants';
import { isTodayAfterJune30th } from '../../utils/helpers';
import { isTodayAfterJuly31st } from '../../utils/helpers';
import Container from '../../components/shared/container';
import CtaButton from '../../components/shared/CtaButton';
import Layout from '../../components/layout';
Expand Down Expand Up @@ -42,7 +42,7 @@ const StyledRoot = styled.div(({ theme }) => ({
// Component Definition
const SponsorInfo: React.FC<Props> = ({ location }) => {
// We normally shut down registration and sponsorship after TMEA each year and open it up on 7/1
const showSponsorshipInfo = isTodayAfterJune30th;
const showSponsorshipInfo = isTodayAfterJuly31st;

return (
<Layout
Expand Down
17 changes: 12 additions & 5 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,26 @@ export const currentYearShort = format(new Date(), 'yy');

// The "year" for TMAC starts on 7/1
// new Date(2021, 6, 1) → 7/1/2021
export const isTodayAfterJune30th = isAfter(
// export const isTodayAfterJune30th = isAfter(
// new Date(),
// new Date(parseInt(currentYearLong, 10), 6, 1),
// );

// As of 2023-06-28, the "year" for TMAC starts on 8/1
// new Date(2023, 7, 1) → 8/1/2023
export const isTodayAfterJuly31st = isAfter(
new Date(),
new Date(parseInt(currentYearLong, 10), 6, 1),
new Date(parseInt(currentYearLong, 10), 7, 1),
);

export const currentSchoolYearShort = isTodayAfterJune30th
export const currentSchoolYearShort = isTodayAfterJuly31st
? `${currentYearShort}-${Number(currentYearShort) + 1}`
: `${Number(currentYearShort) - 1}-${currentYearShort}`;

export const currentSchoolYearLong = isTodayAfterJune30th
export const currentSchoolYearLong = isTodayAfterJuly31st
? `${currentYearLong}-${Number(currentYearLong) + 1}`
: `${Number(currentYearLong) - 1}-${currentYearLong}`;

export const currentSchoolYearEnding = isTodayAfterJune30th
export const currentSchoolYearEnding = isTodayAfterJuly31st
? `${Number(currentYearLong) + 1}`
: currentYearLong;

0 comments on commit 4d12b07

Please sign in to comment.