diff --git a/src/app/components/pages/IsaacCompetition/Buttons/CompetitionButton.tsx b/src/app/components/pages/IsaacCompetition/Buttons/CompetitionButton.tsx
index f4e5d2b0da..6598bac03f 100644
--- a/src/app/components/pages/IsaacCompetition/Buttons/CompetitionButton.tsx
+++ b/src/app/components/pages/IsaacCompetition/Buttons/CompetitionButton.tsx
@@ -16,15 +16,18 @@ const CompetitionButton = ({ buttons }: CompetitionButtonProps) => {
};
const handleClick = (to: string) => {
- persistence.save(KEY.AFTER_AUTH_PATH, location.pathname);
+ if (to.startsWith("#")) {
+ document.getElementById(to.slice(1))?.scrollIntoView({ behavior: "smooth" });
+ return;
+ }
if (isExternalLink(to)) {
- // For external links, open in the new tab
window.open(to, "_blank", "noopener, noreferrer");
- } else {
- // For internal links, use React Router
- history.push(to);
+ return;
}
+
+ persistence.save(KEY.AFTER_AUTH_PATH, location.pathname);
+ history.push(to);
};
return (
diff --git a/src/app/components/pages/IsaacCompetition/EntryForm/CompetitionEntryForm.tsx b/src/app/components/pages/IsaacCompetition/EntryForm/CompetitionEntryForm.tsx
index d90e136dc8..833ccff2fc 100644
--- a/src/app/components/pages/IsaacCompetition/EntryForm/CompetitionEntryForm.tsx
+++ b/src/app/components/pages/IsaacCompetition/EntryForm/CompetitionEntryForm.tsx
@@ -262,7 +262,7 @@ export const CompetitionEntryForm = ({ handleTermsClick }: CompetitionEntryFormP
selectedGroup && selectedGroup.members !== undefined && !isLoadingMembers && selectedGroup.members.length === 0;
return (
-
+
);
-interface DefaultMessageProps {
- buttons: { to: string; label: string }[];
-}
-
-const DefaultMessage: React.FC
= ({ buttons }) => (
-
-
- {TEACHER_MESSAGE}
-
-
-
-);
-
interface EntryFormHandlerProps {
- buttons: { to: string; label: string }[];
handleTermsClick: (event: React.MouseEvent) => void;
}
-const EntryFormHandler = ({ buttons, handleTermsClick }: EntryFormHandlerProps) => {
+const EntryFormHandler = ({ handleTermsClick }: EntryFormHandlerProps) => {
const user = useAppSelector(selectors.user.orNull);
const renderEntryForm = () => {
@@ -53,9 +50,10 @@ const EntryFormHandler = ({ buttons, handleTermsClick }: EntryFormHandlerProps)
);
} else if (isStudent(user)) {
return ;
- } else {
- return ;
}
+
+ // Logged-out CTA lives in the headline (teacher copy + Submit your project)
+ return null;
};
return (
diff --git a/src/app/components/pages/IsaacCompetition/IsaacCompetition.tsx b/src/app/components/pages/IsaacCompetition/IsaacCompetition.tsx
index dc5775a9fa..72b52a71a5 100644
--- a/src/app/components/pages/IsaacCompetition/IsaacCompetition.tsx
+++ b/src/app/components/pages/IsaacCompetition/IsaacCompetition.tsx
@@ -7,10 +7,11 @@ import "../../../../scss/cs/competition.scss";
import Accordion from "./Accordion/Accordion";
import InformationCard from "./CompetitionInformation/InformationCard";
import CompetitionTimeline from "./CompetitionInformation/CompetitionTimeline";
-import EntryFormHandler, { eoiButton } from "./EntryForm/EntryFormHandler";
+import EntryFormHandler, { getHeadlineCtaButton } from "./EntryForm/EntryFormHandler";
import CompetitionButton from "./Buttons/CompetitionButton";
import CompetitionWrapper from "./CompetitionWrapper";
import { isBeforeCompetitionOpenDate, liveQandASessionDate } from "./dateUtils";
+import { selectors, useAppSelector } from "../../../state";
const { section1, section3, accordion } = content;
@@ -19,12 +20,8 @@ export const IsaacCompetition = () => {
document.title = "Isaac " + SITE_SUBJECT_TITLE;
}, []);
- const buttons = [
- {
- to: "/login",
- label: "Submit a project",
- },
- ];
+ const user = useAppSelector(selectors.user.orNull);
+ const headlineCtaButton = getHeadlineCtaButton(user);
const [open, setOpen] = useState(null);
@@ -103,8 +100,10 @@ export const IsaacCompetition = () => {
-
-
+ }
+ >
+
@@ -121,7 +120,7 @@ export const IsaacCompetition = () => {
-
+