UPDATE: Fix bug
Gitea Auto Deploy / Deploy-Container (push) Successful in 45s

This commit is contained in:
2026-03-06 14:29:26 +07:00
parent f5541c9527
commit 53497d5ece
8 changed files with 28 additions and 34 deletions
+2 -2
View File
@@ -16,8 +16,8 @@ export default function EnemyBar() {
return (
<div className="p-3 w-full">
<div className="flex gap-3 overflow-x-auto pb-2">
{enemyDetail && Object.values(enemyDetail).filter((enemy) => (enemy.stats?.AV > 0
&& enemy.stats.HP <= enemy.maxHP)).map((enemy, uid) => (
{enemyDetail && Object.values(enemyDetail).filter((enemy) => (
enemy.stats.HP <= enemy.maxHP)).map((enemy, uid) => (
<div key={uid} className="bg-base-200 rounded-lg p-3 border border-gray-700 w-52 shrink-0">
<div className="flex items-center justify-between mb-3">
<div className="flex items-center gap-2">
@@ -1,6 +1,6 @@
"use client";
import useLocaleStore from "@/stores/localeStore";
import { createContext, PropsWithChildren, useEffect } from "react";
import { createContext, PropsWithChildren } from "react";
interface ThemeContextType {
theme?: string;
@@ -10,26 +10,12 @@ export const ThemeContext = createContext<ThemeContextType>({});
export const ThemeProvider = ({ children }: PropsWithChildren) => {
const { theme, setTheme } = useLocaleStore()
useEffect(() => {
if (typeof window !== "undefined") {
const storedTheme = localStorage.getItem("theme");
if (storedTheme) setTheme(storedTheme);
}
}, []);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const changeTheme = (nextTheme: string | null) => {
if (nextTheme) {
setTheme(nextTheme);
if (typeof window !== "undefined") {
localStorage.setItem("theme", nextTheme);
}
} else {
setTheme(theme === "winter" ? "night" : "winter");
if (typeof window !== "undefined") {
localStorage.setItem("theme", theme);
}
}
};