Skip to content

Commit

Permalink
Update react-refresh for lila
Browse files Browse the repository at this point in the history
  • Loading branch information
Comeza committed Aug 13, 2024
1 parent 57d6f7f commit 58ea324
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
6 changes: 4 additions & 2 deletions liberica/src/components/lila/button.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
/** 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:
"bg-secondary text-on-secondary rounded-xl font-bold hover:bg-secondary/90 animate-entry",
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",
Expand Down
1 change: 1 addition & 0 deletions liberica/src/components/lila/index.tsx
Original file line number Diff line number Diff line change
@@ -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(" ");
}
Expand Down
4 changes: 2 additions & 2 deletions liberica/src/components/lila/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
};

Expand Down
5 changes: 4 additions & 1 deletion liberica/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
9 changes: 6 additions & 3 deletions liberica/src/page/Debug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="flex h-screen w-dvw flex-col items-center justify-center gap-10 bg-base">
Expand All @@ -39,9 +42,9 @@ export function Debug() {
<table className="table-auto border-spacing-2">
<thead>
<tr className="text-left">
<th>Variant</th>
<th>Size</th>
<th>Element</th>
<th>{t("DebugVariant")}</th>
<th>{t("DebugSize")}</th>
<th>{t("DebugElement")}</th>
</tr>
</thead>

Expand Down
2 changes: 1 addition & 1 deletion liberica/src/page/Game.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function Game() {
/>

<Navbar>
<div className="flex h-full w-full flex-col truncate rounded-xl rounded-xl bg-muted/10 px-4 py-2.5 text-sm text-on-muted">
<div className="flex h-full w-full flex-col truncate rounded-xl bg-muted/10 px-4 py-2.5 text-sm text-on-muted">
{embarkedTrain ? (
<span className="truncate">
{embarkedTrain.line_name}{" "}
Expand Down

0 comments on commit 58ea324

Please sign in to comment.