Improve MineGeo interface and functionality
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
"use client";
|
||||
import { useI18n } from "@/components/I18nProvider";
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import type * as Leaflet from "leaflet";
|
||||
import "leaflet/dist/leaflet.css";
|
||||
@@ -23,6 +25,7 @@ export function GuessMap({
|
||||
onError?: (message: string) => void;
|
||||
disabled?: boolean;
|
||||
}) {
|
||||
const { t } = useI18n();
|
||||
const root = useRef<HTMLDivElement>(null),
|
||||
markers = useRef<Leaflet.LayerGroup | null>(null),
|
||||
lib = useRef<typeof Leaflet | null>(null),
|
||||
@@ -177,18 +180,20 @@ export function GuessMap({
|
||||
role="application"
|
||||
aria-label={
|
||||
disabled
|
||||
? "Minecraft map. North is up."
|
||||
: "Minecraft map. North is up. Click to place a guess, or use arrow keys to pan and Enter to pin the center."
|
||||
? t("Minecraft map. North is up.")
|
||||
: t(
|
||||
"Minecraft map. North is up. Click to place a guess, or use arrow keys to pan and Enter to pin the center.",
|
||||
)
|
||||
}
|
||||
/>
|
||||
{error && (
|
||||
<div className="map-load-error" role="alert">
|
||||
<p>{error}</p>
|
||||
<p>{t(error)}</p>
|
||||
<button
|
||||
className="button"
|
||||
onClick={() => setAttempt((value) => value + 1)}
|
||||
>
|
||||
Retry map
|
||||
{t("Retry map")}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user