Skip to content

Commit

Permalink
Revert "feat(temporary banners) (#517)"
Browse files Browse the repository at this point in the history
This reverts commit 2f51e07.
  • Loading branch information
andyjiang3 authored Oct 16, 2023
1 parent 2f51e07 commit c354872
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 485 deletions.
16 changes: 1 addition & 15 deletions frontend/alert/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from "react";
import * as Sentry from "@sentry/browser";
import { createGlobalStyle } from "styled-components";
import Head from "next/head";
import { Announcement } from "pcx-shared-components/src/common/Announcement";
import Head from 'next/head'

Sentry.init({
dsn: "https://[email protected]/16",
Expand Down Expand Up @@ -32,19 +31,6 @@ function App({ Component, pageProps }) {
</Head>
<GlobalStyles />
<Component {...pageProps} />

<div
style={{
position: "fixed",
top: 0,
left: 0,
right: 0,
padding: 20,
zIndex: 1000,
}}
>
<Announcement type="issue" title="Weekend Maintenance Alert" />
</div>
</>
);
}
Expand Down
8 changes: 4 additions & 4 deletions frontend/alert/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ function App() {

// update on router value updates as it fires multiple times, starting with null.
useEffect(() => {
// change page based on url route query.
setPage(router.query.route ? (router.query.route as string) : "home");
}, [router.query.route]);
// change page based on url route query.
setPage(router.query.route ? router.query.route as string : "home");
}, [router.query.route])

useEffect(() => {
ReactGA.initialize("UA-21029575-12");
Expand Down Expand Up @@ -270,7 +270,7 @@ function App() {
) : null}
</Flex>
) : (
<ManageAlertWrapper sendError={sendError} />
<ManageAlertWrapper sendError={sendError}/>
)}

<Timeline courseCode={timeline} setTimeline={setTimeline} />
Expand Down
19 changes: 1 addition & 18 deletions frontend/plan/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,14 @@ import "rc-slider/assets/index.css";
import "../styles/App.css";
import * as Sentry from "@sentry/browser";
import type { AppProps } from "next/app";
import { Announcement } from "pcx-shared-components/src/common/Announcement";

Sentry.init({
dsn: "https://[email protected]/17",
});

// eslint-disable-next-line
function App({ Component, pageProps }: AppProps) {
return (
<>
<Component {...pageProps} />
<div
style={{
position: "fixed",
top: 0,
left: 0,
right: 0,
padding: 20,
zIndex: 1000,
}}
>
<Announcement type="issue" title="Weekend Maintenance Alert" />
</div>
</>
);
return <Component {...pageProps} />;
}

export default App;
206 changes: 0 additions & 206 deletions frontend/review/src/components/Announcement.js

This file was deleted.

43 changes: 14 additions & 29 deletions frontend/review/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
ReviewPage
} from "./pages";
import { GoogleAnalytics } from "./components/common";
import { Announcement } from "./components/Announcement";

if (window.location.hostname !== "localhost") {
window.Raven.config(
Expand All @@ -22,33 +21,19 @@ if (window.location.hostname !== "localhost") {
}

ReactDOM.render(
<>
<Router>
<Switch>
<Route exact path="/" component={ReviewPage} />
<Route exact path="/about" component={AboutPage} />
<Route exact path="/faq" component={FAQPage} />
<Route exact path="/cart" component={CartPage} />
<Route
path="/:type(course|department|instructor)/:code"
component={AuthPage}
/>
<Route component={ErrorPage} />
</Switch>
<GoogleAnalytics />
</Router>
<div
style={{
position: "fixed",
top: 0,
left: 0,
right: 0,
padding: 20,
zIndex: 1000
}}
>
<Announcement type="issue" title="Weekend Maintenance Alert" />
</div>
</>,
<Router>
<Switch>
<Route exact path="/" component={ReviewPage} />
<Route exact path="/about" component={AboutPage} />
<Route exact path="/faq" component={FAQPage} />
<Route exact path="/cart" component={CartPage} />
<Route
path="/:type(course|department|instructor)/:code"
component={AuthPage}
/>
<Route component={ErrorPage} />
</Switch>
<GoogleAnalytics />
</Router>,
document.getElementById("root")
);
Loading

0 comments on commit c354872

Please sign in to comment.