Add map-specific tournament creation link
Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 3m31s

This commit is contained in:
2026-10-18 13:32:56 +05:00
parent a7085e4e80
commit da1a50a6ad
10 changed files with 74 additions and 9 deletions

View File

@@ -4,7 +4,7 @@ import { useI18n } from "@/components/I18nProvider";
import { useEffect, useRef, useState, type FormEvent } from "react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { ArrowRight, Timer, ZoomIn, Users } from "lucide-react";
import { ArrowRight, Timer, ZoomIn, Users, Trophy } from "lucide-react";
import {
difficulties,
customDifficultySchema,
@@ -42,6 +42,7 @@ export function StartGame({
[loading, setLoading] = useState(false),
[error, setError] = useState("");
const router = useRouter();
const tournamentPath = `/tournaments?map=${encodeURIComponent(datasetId)}`;
const starting = useRef(false);
const savingPreset = useRef(false);
useEffect(() => {
@@ -147,6 +148,22 @@ export function StartGame({
<Users size={15} /> {t("Multiplayer")}
</button>
</div>
<Link
className="button tournament-map-action full"
href={
hostName
? tournamentPath
: `/log-in?next=${encodeURIComponent(tournamentPath)}`
}
>
<Trophy size={17} />
{t(
hostName
? "Create tournament with this map"
: "Log in to create a tournament",
)}
<ArrowRight size={17} />
</Link>
<div className="difficulty-options">
{options.map((option) => (
<button