Add map-specific tournament creation link
Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 3m31s
Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 3m31s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user