Skip to content

Commit d0a3b17

Browse files
author
Ryan
committed
more updates
1 parent 67f5c98 commit d0a3b17

8 files changed

Lines changed: 25 additions & 16 deletions

File tree

frontend/components/Course/CourseSidebarNav.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +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 } from "../../utils/branding";
9+
import { LOGO_SIDEBAR_PATH, QUEUES_LABEL } from "../../utils/branding";
1010

1111
interface CourseSidebarProps {
1212
course: Course;
@@ -50,7 +50,7 @@ const CourseSidebarNav = (props: CourseSidebarProps) => {
5050
>
5151
<Menu.Item
5252
style={noWrapStyle}
53-
name="Queues"
53+
name={QUEUES_LABEL}
5454
icon="hourglass one"
5555
active={router.pathname.endsWith("[course]")}
5656
color="blue"

frontend/components/Course/InstructorQueuePage/InstructorQueuePage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +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 } from "../../../utils/branding";
12+
import { SITE_NAME, QUEUE_LABEL } from "../../../utils/branding";
1313
import {
1414
Announcement,
1515
Queue,
@@ -160,7 +160,7 @@ const InstructorQueuePage = (props: InstructorQueuePageProps) => {
160160
onClose={() => setSuccess(false)}
161161
>
162162
<Alert severity="success" onClose={() => setSuccess(false)}>
163-
<span>Queue successfully created</span>
163+
<span>{QUEUE_LABEL} successfully created</span>
164164
</Alert>
165165
</Snackbar>
166166
</Grid>

frontend/components/Course/InstructorQueuePage/Queue.tsx

Lines changed: 3 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,11 @@ 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 {queueLabel}.
186187
</Message.Header>
187188
<p>
188189
{`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.`}
190+
`per student is enforced when there are at least ${queue.rateLimitLength} student(s) in the ${queueLabel}.`}
190191
</p>
191192
</Message>
192193
</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/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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +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 } from "../../../utils/branding";
16+
import { isAprilFools, QUEUE_LABEL, queueLabel } from "../../../utils/branding";
1717
import QuestionForm from "./QuestionForm";
1818
import QuestionCard from "./QuestionCard";
1919
import { Queue, Course, Question, Tag } from "../../../types";
@@ -53,10 +53,10 @@ const MessageQuota = ({
5353
<Message color={queueLength >= rateLimitLength ? "red" : "green"}>
5454
<Message.Header>
5555
{queueLength >= rateLimitLength ? "ACTIVE:" : "INACTIVE:"} A
56-
rate-limiting quota is set on this queue.
56+
rate-limiting quota is set on this {queueLabel}.
5757
</Message.Header>
5858
<p>
59-
{`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}. ` +
6060
`When activated, the quota will allow you to ask up to ${rateLimitQuestions} question(s) per ${rateLimitMinutes} minute(s)`}
6161
{data && (
6262
<>
@@ -217,10 +217,10 @@ const StudentQueue = (props: StudentQueueProps) => {
217217
)}
218218
{!queue.active && questions.length === 0 && (
219219
<Message
220-
header="Queue Closed"
220+
header={`${QUEUE_LABEL} Closed`}
221221
error
222222
icon="calendar times outline"
223-
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.`}
224224
/>
225225
)}
226226
{queue.active &&

frontend/components/Course/StudentQueuePage/StudentQueues.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
} from "../../../types";
1313
import { QueueMenuItem } from "./QueueMenuItem";
1414
import { MOBILE_BP } from "../../../constants";
15+
import { QUEUES_LABEL, queuesLabel } from "../../../utils/branding";
1516

1617
interface StudentQueuesProps {
1718
queues: Queue[];
@@ -83,8 +84,8 @@ const StudentQueues = (props: StudentQueuesProps) => {
8384
{!currQueue && (
8485
<Grid.Column width={16}>
8586
<Message info>
86-
<Message.Header>No Queues</Message.Header>
87-
This course currently has no queues!
87+
<Message.Header>No {QUEUES_LABEL}</Message.Header>
88+
This course currently has no {queuesLabel}!
8889
</Message>
8990
</Grid.Column>
9091
)}

frontend/utils/branding.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ export const LOGO_LOGIN_PATH = isAprilFools ? "ohs-login.png" : "ohq-login.png";
1111
export const LOGO_SIDEBAR_PATH = isAprilFools
1212
? "../../../ohs.png"
1313
: "../../../ohq.png";
14+
15+
export const QUEUE_LABEL = isAprilFools ? "Stack" : "Queue";
16+
export const QUEUES_LABEL = isAprilFools ? "Stacks" : "Queues";
17+
export const queueLabel = isAprilFools ? "stack" : "queue";
18+
export const queuesLabel = isAprilFools ? "stacks" : "queues";

0 commit comments

Comments
 (0)