Skip to content

Commit

Permalink
Disable about page prefetching
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkafton committed Jan 3, 2025
1 parent cc0be65 commit 6c9caa0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
14 changes: 4 additions & 10 deletions frontends/main/src/app-pages/AboutPage/AboutPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import {
theme,
styled,
} from "ol-components"
import * as urls from "@/common/urls"
import { HOME, ABOUT_NON_DEGREE_LEARNING_FRAGMENT } from "@/common/urls"
import React from "react"
import domeImage from "@/public/mit-dome-2.jpg"
import Image from "next/image"

const WHAT_IS_MIT_OPEN_FRAGMENT_IDENTIFIER = "what-is-mit-learn"
const NON_DEGREE_LEARNING_FRAGMENT_IDENTIFIER = "non-degree-learning"
const ACADEMIC_AND_PROFESSIONAL_CONTENT = "kinds-of-content"

const SITE_NAME = process.env.NEXT_PUBLIC_SITE_NAME
Expand Down Expand Up @@ -116,7 +115,7 @@ const AboutPage: React.FC = () => {
<BannerContainerInner>
<Breadcrumbs
variant="light"
ancestors={[{ href: urls.HOME, label: "Home" }]}
ancestors={[{ href: HOME, label: "Home" }]}
current="About Us"
/>
<Typography variant="h3" component="h1">
Expand Down Expand Up @@ -206,7 +205,7 @@ const AboutPage: React.FC = () => {
<Typography
variant="h4"
component="h2"
id={NON_DEGREE_LEARNING_FRAGMENT_IDENTIFIER}
id={ABOUT_NON_DEGREE_LEARNING_FRAGMENT}
>
What is non-degree learning at MIT?
</Typography>
Expand Down Expand Up @@ -257,9 +256,4 @@ const AboutPage: React.FC = () => {
)
}

export {
AboutPage,
WHAT_IS_MIT_OPEN_FRAGMENT_IDENTIFIER,
NON_DEGREE_LEARNING_FRAGMENT_IDENTIFIER,
ACADEMIC_AND_PROFESSIONAL_CONTENT as WHAT_KINDS_OF_CONTENT_FRAGMENT_IDENTIFIER,
}
export { AboutPage }
1 change: 1 addition & 0 deletions frontends/main/src/common/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export const SETTINGS = "/dashboard/settings"
export const SEARCH = "/search"

export const ABOUT = "/about"
export const ABOUT_NON_DEGREE_LEARNING_FRAGMENT = "non-degree-learning"

export const ACCESSIBILITY = "https://accessibility.mit.edu/"

Expand Down
5 changes: 3 additions & 2 deletions frontends/main/src/page-components/HeroSearch/HeroSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
SEARCH_NEW,
SEARCH_POPULAR,
SEARCH_UPCOMING,
ABOUT_NON_DEGREE_LEARNING_FRAGMENT,
} from "@/common/urls"
import {
RiAwardLine,
Expand All @@ -26,7 +27,6 @@ import {
RiTimeLine,
RiVerifiedBadgeLine,
} from "@remixicon/react"
import { NON_DEGREE_LEARNING_FRAGMENT_IDENTIFIER } from "@/app-pages/AboutPage/AboutPage"
import Image from "next/image"
import { SearchField } from "@/page-components/SearchField/SearchField"

Expand Down Expand Up @@ -221,7 +221,8 @@ const HeroSearch: React.FC<{ imageIndex: number }> = ({ imageIndex }) => {
<Typography>
Explore MIT's{" "}
<BoldLink
href={`${ABOUT}#${NON_DEGREE_LEARNING_FRAGMENT_IDENTIFIER}`}
href={`${ABOUT}#${ABOUT_NON_DEGREE_LEARNING_FRAGMENT}`}
prefetch={false}
>
Non-Degree Learning
</BoldLink>
Expand Down
1 change: 1 addition & 0 deletions frontends/ol-components/src/components/Link/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ type LinkProps = LinkStyleProps &
*/
shallow?: boolean
scroll?: boolean
prefetch?: boolean
}

const BaseLink = ({
Expand Down

0 comments on commit 6c9caa0

Please sign in to comment.