From 6c9caa057682b1813bd639822a6f6d19f60d3852 Mon Sep 17 00:00:00 2001 From: Jon Kafton <939376+jonkafton@users.noreply.github.com> Date: Fri, 20 Dec 2024 18:55:21 +0100 Subject: [PATCH] Disable about page prefetching --- .../main/src/app-pages/AboutPage/AboutPage.tsx | 14 ++++---------- frontends/main/src/common/urls.ts | 1 + .../src/page-components/HeroSearch/HeroSearch.tsx | 5 +++-- .../ol-components/src/components/Link/Link.tsx | 1 + 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/frontends/main/src/app-pages/AboutPage/AboutPage.tsx b/frontends/main/src/app-pages/AboutPage/AboutPage.tsx index 0b011cc018..292a146ebc 100644 --- a/frontends/main/src/app-pages/AboutPage/AboutPage.tsx +++ b/frontends/main/src/app-pages/AboutPage/AboutPage.tsx @@ -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 @@ -116,7 +115,7 @@ const AboutPage: React.FC = () => { @@ -206,7 +205,7 @@ const AboutPage: React.FC = () => { What is non-degree learning at MIT? @@ -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 } diff --git a/frontends/main/src/common/urls.ts b/frontends/main/src/common/urls.ts index 0493f9d4db..8f732c95a2 100644 --- a/frontends/main/src/common/urls.ts +++ b/frontends/main/src/common/urls.ts @@ -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/" diff --git a/frontends/main/src/page-components/HeroSearch/HeroSearch.tsx b/frontends/main/src/page-components/HeroSearch/HeroSearch.tsx index 39a5bd685b..f3c7fdd822 100644 --- a/frontends/main/src/page-components/HeroSearch/HeroSearch.tsx +++ b/frontends/main/src/page-components/HeroSearch/HeroSearch.tsx @@ -17,6 +17,7 @@ import { SEARCH_NEW, SEARCH_POPULAR, SEARCH_UPCOMING, + ABOUT_NON_DEGREE_LEARNING_FRAGMENT, } from "@/common/urls" import { RiAwardLine, @@ -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" @@ -221,7 +221,8 @@ const HeroSearch: React.FC<{ imageIndex: number }> = ({ imageIndex }) => { Explore MIT's{" "} Non-Degree Learning diff --git a/frontends/ol-components/src/components/Link/Link.tsx b/frontends/ol-components/src/components/Link/Link.tsx index 6c317319dd..788a48684f 100644 --- a/frontends/ol-components/src/components/Link/Link.tsx +++ b/frontends/ol-components/src/components/Link/Link.tsx @@ -72,6 +72,7 @@ type LinkProps = LinkStyleProps & */ shallow?: boolean scroll?: boolean + prefetch?: boolean } const BaseLink = ({