diff --git a/frontend/src/api/loaders/rankingsLoader.ts b/frontend/src/api/loaders/rankingsLoader.ts index 226527135..75b4fdae3 100644 --- a/frontend/src/api/loaders/rankingsLoader.ts +++ b/frontend/src/api/loaders/rankingsLoader.ts @@ -1,31 +1,16 @@ import type { QueryClient } from "@tanstack/react-query"; -import { redirect, type LoaderFunction } from "react-router-dom"; +import type { LoaderFunction } from "react-router-dom"; import { episodeInfoFactory } from "../episode/episodeFactories"; -import { buildKey, safeEnsureQueryData } from "../helpers"; +import { safeEnsureQueryData } from "../helpers"; import { searchTeamsFactory } from "../team/teamFactories"; -import type { Episode } from "api/_autogen"; -import toast from "react-hot-toast"; export const rankingsLoader = (queryClient: QueryClient): LoaderFunction => - async ({ params }) => { + ({ params }) => { const { episodeId } = params; if (episodeId === undefined) return null; - // Ensure that this page is available for the episode - const episodeData = queryClient.ensureQueryData({ - queryKey: buildKey(episodeInfoFactory.queryKey, { id: episodeId }), - queryFn: async () => await episodeInfoFactory.queryFn({ id: episodeId }), - }); - - if ((await episodeData).game_release.getTime() > Date.now()) { - toast.error( - `Rankings page not released yet for ${(await episodeData).name_long}.`, - ); - return redirect(`/${episodeId}/home`); - } - // Episode info safeEnsureQueryData({ id: episodeId }, episodeInfoFactory, queryClient); diff --git a/frontend/src/components/sidebar/index.tsx b/frontend/src/components/sidebar/index.tsx index 12beb2669..de12522d3 100644 --- a/frontend/src/components/sidebar/index.tsx +++ b/frontend/src/components/sidebar/index.tsx @@ -65,7 +65,7 @@ const COMPETE_ITEMS: SidebarItemData[] = [ iconName: "chart_bar", text: "Rankings", linkTo: "rankings", - requireGameReleased: true, + requireGameReleased: false, userAuthLevel: UserAuthLevel.LOGGED_OUT, }, { diff --git a/frontend/src/content/bc25java.ts b/frontend/src/content/bc25java.ts index 623c06dd8..d31b562bc 100644 --- a/frontend/src/content/bc25java.ts +++ b/frontend/src/content/bc25java.ts @@ -21,8 +21,8 @@ export const RESOURCES: Partial> = { Lectures: ` Battlecode 2025 Java will be holding lectures, where a dev will be going over possible strategy, coding up an example player, answering questions, etc. Lectures are streamed on Twitch. More details coming soon! -All lectures are streamed live on [our Twitch account](https://twitch.tv/mitbattlecode), and are later uploaded to [our YouTube channel](https://youtube.com/@MITBattlecode). - `, +All lectures are streamed live on [our YouTube channel](https://youtube.com/@MITBattlecode), and are later uploaded as videos. +`, }; export const DEBUGGINGTIPS: Partial> = {}; diff --git a/frontend/src/content/bc25python.ts b/frontend/src/content/bc25python.ts index c4083fb86..a3ecb5ef8 100644 --- a/frontend/src/content/bc25python.ts +++ b/frontend/src/content/bc25python.ts @@ -19,9 +19,9 @@ To participate in Battlecode, you need an account and a team. Each team can cons export const RESOURCES: Partial> = { Lectures: ` - Battlecode 2025 Python will be holding lectures, where a dev will be going over possible strategy, coding up an example player, answering questions, etc. Lectures are streamed on Twitch. More details coming soon! +Battlecode 2025 Python will be holding lectures, where a dev will be going over possible strategy, coding up an example player, answering questions, etc. Lectures are streamed on Twitch. More details coming soon! - All lectures are streamed live on [our Twitch account](https://twitch.tv/mitbattlecode), and are later uploaded to [our YouTube channel](https://youtube.com/@MITBattlecode). +All lectures are streamed live on [our YouTube channel](https://youtube.com/@MITBattlecode), and are later uploaded as videos. `, }; diff --git a/frontend/src/views/Home.tsx b/frontend/src/views/Home.tsx index b2440a9b0..f26e1bd95 100644 --- a/frontend/src/views/Home.tsx +++ b/frontend/src/views/Home.tsx @@ -11,6 +11,8 @@ import { useUserTeam } from "api/team/useTeam"; // import UserChart from "components/compete/chart/UserChart"; // import { useCurrentUser } from "contexts/CurrentUserContext"; import { isPresent } from "utils/utilTypes"; +import { dateTime } from "utils/dateTime"; +import Markdown from "components/elements/Markdown"; const Home: React.FC = () => { // const TOP_TEAMS = 10; @@ -25,6 +27,21 @@ const Home: React.FC = () => { const SOCIAL = "hover:drop-shadow-lg hover:opacity-80 transition-opacity duration-300 ease-in-out"; + // This is a temporary message until we have a working countdown :) + let WELCOME = + episode.isSuccess && isPresent(episode.data.blurb) + ? episode.data.blurb + : `Welcome!`; + + if (episode.isSuccess && episode.data.game_release.getTime() > Date.now()) { + WELCOME += "\n\n"; + WELCOME += `The competition will be launched on **${ + dateTime(episode.data.game_release).localFullString + }**.`; + WELCOME += "\n\n"; + WELCOME += `In the meantime, [create or join a team](/${episodeId}/my_team) and check out the [quick start](/${episodeId}/quick_start) page.`; + } + return (
@@ -37,11 +54,7 @@ const Home: React.FC = () => { } loading={episode.isLoading} > - - {episode.isSuccess && isPresent(episode.data.blurb) - ? episode.data.blurb - : `Welcome!`} - + @@ -82,19 +95,23 @@ const Home: React.FC = () => {
+ - +
{/* diff --git a/frontend/src/views/MyTeam.tsx b/frontend/src/views/MyTeam.tsx index eb5a4475a..f8caebe8e 100644 --- a/frontend/src/views/MyTeam.tsx +++ b/frontend/src/views/MyTeam.tsx @@ -175,13 +175,6 @@ const MyTeam: React.FC = () => { hideAllScrimmages={true} /> - - -
{/* Display the members list, file upload, and win/loss to the right when on a big screen. */}