diff --git a/src/components/jam-header/index.tsx b/src/components/jam-header/index.tsx index 478ebe2..db20660 100644 --- a/src/components/jam-header/index.tsx +++ b/src/components/jam-header/index.tsx @@ -111,11 +111,10 @@ export default function JamHeader() { </div> </div> - {/* Phase-Specific Display */} {activeJamResponse?.phase === "Suggestion" && ( <div className="bg-gray-100 dark:bg-gray-800 p-4 text-center rounded-b-2x"> <a - // href="/theme-suggestions" + href="/theme-suggestions" className="text-blue-300 dark:text-blue-500 hover:underline font-semibold" > Go to Theme Suggestion @@ -126,7 +125,7 @@ export default function JamHeader() { {activeJamResponse?.phase === "Survival" && ( <div className="bg-gray-100 dark:bg-gray-800 p-4 text-center rounded-b-2x"> <a - // href="/theme-slaughter" + href="/theme-slaughter" className="text-blue-300 dark:text-blue-500 hover:underline font-semibold" > Go to Theme Survival @@ -137,7 +136,7 @@ export default function JamHeader() { {activeJamResponse?.phase === "Voting" && ( <div className="bg-gray-100 dark:bg-gray-800 p-4 text-center rounded-b-2x"> <a - // href="/theme-voting" + href="/theme-voting" className="text-blue-300 dark:text-blue-500 hover:underline font-semibold" > Go to Theme Voting diff --git a/src/components/themes/theme-slaughter.tsx b/src/components/themes/theme-slaughter.tsx index 4715d4b..0fb57fa 100644 --- a/src/components/themes/theme-slaughter.tsx +++ b/src/components/themes/theme-slaughter.tsx @@ -181,6 +181,29 @@ export default function ThemeSlaughter() { return <div>Loading...</div>; } + + + // Render message if not in Theme Slaughter phase + if (activeJamResponse?.phase !== "Survival") { + return ( + <div className="p-6 bg-gray-100 dark:bg-gray-800 min-h-screen"> + <h1 className="text-2xl font-bold text-gray-800 dark:text-white mb-6"> + Not in Theme Slaughter Phase + </h1> + <p className="text-gray-600 dark:text-gray-400"> + The current phase is{" "} + <strong>{activeJamResponse?.phase || "Unknown"}</strong>. Please come + back during the Theme Slaughter phase. + </p> + </div> + ); + } + + const loggedIn = getCookie("token"); + if (!loggedIn) { + return <div>Sign in to be able to join the Theme Survival</div>; + } + if (!hasJoined) { return ( <div className="p-6 bg-gray-100 dark:bg-gray-800 min-h-screen"> @@ -204,28 +227,6 @@ export default function ThemeSlaughter() { ); } - // Render message if not in Theme Slaughter phase - if (activeJamResponse?.phase !== "Survival") { - return ( - <div className="p-6 bg-gray-100 dark:bg-gray-800 min-h-screen"> - <h1 className="text-2xl font-bold text-gray-800 dark:text-white mb-6"> - Not in Theme Slaughter Phase - </h1> - <p className="text-gray-600 dark:text-gray-400"> - The current phase is{" "} - <strong>{activeJamResponse?.phase || "Unknown"}</strong>. Please come - back during the Theme Slaughter phase. - </p> - </div> - ); - } - - const loggedIn = getCookie("token"); - - if (!loggedIn) { - return <div>Sign in to be able to join the Theme Survival</div>; - } - return ( <div className="flex h-screen"> {/* Left Side */} diff --git a/src/components/themes/theme-suggest.tsx b/src/components/themes/theme-suggest.tsx index 40925c0..95ca5b7 100644 --- a/src/components/themes/theme-suggest.tsx +++ b/src/components/themes/theme-suggest.tsx @@ -166,6 +166,12 @@ export default function ThemeSuggestions() { return <div>Loading...</div>; } + const token = getCookie("token"); + + if (!token) { + return <div>Sign in to be able to suggest themes</div>; + } + if (!hasJoined) { return ( <div className="p-6 bg-gray-100 dark:bg-gray-800 min-h-screen"> @@ -189,12 +195,6 @@ export default function ThemeSuggestions() { ); } - const token = getCookie("token"); - - if (!token) { - return <div>Sign in to be able to suggest themes</div>; - } - // Render message if not in Suggestion phase if (activeJamResponse?.phase !== "Suggestion") { return ( diff --git a/src/components/themes/theme-vote.tsx b/src/components/themes/theme-vote.tsx index 19a9547..840bd9e 100644 --- a/src/components/themes/theme-vote.tsx +++ b/src/components/themes/theme-vote.tsx @@ -144,6 +144,27 @@ export default function VotingPage() { return <div>Loading...</div>; } + if (activeJamResponse?.phase !== "Voting") { + return ( + <div className="p-4 bg-gray-100 dark:bg-gray-800 min-h-screen"> + <h1 className="text-2xl font-bold text-gray-800 dark:text-white mb-4"> + Not in Voting Phase + </h1> + <p className="text-gray-600 dark:text-gray-400"> + The current phase is{" "} + <strong>{activeJamResponse?.phase || "Unknown"}</strong>. Please come + back during the Voting phase. + </p> + </div> + ); + } + + const loggedIn = getCookie("token"); + + if (!loggedIn) { + return <div>Sign in to be able to vote</div>; + } + if (!hasJoined) { return ( <div className="p-6 bg-gray-100 dark:bg-gray-800 min-h-screen"> @@ -167,27 +188,6 @@ export default function VotingPage() { ); } - if (activeJamResponse?.phase !== "Voting") { - return ( - <div className="p-4 bg-gray-100 dark:bg-gray-800 min-h-screen"> - <h1 className="text-2xl font-bold text-gray-800 dark:text-white mb-4"> - Not in Voting Phase - </h1> - <p className="text-gray-600 dark:text-gray-400"> - The current phase is{" "} - <strong>{activeJamResponse?.phase || "Unknown"}</strong>. Please come - back during the Voting phase. - </p> - </div> - ); - } - - const loggedIn = getCookie("token"); - - if (!loggedIn) { - return <div>Sign in to be able to vote</div>; - } - return ( <div className="p-3 bg-gray-100 dark:bg-gray-800 min-h-screen"> <h1 className="text-2xl font-bold text-gray-800 dark:text-white mb-4">