From 294d3404d2104a26e983925cb0dfd0dba3894e39 Mon Sep 17 00:00:00 2001
From: Kalle <38327916+Sendouc@users.noreply.github.com>
Date: Thu, 15 Sep 2022 18:40:02 +0300
Subject: [PATCH] Page title for build analyzer
---
app/routes/analyzer.tsx | 69 ++++++++++++++++++++---------------
public/locales/en/common.json | 1 +
2 files changed, 40 insertions(+), 30 deletions(-)
diff --git a/app/routes/analyzer.tsx b/app/routes/analyzer.tsx
index d33039fc5..68d988c32 100644
--- a/app/routes/analyzer.tsx
+++ b/app/routes/analyzer.tsx
@@ -1,20 +1,28 @@
-import { type LinksFunction } from "@remix-run/node";
+import { type MetaFunction, type LinksFunction } from "@remix-run/node";
import { useTranslation } from "react-i18next";
import { AbilitiesSelector } from "~/components/AbilitiesSelector";
import { Ability } from "~/components/Ability";
import { WeaponCombobox } from "~/components/Combobox";
import { Image } from "~/components/Image";
import { Main } from "~/components/Main";
+import { useSetTitle } from "~/hooks/useSetTitle";
import type { AnalyzedBuild, Stat } from "~/modules/analyzer";
import { useAnalyzeBuild } from "~/modules/analyzer";
import type { MainWeaponId, SubWeaponId } from "~/modules/in-game-lists";
import styles from "~/styles/analyzer.css";
+import { makeTitle } from "~/utils/strings";
import { specialWeaponImageUrl, subWeaponImageUrl } from "~/utils/urls";
// xxx: charge hold frames
export const CURRENT_PATCH = "1.1";
+export const meta: MetaFunction = () => {
+ return {
+ title: makeTitle("Build Analyzer"),
+ };
+};
+
export const links: LinksFunction = () => {
return [{ rel: "stylesheet", href: styles }];
};
@@ -24,7 +32,8 @@ export const handle = {
};
export default function BuildAnalyzerPage() {
- const { t } = useTranslation("analyzer");
+ const { t } = useTranslation(["analyzer", "common"]);
+ useSetTitle(t("common:pages.buildAnalyzer"));
const { build, setBuild, mainWeaponId, setMainWeaponId, analyzed } =
useAnalyzeBuild();
@@ -51,40 +60,40 @@ export default function BuildAnalyzerPage() {