Skip to content

Commit f783fbd

Browse files
authored
Merge pull request #340 from pennlabs/rt/april-fools
april fools
2 parents bda16dd + 0ccf297 commit f783fbd

32 files changed

Lines changed: 123 additions & 69 deletions

frontend/components/Auth/AuthPrompt.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Grid, Button } from "semantic-ui-react";
33
import { useRouter, NextRouter } from "next/router";
44
import AboutModal from "../common/AboutModal";
55
import styles from "../../styles/landingpage.module.css";
6+
import { LOGO_PATH, LOGO_LOGIN_PATH } from "../../utils/branding";
67

78
const AuthPrompt = (): JSX.Element => {
89
const [showAboutModal, setShowAboutModal] = useState(false);
@@ -20,15 +21,15 @@ const AuthPrompt = (): JSX.Element => {
2021
<Grid columns={1} textAlign="center">
2122
<Grid.Row only="computer tablet">
2223
<img
23-
src="ohq-login.png"
24+
src={LOGO_LOGIN_PATH}
2425
width="600px"
2526
height="107px"
2627
alt="logo"
2728
/>
2829
</Grid.Row>
2930
<Grid.Row only="mobile">
3031
<img
31-
src="ohq.png"
32+
src={LOGO_PATH}
3233
width="217px"
3334
height="107px"
3435
alt="logo-mini"

frontend/components/Course/CourseSidebarNav.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Link from "next/link";
66
import { AuthUserContext } from "../../context/auth";
77
import { useStaff } from "../../hooks/data-fetching/course";
88
import { Course } from "../../types";
9+
import { LOGO_SIDEBAR_PATH, QUEUES_LABEL } from "../../utils/branding";
910

1011
interface CourseSidebarProps {
1112
course: Course;
@@ -35,7 +36,7 @@ const CourseSidebarNav = (props: CourseSidebarProps) => {
3536
<Segment basic>
3637
<Link href="/" as="/" legacyBehavior>
3738
<Image
38-
src="../../../ohq.png"
39+
src={LOGO_SIDEBAR_PATH}
3940
size="tiny"
4041
style={{ marginTop: "10px", cursor: "pointer" }}
4142
/>
@@ -49,7 +50,7 @@ const CourseSidebarNav = (props: CourseSidebarProps) => {
4950
>
5051
<Menu.Item
5152
style={noWrapStyle}
52-
name="Queues"
53+
name={QUEUES_LABEL}
5354
icon="hourglass one"
5455
active={router.pathname.endsWith("[course]")}
5556
color="blue"

frontend/components/Course/CourseWrapper.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { Course as CourseType, Membership } from "../../types";
1313
import CourseSidebarInstructorList from "./CourseSidebarInstructorList";
1414
import { MOBILE_BP } from "../../constants";
1515
import { browserSupportsNotifications } from "../../utils/notifications";
16+
import { isAprilFools } from "../../utils/branding";
1617

1718
interface CourseProps {
1819
render: (
@@ -38,9 +39,8 @@ const CourseWrapper = ({ render, ...props }: CourseProps) => {
3839

3940
const { staff } = useStaff(rawCourse.id, initialUser);
4041

41-
const isAprilFirst = false;
4242
const [notifs, setNotifs, play] = usePlayer(
43-
isAprilFirst ? aolAudio : bellAudio
43+
isAprilFools ? aolAudio : bellAudio
4444
);
4545
const [supportsNotifs, setSupportsNotifs] = useState(false);
4646
useEffect(() => setSupportsNotifs(browserSupportsNotifications()), []);

frontend/components/Course/InstructorQueuePage/InstructorQueuePage.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import QueueSettings from "./QueueSettings/QueueSettings";
99
import QueueCreate from "./QueueCreate/QueueCreate";
1010
import { AuthUserContext } from "../../../context/auth";
1111
import { useQueues, useStaff } from "../../../hooks/data-fetching/course";
12+
import { SITE_NAME, QUEUE_LABEL } from "../../../utils/branding";
1213
import {
1314
Announcement,
1415
Queue,
@@ -104,7 +105,8 @@ const InstructorQueuePage = (props: InstructorQueuePageProps) => {
104105
{!isConnected && (
105106
<div style={{ paddingTop: "1rem" }}>
106107
<Message warning>
107-
You are not currently connected to OHQ. Reconnecting...
108+
You are not currently connected to {SITE_NAME}.
109+
Reconnecting...
108110
</Message>
109111
</div>
110112
)}
@@ -159,7 +161,7 @@ const InstructorQueuePage = (props: InstructorQueuePageProps) => {
159161
onClose={() => setSuccess(false)}
160162
>
161163
<Alert severity="success" onClose={() => setSuccess(false)}>
162-
<span>Queue successfully created</span>
164+
<span>{QUEUE_LABEL} successfully created</span>
163165
</Alert>
164166
</Snackbar>
165167
</Grid>

frontend/components/Course/InstructorQueuePage/Queue.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import ClearQueueModal from "./ClearQueueModal";
99
import { Queue as QueueType, Question, Tag } from "../../../types";
1010
import { useQuestions } from "../../../hooks/data-fetching/course";
1111
import { MOBILE_BP } from "../../../constants";
12+
import { queueLabel } from "../../../utils/branding";
1213

1314
interface QueueProps {
1415
courseId: number;
@@ -182,11 +183,12 @@ const Queue = (props: QueueProps) => {
182183
<Grid.Column>
183184
<Message>
184185
<Message.Header>
185-
A rate-limiting quota is set on this queue.
186+
A rate-limiting quota is set on this{" "}
187+
{queueLabel}.
186188
</Message.Header>
187189
<p>
188190
{`A quota of ${queue.rateLimitQuestions} question(s) per ${queue.rateLimitMinutes} minutes(s) ` +
189-
`per student is enforced when there are at least ${queue.rateLimitLength} student(s) in the queue.`}
191+
`per student is enforced when there are at least ${queue.rateLimitLength} student(s) in the ${queueLabel}.`}
190192
</p>
191193
</Message>
192194
</Grid.Column>

frontend/components/Course/StudentQueuePage/LastQuestionCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Segment, Message } from "semantic-ui-react";
22
import { Question } from "../../../types";
33
import { getFullName } from "../../../utils";
4+
import { QUEUE_LABEL } from "../../../utils/branding";
45

56
const LastQuestionCard = ({ question }: { question: Question }) => {
67
const timeString = (date) => {
@@ -21,7 +22,7 @@ const LastQuestionCard = ({ question }: { question: Question }) => {
2122
case "NOT_SPECIFIC":
2223
return "Not Specific";
2324
case "WRONG_QUEUE":
24-
return "Wrong Queue";
25+
return `Wrong ${QUEUE_LABEL}`;
2526
case "MISSING_TEMPLATE":
2627
return "Didn't Follow Template";
2728
default:

frontend/components/Course/StudentQueuePage/QuestionCard.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import EditQuestionModal from "./EditQuestionModal";
1313
import DeleteQuestionModal from "./DeleteQuestionModal";
1414
import { Question, Course, Queue, Tag } from "../../../types";
1515
import { finishQuestion } from "../../../hooks/data-fetching/course";
16+
import { isAprilFools } from "../../../utils/branding";
1617
import LinkedText from "../../common/ui/LinkedText";
1718

1819
interface QuestionCardProps {
@@ -89,7 +90,9 @@ const QuestionCard = (props: QuestionCardProps) => {
8990
}}
9091
>
9192
{question.position !== -1 &&
92-
`Position in Queue: #${question.position}`}
93+
`Position in ${
94+
isAprilFools ? "Stack" : "Queue"
95+
}: #${question.position}`}
9396
</Header>
9497
</Grid.Column>
9598
<Grid.Column width={6}>

frontend/components/Course/StudentQueuePage/QuestionForm.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { isValidVideoChatURL } from "../../../utils";
66
import { createQuestion } from "../../../hooks/data-fetching/course";
77
import { Question, Queue, Tag, VideoChatSetting } from "../../../types";
88
import { STUD_DESC_CHAR_LIMIT, TEXT_CHAR_LIMIT } from "../../../constants";
9+
import { queueLabel } from "../../../utils/branding";
910

1011
interface QuestionFormProps {
1112
courseId: number;
@@ -90,15 +91,15 @@ const QuestionForm = (props: QuestionFormProps) => {
9091
let message: string;
9192
if (status) {
9293
if (status === 429) {
93-
message = "Exceeded question quota for queue";
94+
message = `Exceeded question quota for ${queueLabel}`;
9495
} else if (status === 409) {
9596
message = "Incorrect pin";
9697
} else {
9798
message = "Unable to create question";
9899
}
99100
props.toastFunc(null, message);
100101
} else {
101-
message = "Question successfully added to queue";
102+
message = `Question successfully added to ${queueLabel}`;
102103
props.toastFunc(message, null);
103104
await props.queueMutate(-1, null);
104105
}

frontend/components/Course/StudentQueuePage/StudentQueue.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
import Snackbar from "@material-ui/core/Snackbar";
1414
import Alert from "@material-ui/lab/Alert";
1515
import { mutateResourceListFunction } from "@pennlabs/rest-hooks/dist/types";
16+
import { isAprilFools, QUEUE_LABEL, queueLabel } from "../../../utils/branding";
1617
import QuestionForm from "./QuestionForm";
1718
import QuestionCard from "./QuestionCard";
1819
import { Queue, Course, Question, Tag } from "../../../types";
@@ -52,10 +53,10 @@ const MessageQuota = ({
5253
<Message color={queueLength >= rateLimitLength ? "red" : "green"}>
5354
<Message.Header>
5455
{queueLength >= rateLimitLength ? "ACTIVE:" : "INACTIVE:"} A
55-
rate-limiting quota is set on this queue.
56+
rate-limiting quota is set on this {queueLabel}.
5657
</Message.Header>
5758
<p>
58-
{`The quota will activate when there are at least ${rateLimitLength} student(s) in the queue. ` +
59+
{`The quota will activate when there are at least ${rateLimitLength} student(s) in the ${queueLabel}. ` +
5960
`When activated, the quota will allow you to ask up to ${rateLimitQuestions} question(s) per ${rateLimitMinutes} minute(s)`}
6061
{data && (
6162
<>
@@ -143,7 +144,7 @@ const StudentQueue = (props: StudentQueueProps) => {
143144
queue.questionsAsked || 0
144145
} user${
145146
queue.questionsAsked === 1 ? "" : "s"
146-
} in queue`}
147+
} in ${isAprilFools ? "stack" : "queue"}`}
147148
color="blue"
148149
icon="users"
149150
/>
@@ -216,10 +217,10 @@ const StudentQueue = (props: StudentQueueProps) => {
216217
)}
217218
{!queue.active && questions.length === 0 && (
218219
<Message
219-
header="Queue Closed"
220+
header={`${QUEUE_LABEL} Closed`}
220221
error
221222
icon="calendar times outline"
222-
content="This queue is currently closed. Contact course staff if you think this is an error."
223+
content={`This ${queueLabel} is currently closed. Contact course staff if you think this is an error.`}
223224
/>
224225
)}
225226
{queue.active &&

frontend/components/Course/StudentQueuePage/StudentQueuePage.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Grid, Message } from "semantic-ui-react";
33
import { WSContext } from "@pennlabs/rest-live-hooks";
44
import StudentQueues from "./StudentQueues";
55
import Announcements from "../Announcements";
6+
import { SITE_NAME } from "../../../utils/branding";
67

78
import {
89
useQueues,
@@ -46,7 +47,8 @@ const StudentQueuePage = (props: StudentQueuePageProps) => {
4647
{!isConnected && (
4748
<div style={{ paddingTop: "1rem" }}>
4849
<Message warning>
49-
You are not currently connected to OHQ. Reconnecting...
50+
You are not currently connected to {SITE_NAME}.
51+
Reconnecting...
5052
</Message>
5153
</div>
5254
)}

0 commit comments

Comments
 (0)