From 58ea324e3eea60976d24d8dbf974293b920555fd Mon Sep 17 00:00:00 2001 From: Aaron Geiger Date: Tue, 13 Aug 2024 23:04:45 +0200 Subject: [PATCH] Update react-refresh for lila --- liberica/src/components/lila/button.tsx | 6 ++++-- liberica/src/components/lila/index.tsx | 1 + liberica/src/components/lila/select.tsx | 4 ++-- liberica/src/i18n/en.json | 5 ++++- liberica/src/page/Debug.tsx | 9 ++++++--- liberica/src/page/Game.tsx | 2 +- 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/liberica/src/components/lila/button.tsx b/liberica/src/components/lila/button.tsx index f25b06e..907d9c0 100644 --- a/liberica/src/components/lila/button.tsx +++ b/liberica/src/components/lila/button.tsx @@ -1,9 +1,11 @@ +/** eslint-disable react-refresh/only-export-components */ // This element does not have a state, so react-refresh is not needed + import { classes } from "components/lila"; const BASE = "select-none transition-all font-sans disabled:pointer-events-none active:opacity-[0.85] disabled:opacity-50 disabled:shadow-none "; -export const BUTTON_VARIANTS = { +const BUTTON_VARIANTS = { primary: "bg-primary text-on-primary rounded-xl font-bold hover:bg-primary/90 animate-entry", secondary: @@ -11,7 +13,7 @@ export const BUTTON_VARIANTS = { muted: "bg-muted/10 text-on-muted rounded-xl font-bold hover:bg-muted/20 animate-entry", }; -export const BUTTON_SIZES = { +const BUTTON_SIZES = { sm: "py-1 px-4 text-xs", md: "py-2 px-5 text-xs", lg: "py-2.5 px-7 text-sm", diff --git a/liberica/src/components/lila/index.tsx b/liberica/src/components/lila/index.tsx index d6cbf76..e72c738 100644 --- a/liberica/src/components/lila/index.tsx +++ b/liberica/src/components/lila/index.tsx @@ -1,6 +1,7 @@ import { Button } from "./button"; import { TextInput } from "./input.tsx"; +// eslint-disable-next-line react-refresh/only-export-components export function classes(...inputs: string[]): string { return inputs.join(" "); } diff --git a/liberica/src/components/lila/select.tsx b/liberica/src/components/lila/select.tsx index e9d3e26..0bccb0a 100644 --- a/liberica/src/components/lila/select.tsx +++ b/liberica/src/components/lila/select.tsx @@ -10,10 +10,10 @@ export interface SelectPropsExt { noLogo?: boolean; } -export const BASE = +const BASE = "text-on-muted rounded-xl bg-muted/20 outline-none ring-muted focus:ring-2"; -export const INPUT_SIZES = { +const INPUT_SIZES = { lg: "px-6 py-3 text-md", }; diff --git a/liberica/src/i18n/en.json b/liberica/src/i18n/en.json index f7c7bb8..7aa2087 100644 --- a/liberica/src/i18n/en.json +++ b/liberica/src/i18n/en.json @@ -19,5 +19,8 @@ "ReplayTooBig": "replay file is too big", "Speed": "Speed", "Cancel": "Cancel", - "EmbarkPlaceholder": "Click on train to embark" + "EmbarkPlaceholder": "Click on train to embark", + "DebugVariant": "Variant", + "DebugSize": "Size", + "DebugElement": "Element" } diff --git a/liberica/src/page/Debug.tsx b/liberica/src/page/Debug.tsx index dbd634c..513a83e 100644 --- a/liberica/src/page/Debug.tsx +++ b/liberica/src/page/Debug.tsx @@ -9,11 +9,14 @@ import { TextInput } from "components/lila/input"; import { Select } from "components/lila/select"; import { THEMES, ThemeName, applyTheme } from "lib/theme"; import { useState } from "react"; +import { useTranslation } from "react-i18next"; export function Debug() { const sizes = Object.keys(BUTTON_SIZES) as ButtonSize[]; const variants = Object.keys(BUTTON_VARIANTS) as ButtonVariant[]; + const { t } = useTranslation(); + const [text, setText] = useState("Test"); return (
@@ -39,9 +42,9 @@ export function Debug() { - - - + + + diff --git a/liberica/src/page/Game.tsx b/liberica/src/page/Game.tsx index b2c8e45..b5f5877 100644 --- a/liberica/src/page/Game.tsx +++ b/liberica/src/page/Game.tsx @@ -87,7 +87,7 @@ export function Game() { /> -
+
{embarkedTrain ? ( {embarkedTrain.line_name}{" "}
VariantSizeElement{t("DebugVariant")}{t("DebugSize")}{t("DebugElement")}