Skip to content

Commit

Permalink
moved feedback form
Browse files Browse the repository at this point in the history
  • Loading branch information
charisgao committed Sep 29, 2023
1 parent 05a61a4 commit 247e0fb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 55 deletions.
13 changes: 0 additions & 13 deletions frontend/components/Course/CourseSidebarInstructorList.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import { Header, Icon, List, Segment } from "semantic-ui-react";
import { useMediaQuery } from "@material-ui/core";
import { useLeadership } from "../../hooks/data-fetching/course";
import { Membership } from "../../types";
import { leadershipSortFunc } from "../../utils";
import { prettifyRole } from "../../utils/enums";
import Feedback from "../common/Feedback";
import styles from "../../styles/landingpage.module.css";
import { MOBILE_BP } from "../../constants";
import Footer from "../common/Footer";

interface CourseSidebarInstructorListProps {
courseId: number;
Expand All @@ -23,7 +18,6 @@ const CourseSidebarInstructorList = ({
leadershipRaw
);
const leadership = leadershipUnsorted.sort(leadershipSortFunc);
const isMobile = useMediaQuery(`(max-width: ${MOBILE_BP})`);

return (
<>
Expand Down Expand Up @@ -54,13 +48,6 @@ const CourseSidebarInstructorList = ({
})}
</List>
</Segment>
{isMobile ? (
<Footer showFeedback />
) : (
<div role="button" className={`${styles["about-dashboard"]}`}>
<Feedback />
</div>
)}
</>
);
};
Expand Down
4 changes: 1 addition & 3 deletions frontend/components/Home/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useContext, useState, useEffect } from "react";
import { Grid, Header, Segment, Message } from "semantic-ui-react";
import Alert from "@material-ui/lab/Alert";
import Snackbar from "@material-ui/core/Snackbar";
import { useMediaQuery } from "@material-ui/core";
import InstructorCourses from "./InstructorCourses";
import StudentCourses from "./StudentCourses";
import Footer from "../../common/Footer";
Expand All @@ -13,7 +12,6 @@ import { isLeadershipRole } from "../../../utils/enums";
import {
CHANGELOG_TOKEN,
SPRING_2023_TRANSITION_MESSAGE_TOKEN,
MOBILE_BP,
} from "../../../constants";
import ModalShowNewChanges from "./Modals/ModalShowNewChanges";
import updatedMd from "../../Changelog/changelogfile.md";
Expand Down Expand Up @@ -169,7 +167,7 @@ const Dashboard = () => {
</Alert>
</Snackbar>

<Footer showFeedback={useMediaQuery(`(max-width: ${MOBILE_BP})`)} />
<Footer />
<ModalShowNewChanges openModal={logModal} setOpen={setLogModal} />
</Grid.Column>
);
Expand Down
10 changes: 0 additions & 10 deletions frontend/components/Home/HomeSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@ import { useState } from "react";

import { Segment, Menu, Grid, Image } from "semantic-ui-react";
import Link from "next/link";
import { useMediaQuery } from "@material-ui/core";

import { useRouter } from "next/router";
import SignOutButton from "../SignOut";
import styles from "../../styles/landingpage.module.css";
import AboutModal from "../common/AboutModal";
import Feedback from "../common/Feedback";
import { MOBILE_BP } from "../../constants";

const Sidebar = () => {
const router = useRouter();
const [showAboutModal, setShowAboutModal] = useState(false);
const isMobile = useMediaQuery(`(max-width: ${MOBILE_BP})`);

return (
<Grid.Column width={3}>
Expand Down Expand Up @@ -69,11 +64,6 @@ const Sidebar = () => {
<SignOutButton />
</Menu>
</Segment>
{!isMobile && (
<div role="button" className={`${styles["about-dashboard"]}`}>
<Feedback />
</div>
)}
<AboutModal
open={showAboutModal}
closeFunc={() => setShowAboutModal(false)}
Expand Down
16 changes: 0 additions & 16 deletions frontend/components/common/Feedback.tsx

This file was deleted.

24 changes: 11 additions & 13 deletions frontend/components/common/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ import { useState } from "react";
import { Container } from "semantic-ui-react";

import AboutModal from "./AboutModal";
import Feedback from "./Feedback";

interface FooterProps {
showFeedback?: boolean;
}

export default function Footer({ showFeedback }: FooterProps) {
export default function Footer() {
const [showModal, setShowModal] = useState(false);
return (
<>
Expand Down Expand Up @@ -38,14 +33,17 @@ export default function Footer({ showFeedback }: FooterProps) {
Friends
</span>{" "}
|{" "}
<Link href="/changelog">
<Link legacyBehavior href="/changelog">
<a>Changelog</a>
</Link>
{showFeedback && (
<div role="button" style={{ marginTop: "8px" }}>
<Feedback />
</div>
)}
</Link>{" "}
|{" "}
<a
href="https://airtable.com/shrIZxIjyAE3gOUSg"
target="_blank"
rel="noopener noreferrer"
>
Feedback
</a>
</Container>
<AboutModal
open={showModal}
Expand Down

0 comments on commit 247e0fb

Please sign in to comment.