Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions frontend/components/Auth/AuthPrompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Grid, Button } from "semantic-ui-react";
import { useRouter, NextRouter } from "next/router";
import AboutModal from "../common/AboutModal";
import styles from "../../styles/landingpage.module.css";
import { LOGO_PATH, LOGO_LOGIN_PATH } from "../../utils/branding";

const AuthPrompt = (): JSX.Element => {
const [showAboutModal, setShowAboutModal] = useState(false);
Expand All @@ -20,15 +21,15 @@ const AuthPrompt = (): JSX.Element => {
<Grid columns={1} textAlign="center">
<Grid.Row only="computer tablet">
<img
src="ohq-login.png"
src={LOGO_LOGIN_PATH}
width="600px"
height="107px"
alt="logo"
/>
</Grid.Row>
<Grid.Row only="mobile">
<img
src="ohq.png"
src={LOGO_PATH}
width="217px"
height="107px"
alt="logo-mini"
Expand Down
5 changes: 3 additions & 2 deletions frontend/components/Course/CourseSidebarNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Link from "next/link";
import { AuthUserContext } from "../../context/auth";
import { useStaff } from "../../hooks/data-fetching/course";
import { Course } from "../../types";
import { LOGO_SIDEBAR_PATH, QUEUES_LABEL } from "../../utils/branding";

interface CourseSidebarProps {
course: Course;
Expand Down Expand Up @@ -35,7 +36,7 @@ const CourseSidebarNav = (props: CourseSidebarProps) => {
<Segment basic>
<Link href="/" as="/" legacyBehavior>
<Image
src="../../../ohq.png"
src={LOGO_SIDEBAR_PATH}
size="tiny"
style={{ marginTop: "10px", cursor: "pointer" }}
/>
Expand All @@ -49,7 +50,7 @@ const CourseSidebarNav = (props: CourseSidebarProps) => {
>
<Menu.Item
style={noWrapStyle}
name="Queues"
name={QUEUES_LABEL}
icon="hourglass one"
active={router.pathname.endsWith("[course]")}
color="blue"
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/Course/CourseWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Course as CourseType, Membership } from "../../types";
import CourseSidebarInstructorList from "./CourseSidebarInstructorList";
import { MOBILE_BP } from "../../constants";
import { browserSupportsNotifications } from "../../utils/notifications";
import { isAprilFools } from "../../utils/branding";

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

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

const isAprilFirst = false;
const [notifs, setNotifs, play] = usePlayer(
isAprilFirst ? aolAudio : bellAudio
isAprilFools ? aolAudio : bellAudio
);
const [supportsNotifs, setSupportsNotifs] = useState(false);
useEffect(() => setSupportsNotifs(browserSupportsNotifications()), []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import QueueSettings from "./QueueSettings/QueueSettings";
import QueueCreate from "./QueueCreate/QueueCreate";
import { AuthUserContext } from "../../../context/auth";
import { useQueues, useStaff } from "../../../hooks/data-fetching/course";
import { SITE_NAME, QUEUE_LABEL } from "../../../utils/branding";
import {
Announcement,
Queue,
Expand Down Expand Up @@ -104,7 +105,8 @@ const InstructorQueuePage = (props: InstructorQueuePageProps) => {
{!isConnected && (
<div style={{ paddingTop: "1rem" }}>
<Message warning>
You are not currently connected to OHQ. Reconnecting...
You are not currently connected to {SITE_NAME}.
Reconnecting...
</Message>
</div>
)}
Expand Down Expand Up @@ -159,7 +161,7 @@ const InstructorQueuePage = (props: InstructorQueuePageProps) => {
onClose={() => setSuccess(false)}
>
<Alert severity="success" onClose={() => setSuccess(false)}>
<span>Queue successfully created</span>
<span>{QUEUE_LABEL} successfully created</span>
</Alert>
</Snackbar>
</Grid>
Expand Down
6 changes: 4 additions & 2 deletions frontend/components/Course/InstructorQueuePage/Queue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ClearQueueModal from "./ClearQueueModal";
import { Queue as QueueType, Question, Tag } from "../../../types";
import { useQuestions } from "../../../hooks/data-fetching/course";
import { MOBILE_BP } from "../../../constants";
import { queueLabel } from "../../../utils/branding";

interface QueueProps {
courseId: number;
Expand Down Expand Up @@ -182,11 +183,12 @@ const Queue = (props: QueueProps) => {
<Grid.Column>
<Message>
<Message.Header>
A rate-limiting quota is set on this queue.
A rate-limiting quota is set on this{" "}
{queueLabel}.
</Message.Header>
<p>
{`A quota of ${queue.rateLimitQuestions} question(s) per ${queue.rateLimitMinutes} minutes(s) ` +
`per student is enforced when there are at least ${queue.rateLimitLength} student(s) in the queue.`}
`per student is enforced when there are at least ${queue.rateLimitLength} student(s) in the ${queueLabel}.`}
</p>
</Message>
</Grid.Column>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Segment, Message } from "semantic-ui-react";
import { Question } from "../../../types";
import { getFullName } from "../../../utils";
import { QUEUE_LABEL } from "../../../utils/branding";

const LastQuestionCard = ({ question }: { question: Question }) => {
const timeString = (date) => {
Expand All @@ -21,7 +22,7 @@ const LastQuestionCard = ({ question }: { question: Question }) => {
case "NOT_SPECIFIC":
return "Not Specific";
case "WRONG_QUEUE":
return "Wrong Queue";
return `Wrong ${QUEUE_LABEL}`;
case "MISSING_TEMPLATE":
return "Didn't Follow Template";
default:
Expand Down
5 changes: 4 additions & 1 deletion frontend/components/Course/StudentQueuePage/QuestionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import EditQuestionModal from "./EditQuestionModal";
import DeleteQuestionModal from "./DeleteQuestionModal";
import { Question, Course, Queue, Tag } from "../../../types";
import { finishQuestion } from "../../../hooks/data-fetching/course";
import { isAprilFools } from "../../../utils/branding";
import LinkedText from "../../common/ui/LinkedText";

interface QuestionCardProps {
Expand Down Expand Up @@ -89,7 +90,9 @@ const QuestionCard = (props: QuestionCardProps) => {
}}
>
{question.position !== -1 &&
`Position in Queue: #${question.position}`}
`Position in ${
isAprilFools ? "Stack" : "Queue"
}: #${question.position}`}
</Header>
</Grid.Column>
<Grid.Column width={6}>
Expand Down
5 changes: 3 additions & 2 deletions frontend/components/Course/StudentQueuePage/QuestionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { isValidVideoChatURL } from "../../../utils";
import { createQuestion } from "../../../hooks/data-fetching/course";
import { Question, Queue, Tag, VideoChatSetting } from "../../../types";
import { STUD_DESC_CHAR_LIMIT, TEXT_CHAR_LIMIT } from "../../../constants";
import { queueLabel } from "../../../utils/branding";

interface QuestionFormProps {
courseId: number;
Expand Down Expand Up @@ -90,15 +91,15 @@ const QuestionForm = (props: QuestionFormProps) => {
let message: string;
if (status) {
if (status === 429) {
message = "Exceeded question quota for queue";
message = `Exceeded question quota for ${queueLabel}`;
} else if (status === 409) {
message = "Incorrect pin";
} else {
message = "Unable to create question";
}
props.toastFunc(null, message);
} else {
message = "Question successfully added to queue";
message = `Question successfully added to ${queueLabel}`;
props.toastFunc(message, null);
await props.queueMutate(-1, null);
}
Expand Down
11 changes: 6 additions & 5 deletions frontend/components/Course/StudentQueuePage/StudentQueue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import Snackbar from "@material-ui/core/Snackbar";
import Alert from "@material-ui/lab/Alert";
import { mutateResourceListFunction } from "@pennlabs/rest-hooks/dist/types";
import { isAprilFools, QUEUE_LABEL, queueLabel } from "../../../utils/branding";
import QuestionForm from "./QuestionForm";
import QuestionCard from "./QuestionCard";
import { Queue, Course, Question, Tag } from "../../../types";
Expand Down Expand Up @@ -52,10 +53,10 @@ const MessageQuota = ({
<Message color={queueLength >= rateLimitLength ? "red" : "green"}>
<Message.Header>
{queueLength >= rateLimitLength ? "ACTIVE:" : "INACTIVE:"} A
rate-limiting quota is set on this queue.
rate-limiting quota is set on this {queueLabel}.
</Message.Header>
<p>
{`The quota will activate when there are at least ${rateLimitLength} student(s) in the queue. ` +
{`The quota will activate when there are at least ${rateLimitLength} student(s) in the ${queueLabel}. ` +
`When activated, the quota will allow you to ask up to ${rateLimitQuestions} question(s) per ${rateLimitMinutes} minute(s)`}
{data && (
<>
Expand Down Expand Up @@ -143,7 +144,7 @@ const StudentQueue = (props: StudentQueueProps) => {
queue.questionsAsked || 0
} user${
queue.questionsAsked === 1 ? "" : "s"
} in queue`}
} in ${isAprilFools ? "stack" : "queue"}`}
color="blue"
icon="users"
/>
Expand Down Expand Up @@ -216,10 +217,10 @@ const StudentQueue = (props: StudentQueueProps) => {
)}
{!queue.active && questions.length === 0 && (
<Message
header="Queue Closed"
header={`${QUEUE_LABEL} Closed`}
error
icon="calendar times outline"
content="This queue is currently closed. Contact course staff if you think this is an error."
content={`This ${queueLabel} is currently closed. Contact course staff if you think this is an error.`}
/>
)}
{queue.active &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Grid, Message } from "semantic-ui-react";
import { WSContext } from "@pennlabs/rest-live-hooks";
import StudentQueues from "./StudentQueues";
import Announcements from "../Announcements";
import { SITE_NAME } from "../../../utils/branding";

import {
useQueues,
Expand Down Expand Up @@ -46,7 +47,8 @@ const StudentQueuePage = (props: StudentQueuePageProps) => {
{!isConnected && (
<div style={{ paddingTop: "1rem" }}>
<Message warning>
You are not currently connected to OHQ. Reconnecting...
You are not currently connected to {SITE_NAME}.
Reconnecting...
</Message>
</div>
)}
Expand Down
5 changes: 3 additions & 2 deletions frontend/components/Course/StudentQueuePage/StudentQueues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
} from "../../../types";
import { QueueMenuItem } from "./QueueMenuItem";
import { MOBILE_BP } from "../../../constants";
import { QUEUES_LABEL, queuesLabel } from "../../../utils/branding";

interface StudentQueuesProps {
queues: Queue[];
Expand Down Expand Up @@ -83,8 +84,8 @@ const StudentQueues = (props: StudentQueuesProps) => {
{!currQueue && (
<Grid.Column width={16}>
<Message info>
<Message.Header>No Queues</Message.Header>
This course currently has no queues!
<Message.Header>No {QUEUES_LABEL}</Message.Header>
This course currently has no {queuesLabel}!
</Message>
</Grid.Column>
)}
Expand Down
34 changes: 18 additions & 16 deletions frontend/components/Guide/InstructorGuideContent.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { Segment, Divider, List } from "semantic-ui-react";

import { CenteredImage } from "./utils";
import { SITE_NAME } from "../../utils/branding";

export const CreateCourse = ({ ref }) => (
<div ref={ref}>
<Segment basic>
<h3>Create Your Course</h3>
<Divider />
<p>
Once you log in to OHQ, click &apos;Dashboard&apos; on the left,
and then &apos;Create Course&apos; under &apos;Instructor
Courses&apos;. If you do not see this option, please email
contact@ohq.io.
Once you log in to {SITE_NAME}, click &apos;Dashboard&apos; on
the left, and then &apos;Create Course&apos; under
&apos;Instructor Courses&apos;. If you do not see this option,
please email contact@ohq.io.
</p>
<CenteredImage src="/create-course-1.png" alt="Creating a course" />
<br />
Expand All @@ -21,18 +22,19 @@ export const CreateCourse = ({ ref }) => (
creating the course.
</p>
<p>
OHQ currently supports Zoom, BlueJeans, Google Meet, and Whereby
meetings links. Please email us at contact@ohq.io to request
additional link support.
{SITE_NAME} currently supports Zoom, BlueJeans, Google Meet, and
Whereby meetings links. Please email us at contact@ohq.io to
request additional link support.
</p>
<CenteredImage
src="/create-course-2.png"
alt="Creating a course popup"
/>
<br />
<p>
And that&apos;s it! You&apos;ve created your course on OHQ, and
you&apos;re ready to add students and instructors to the course.
And that&apos;s it! You&apos;ve created your course on{" "}
{SITE_NAME}, and you&apos;re ready to add students and
instructors to the course.
</p>
</Segment>
</div>
Expand Down Expand Up @@ -66,8 +68,8 @@ export const InviteMembers = ({ ref }) => (
with a Pennkey! For example:
<b>agutmann@upenn.edu</b>. Students or
instructors with alternative email address
formats will not be able to log in to OHQ.
🚨
formats will not be able to log in to{" "}
{SITE_NAME}. 🚨
</List.Item>
</List.List>
</List.Item>
Expand Down Expand Up @@ -269,9 +271,9 @@ export const Analytics = ({ ref }) => (
<h3>Analytics</h3>
<Divider />
<p>
As an instructor, you can use OHQ&apos;s analytics to learn what
your students are asking and assess how you&apos;re performing
in office hours.
As an instructor, you can use {SITE_NAME}&apos;s analytics to
learn what your students are asking and assess how you&apos;re
performing in office hours.
</p>
<p>
As a head TA or professor, analytics can help you predict demand
Expand Down Expand Up @@ -301,8 +303,8 @@ export const Settings = ({ ref }) => (
click &apos;Course Settings&apos; in the left menu.
</p>
<p>
To change your account settings, go to the OHQ landing page and
click &apos;Account Settings&apos; in the left menu.
To change your account settings, go to the {SITE_NAME} landing
page and click &apos;Account Settings&apos; in the left menu.
</p>
</Segment>
</div>
Expand Down
20 changes: 12 additions & 8 deletions frontend/components/Guide/StudentGuideContent.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { Segment, List } from "semantic-ui-react";

import { CenteredImage } from "./utils";
import { SITE_NAME } from "../../utils/branding";

export const EnrollCourse = ({ ref }) => (
<div ref={ref}>
<Segment basic>
<h3>Enrolling in a Course</h3>
<p>Courses on OHQ are either invite-only or not invite-only.</p>
<p>
Courses on {SITE_NAME} are either invite-only or not
invite-only.
</p>
<p>
If your course is invite-only, reach out to your course&apos;s
teaching team to request an invitation. All they need to invite
Expand Down Expand Up @@ -81,15 +85,15 @@ export const Notifications = ({ ref }) => (
enabling notifications when you reach the top of the line!
</p>
<p>
OHQ will give you an audio notification ( you&apos;ll hear a
&quot;ding&quot;) when you reach the top of the queue. You can
also enable SMS notifications.
{SITE_NAME} will give you an audio notification ( you&apos;ll
hear a &quot;ding&quot;) when you reach the top of the queue.
You can also enable SMS notifications.
</p>
<p>To enable SMS notifications:</p>
<List bulleted>
<List.Item>
Navigate to the OHQ home page, and on the left menu, click
into &quot;Account Settings.&quot;
Navigate to the {SITE_NAME} home page, and on the left menu,
click into &quot;Account Settings.&quot;
</List.Item>
<List.Item>
Check the &quot;Enable SMS Notifications&quot; box, fill in
Expand Down Expand Up @@ -181,8 +185,8 @@ export const Settings = ({ ref }) => (
<h3>Settings</h3>
<p>
To change your profile information and notification settings, go
to the OHQ landing page and click &apos;Account Setting&apos; in
the left menu.
to the {SITE_NAME} landing page and click &apos;Account
Setting&apos; in the left menu.
</p>
</Segment>
</div>
Expand Down
Loading
Loading