mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-27 21:58:08 -05:00
Build Analyzer to prod!
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
"name": "admin",
|
||||
"url": "admin"
|
||||
},
|
||||
{ "name": "analyzer", "url": "analyzer" },
|
||||
{ "name": "calendar", "url": "calendar" },
|
||||
{ "name": "badges", "url": "badges" },
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type MetaFunction, type LinksFunction } from "@remix-run/node";
|
||||
import { type LinksFunction, type MetaFunction } from "@remix-run/node";
|
||||
import * as React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { AbilitiesSelector } from "~/components/AbilitiesSelector";
|
||||
@@ -8,11 +8,9 @@ import { Image } from "~/components/Image";
|
||||
import { Main } from "~/components/Main";
|
||||
import { Popover } from "~/components/Popover";
|
||||
import { Toggle } from "~/components/Toggle";
|
||||
import { ADMIN_DISCORD_ID } from "~/constants";
|
||||
import { useSetTitle } from "~/hooks/useSetTitle";
|
||||
import type { AnalyzedBuild, Stat } from "~/modules/analyzer";
|
||||
import { MAX_LDE_INTENSITY } from "~/modules/analyzer";
|
||||
import { useAnalyzeBuild } from "~/modules/analyzer";
|
||||
import { MAX_LDE_INTENSITY, useAnalyzeBuild } from "~/modules/analyzer";
|
||||
import {
|
||||
lastDitchEffortIntensityToAp,
|
||||
SPECIAL_EFFECTS,
|
||||
@@ -21,21 +19,17 @@ import type {
|
||||
AbilityPoints,
|
||||
SpecialEffectType,
|
||||
} from "~/modules/analyzer/types";
|
||||
import { useUser } from "~/modules/auth";
|
||||
import {
|
||||
type BuildAbilitiesTupleWithUnknown,
|
||||
abilities,
|
||||
ANGLE_SHOOTER_ID,
|
||||
INK_MINE_ID,
|
||||
INK_STORM_ID,
|
||||
} from "~/modules/in-game-lists";
|
||||
import {
|
||||
isAbility,
|
||||
POINT_SENSOR_ID,
|
||||
SPLASH_WALL_ID,
|
||||
SPRINKLER_ID,
|
||||
TOXIC_MIST_ID,
|
||||
} from "~/modules/in-game-lists";
|
||||
import { ANGLE_SHOOTER_ID } from "~/modules/in-game-lists";
|
||||
import { INK_MINE_ID, POINT_SENSOR_ID } from "~/modules/in-game-lists";
|
||||
import {
|
||||
abilities,
|
||||
isAbility,
|
||||
type BuildAbilitiesTupleWithUnknown,
|
||||
type MainWeaponId,
|
||||
type SubWeaponId,
|
||||
} from "~/modules/in-game-lists";
|
||||
@@ -59,17 +53,9 @@ export const handle = {
|
||||
i18n: ["weapons", "analyzer"],
|
||||
};
|
||||
|
||||
const canViewInProduction = (discordId?: string) => {
|
||||
const LEAN_ID = "86905636402495488";
|
||||
const SENDOU_ID = ADMIN_DISCORD_ID;
|
||||
|
||||
return discordId === LEAN_ID || discordId === SENDOU_ID;
|
||||
};
|
||||
|
||||
export default function BuildAnalyzerPage() {
|
||||
const user = useUser();
|
||||
const { t } = useTranslation(["analyzer", "common", "weapons"]);
|
||||
useSetTitle(t("common:pages.buildAnalyzer"));
|
||||
useSetTitle(t("common:pages.analyzer"));
|
||||
const {
|
||||
build,
|
||||
mainWeaponId,
|
||||
@@ -80,13 +66,6 @@ export default function BuildAnalyzerPage() {
|
||||
effects,
|
||||
} = useAnalyzeBuild();
|
||||
|
||||
if (
|
||||
process.env.NODE_ENV === "production" &&
|
||||
!canViewInProduction(user?.discordId)
|
||||
) {
|
||||
return <Main>Coming soon :)</Main>;
|
||||
}
|
||||
|
||||
const mainWeaponCategoryItems = [
|
||||
analyzed.stats.shotSpreadAir && (
|
||||
<StatCard
|
||||
|
||||
@@ -13,6 +13,7 @@ import styles from "~/styles/front.css";
|
||||
import { databaseTimestampToDate } from "~/utils/dates";
|
||||
import { discordFullName } from "~/utils/strings";
|
||||
import {
|
||||
ANALYZER_PAGE,
|
||||
articlePage,
|
||||
BADGES_PAGE,
|
||||
calendarEventPage,
|
||||
@@ -53,6 +54,12 @@ export default function Index() {
|
||||
<div className="stack md">
|
||||
<h2 className="front__more-features">{t("front:moreFeatures")}</h2>
|
||||
<div className="front__feature-cards">
|
||||
<FeatureCard
|
||||
navItem="analyzer"
|
||||
title={t("common:pages.analyzer")}
|
||||
description={t("front:badges.analyzer")}
|
||||
to={ANALYZER_PAGE}
|
||||
/>
|
||||
<FeatureCard
|
||||
navItem="plus"
|
||||
title={t("common:pages.plus")}
|
||||
|
||||
@@ -24,6 +24,7 @@ export const ADMIN_PAGE = "/admin";
|
||||
export const FAQ_PAGE = "/faq";
|
||||
export const CONTRIBUTIONS_PAGE = "/contributions";
|
||||
export const BADGES_PAGE = "/badges";
|
||||
export const ANALYZER_PAGE = "/analyzer";
|
||||
export const CALENDAR_PAGE = "/calendar";
|
||||
export const STOP_IMPERSONATING_URL = "/auth/impersonate/stop";
|
||||
export const SEED_URL = "/seed";
|
||||
|
||||
BIN
public/img/layout/analyzer.avif
Normal file
BIN
public/img/layout/analyzer.avif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
BIN
public/img/layout/analyzer.png
Normal file
BIN
public/img/layout/analyzer.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
@@ -6,7 +6,7 @@
|
||||
"pages.calendar": "Calendar",
|
||||
"pages.faq": "FAQ",
|
||||
"pages.builds": "Builds",
|
||||
"pages.buildAnalyzer": "Build Analyzer",
|
||||
"pages.analyzer": "Build Analyzer",
|
||||
|
||||
"header.profile": "Profile",
|
||||
"header.logout": "Log out",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"moreFeatures": "More features",
|
||||
"plus.description": "View Plus Server voting history and more",
|
||||
"badges.description": "List of all the badges you can earn for your profile",
|
||||
"badges.analyzer": "Find out what your builds actually do",
|
||||
"recentWinners": "Recent winners",
|
||||
"upcomingEvents": "Upcoming events",
|
||||
"articleBy": "by {{author}}"
|
||||
|
||||
Reference in New Issue
Block a user