Skip to content

Commit

Permalink
fix: duplicate isExamboardSlug to fix bundle size issue
Browse files Browse the repository at this point in the history
  • Loading branch information
orangemug committed Nov 28, 2024
1 parent 0ec4a20 commit d757feb
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ import {
} from "@oaknational/oak-components";
import { sortBy } from "lodash";
import { flushSync } from "react-dom";
import {
examboardSlugs,
ProgrammeFields,
} from "@oaknational/oak-curriculum-schema";

import OwaLink from "@/components/SharedComponents/OwaLink";
import Box from "@/components/SharedComponents/Box";
import BoxBorders from "@/components/SharedComponents/SpriteSheet/BrushSvgs/BoxBorders/BoxBorders";
import Flex from "@/components/SharedComponents/Flex.deprecated";
import {
import type {
KS4Option,
Phase,
Subject,
Expand All @@ -28,7 +32,6 @@ import {
import Icon from "@/components/SharedComponents/Icon";
import useAnalytics from "@/context/Analytics/useAnalytics";
import useAnalyticsPageProps from "@/hooks/useAnalyticsPageProps";
import { isExamboardSlug } from "@/pages-helpers/pupil/options-pages/options-pages-helpers";
import FocusIndicator from "@/components/CurriculumComponents/OakComponentsKitchen/FocusIndicator";
import { getPhaseText } from "@/utils/curriculum/formatting";
import { getValidSubjectIconName } from "@/utils/getValidSubjectIconName";
Expand All @@ -37,7 +40,13 @@ import { Hr } from "@/components/SharedComponents/Typography";
import Button from "@/components/SharedComponents/Button";
import { CurriculumModalCloseButton } from "@/components/CurriculumComponents/CurriculumModalCloseButton/CurriculumModalCloseButton";
import useMediaQuery from "@/hooks/useMediaQuery";
import { CurriculumTab } from "@/pages-helpers/curriculum/docx/tab-helpers";
import type { CurriculumTab } from "@/pages-helpers/curriculum/docx/tab-helpers";

// FIXME: This is from <@/pages-helpers/pupil/options-pages/options-pages-helpers> being duplicated here to fix bundle issues.
const isExamboardSlug = (
examboardSlug: ProgrammeFields["examboard_slug"] | string | null,
): examboardSlug is ProgrammeFields["examboard_slug"] =>
Object.keys(examboardSlugs.Values).includes(examboardSlug ?? "");

const DEFAULT_KEYSTAGES = [
{ slug: "ks1" },
Expand Down

0 comments on commit d757feb

Please sign in to comment.