Skip to content

Commit 20b7f3a

Browse files
committed
Extend deadline for classes
1 parent a322c8b commit 20b7f3a

File tree

6 files changed

+85
-15
lines changed

6 files changed

+85
-15
lines changed

src/data/courses.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
"EECS16A",
88
"EECS16B"
99
]
10+

src/data/dates.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"applicationSemester": "Fall 2023",
33
"applicationsOpen": "2023-07-27T08:00:00.000Z",
44
"applicationsClose": "2023-08-23T06:59:00.000Z",
5+
"extendedApplicationsOpen": "2023-07-27T08:00:00.000Z",
6+
"extendedApplicationsClose": "2023-09-06T06:59:00.000Z",
57
"interestFormOpen": "2023-07-27T08:00:00.000Z",
68
"interestFormClose": "2023-09-04T06:59:00.000Z"
79
}

src/data/extended_courses.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["EECS16A", "CS70", "CS61C"]

src/labels/MentorLabels.tsx

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import React from "react";
22
import { Link } from "react-router-dom";
33

4-
import { COURSE_STRING_WITH_AND, FAQ_CONTACT } from "./common";
4+
import {
5+
COURSE_STRING_WITH_AND,
6+
EXTENDED_COURSES_STRING_WITH_AND,
7+
FAQ_CONTACT,
8+
} from "./common";
59
import dates from "../data/dates.json";
610

711
export const TITLE = "For Mentors";
@@ -106,6 +110,39 @@ export const SECTIONS = {
106110
</span>
107111
),
108112
},
113+
APPLICATIONS_EXTENDED: {
114+
LABEL: `Applications for ${EXTENDED_COURSES_STRING_WITH_AND} ${dates.applicationSemester} Junior, Associate, and Content Mentors are extended!`,
115+
BODY_JSX: (
116+
<span>
117+
<p className="info">
118+
We are currently recruiting mentors for{" "}
119+
{EXTENDED_COURSES_STRING_WITH_AND}.
120+
<br />
121+
The{" "}
122+
<Link to="/apply">
123+
Junior, Associate, and Content Mentor application is
124+
here!
125+
</Link>{" "}
126+
Applications are due{" "}
127+
{new Date(dates.extendedApplicationsClose).toLocaleString(
128+
"en-US",
129+
{
130+
day: "numeric",
131+
weekday: "long",
132+
year: "numeric",
133+
month: "long",
134+
hour: "numeric",
135+
minute: "2-digit",
136+
timeZone: "America/Los_Angeles",
137+
timeZoneName: "short",
138+
}
139+
)}
140+
. More information is in the application, and no late
141+
applications will be accepted.
142+
</p>
143+
</span>
144+
),
145+
},
109146
APPLICATIONS_CLOSED: {
110147
LABEL:
111148
"Applications have closed for this semester; check back at the end of the semester!",

src/labels/common.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
import React from "react";
22

33
import courses from "../data/courses.json";
4+
import extendedCourses from "../data/extended_courses.json";
45

56
// Mutating courses here mutates all references to it, which is why we need to do some voodoo
67
export const COURSE_STRING_WITH_AND = courses
78
.slice(0, courses.length - 1)
89
.concat([`and ${courses.slice(-1)[0]}`])
910
.join(", ");
1011

12+
export const EXTENDED_COURSES_STRING_WITH_AND = extendedCourses
13+
.slice(0, extendedCourses.length - 1)
14+
.concat([`and ${extendedCourses.slice(-1)[0]}`])
15+
.join(", ");
16+
1117
export const FAQ_CONTACT = {
1218
Q: "Who can I contact if I have more questions?",
1319
A_JSX: (

src/pages/Mentors.tsx

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,44 @@ export default class Mentors extends React.Component {
1313
now < new Date(dates.applicationsClose)
1414
);
1515
}
16+
isExtendedApplicationOpen() {
17+
const now = new Date();
18+
return (
19+
now > new Date(dates.extendedApplicationsOpen) &&
20+
now < new Date(dates.extendedApplicationsClose)
21+
);
22+
}
1623

1724
render() {
25+
let section;
26+
if (this.isApplicationOpen()) {
27+
section = (
28+
<div>
29+
<h5 className="label">
30+
{Labels.SECTIONS.APPLICATIONS_OPEN.LABEL}
31+
</h5>
32+
{Labels.SECTIONS.APPLICATIONS_OPEN.BODY_JSX}
33+
</div>
34+
);
35+
} else if (this.isExtendedApplicationOpen()) {
36+
section = (
37+
<div>
38+
<h5 className="label">
39+
{Labels.SECTIONS.APPLICATIONS_EXTENDED.LABEL}
40+
</h5>
41+
{Labels.SECTIONS.APPLICATIONS_EXTENDED.BODY_JSX}
42+
</div>
43+
);
44+
} else {
45+
section = (
46+
<div>
47+
<h6 className="sublabel">
48+
{Labels.SECTIONS.APPLICATIONS_CLOSED.LABEL}
49+
</h6>
50+
</div>
51+
);
52+
}
53+
1854
return (
1955
<div>
2056
<section className="center green lighten-1 stats header">
@@ -44,20 +80,7 @@ export default class Mentors extends React.Component {
4480
<div className="divider"></div>
4581
<div className="divider"></div>
4682
<div className="section">
47-
{this.isApplicationOpen() ? (
48-
<div>
49-
<h5 className="label">
50-
{Labels.SECTIONS.APPLICATIONS_OPEN.LABEL}
51-
</h5>
52-
{Labels.SECTIONS.APPLICATIONS_OPEN.BODY_JSX}
53-
</div>
54-
) : (
55-
<div>
56-
<h6 className="sublabel">
57-
{Labels.SECTIONS.APPLICATIONS_CLOSED.LABEL}
58-
</h6>
59-
</div>
60-
)}
83+
{section}
6184
<br />
6285
</div>
6386
<div className="divider"></div>

0 commit comments

Comments
 (0)