style: 美化用户隧道权限分配表单UI并统一代码格式

- 使用HeroUI Checkbox组件替换原生checkbox

- 重构隧道列表为card-based tile风格

- 添加选中/未选中/已分配状态视觉区分

- 应用eslint --fix代码格式统一

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
root
2026-02-04 02:22:28 +00:00
parent 72c2e28667
commit 6f6fececa8
31 changed files with 8080 additions and 5740 deletions
+18 -20
View File
@@ -1,9 +1,9 @@
import React from 'react';
import { useNavigate, useLocation } from 'react-router-dom';
import React from "react";
import { useNavigate, useLocation } from "react-router-dom";
import { Button } from "@heroui/button";
import { Logo } from '@/components/icons';
import { siteConfig } from '@/config/site';
import { Logo } from "@/components/icons";
import { siteConfig } from "@/config/site";
export default function H5SimpleLayout({
children,
@@ -12,11 +12,11 @@ export default function H5SimpleLayout({
}) {
const navigate = useNavigate();
const location = useLocation();
// 路由切换时回到顶部,避免上一页滚动位置保留
React.useEffect(() => {
try {
window.scrollTo({ top: 0, left: 0, behavior: 'auto' });
window.scrollTo({ top: 0, left: 0, behavior: "auto" });
} catch (e) {
window.scrollTo(0, 0);
}
@@ -25,7 +25,7 @@ export default function H5SimpleLayout({
}, [location.pathname]);
const handleBack = () => {
navigate('/profile');
navigate("/profile");
};
return (
@@ -33,28 +33,26 @@ export default function H5SimpleLayout({
{/* 顶部导航栏 */}
<header className="bg-white dark:bg-black shadow-sm border-b border-gray-200 dark:border-gray-600 h-14 safe-top flex-shrink-0 flex items-center justify-between px-4 relative z-10">
<div className="flex items-center gap-2">
<Button
isIconOnly
variant="light"
size="sm"
onPress={handleBack}
>
<Button isIconOnly size="sm" variant="light" onPress={handleBack}>
<svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fillRule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clipRule="evenodd" />
<path
clipRule="evenodd"
d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
fillRule="evenodd"
/>
</svg>
</Button>
<Logo size={20} />
<h1 className="text-sm font-bold text-foreground">{siteConfig.name}</h1>
<h1 className="text-sm font-bold text-foreground">
{siteConfig.name}
</h1>
</div>
<div className="flex items-center gap-2">
</div>
<div className="flex items-center gap-2" />
</header>
{/* 主内容区域 */}
<main className="flex-1 bg-gray-100 dark:bg-black pb-0">
{children}
</main>
<main className="flex-1 bg-gray-100 dark:bg-black pb-0">{children}</main>
</div>
);
}