Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "feat(temporary banners)" #518

Merged
merged 1 commit into from
Oct 16, 2023
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
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
Loading