perf: 优化主题色配置以及暗色模式的文本辨识度

This commit is contained in:
Montia37
2025-09-08 10:04:04 +08:00
parent b9ca8d5454
commit 5dc65c9cba
24 changed files with 112 additions and 90 deletions

View File

@@ -9,10 +9,18 @@ import type { NodeWithStatus } from "@/types/node";
import { useNodeData } from "@/contexts/NodeDataContext";
import { useLiveData } from "@/contexts/LiveDataContext";
import { useAppConfig } from "@/config";
import {
Card,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card";
interface HomePageProps {
viewMode: "grid" | "table";
searchTerm: string;
setSearchTerm: (term: string) => void;
}
const homeStateCache = {
@@ -20,7 +28,11 @@ const homeStateCache = {
scrollPosition: 0,
};
const HomePage: React.FC<HomePageProps> = ({ viewMode, searchTerm }) => {
const HomePage: React.FC<HomePageProps> = ({
viewMode,
searchTerm,
setSearchTerm,
}) => {
const { nodes: staticNodes, loading, getGroups } = useNodeData();
const { liveData } = useLiveData();
const [selectedGroup, setSelectedGroup] = useState(
@@ -133,7 +145,7 @@ const HomePage: React.FC<HomePageProps> = ({ viewMode, searchTerm }) => {
<main className="flex-1 px-4 pb-4">
{enableGroupedBar && (
<div className="flex overflow-auto whitespace-nowrap overflow-x-auto items-center min-w-[300px] text-secondary-foreground box-border border border-(--accent-a4) space-x-4 px-4 rounded-lg mb-4 purcarte-blur">
<div className="flex purcarte-blur theme-card-style overflow-auto whitespace-nowrap overflow-x-auto items-center min-w-[300px] text-secondary-foreground space-x-4 px-4 mb-4">
<span></span>
{groups.map((group: string) => (
<Button
@@ -155,7 +167,7 @@ const HomePage: React.FC<HomePageProps> = ({ viewMode, searchTerm }) => {
className={
viewMode === "grid"
? ""
: "space-y-2 overflow-auto box-border border border-(--accent-a4) purcarte-blur rounded-lg p-2"
: "space-y-2 overflow-auto purcarte-blur theme-card-style p-2"
}>
<div
className={
@@ -185,9 +197,20 @@ const HomePage: React.FC<HomePageProps> = ({ viewMode, searchTerm }) => {
</div>
</div>
) : (
<div className="text-center py-12">
<p className="text-lg font-bold"></p>
<p className="text-muted-foreground"></p>
<div className="flex flex-grow items-center justify-center">
<Card className="w-full max-w-md">
<CardHeader>
<CardTitle className="text-2xl font-bold">
Not Found
</CardTitle>
<CardDescription></CardDescription>
</CardHeader>
<CardFooter>
<Button onClick={() => setSearchTerm("")} className="w-full">
</Button>
</CardFooter>
</Card>
</div>
)}
</div>