feat: 前端UI标题栏优化与配置更新
- 更新.gitignore,添加frontend/.next/忽略 - 优化RecordModal、index、recurring、search、stats页面标题栏样式 - 新增frontend/lib/utils.js工具函数 - 更新useCategories.js钩子 - 添加代码优化计划文档 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import { DEFAULT_CATEGORIES } from '../lib/categories';
|
||||
export function useCategories() {
|
||||
const [categories, setCategories] = useState(DEFAULT_CATEGORIES);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isLoggedIn()) {
|
||||
@@ -33,6 +34,7 @@ export function useCategories() {
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
setError(err);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
@@ -41,5 +43,5 @@ export function useCategories() {
|
||||
loadCategories();
|
||||
}, []);
|
||||
|
||||
return { categories, loading };
|
||||
return { categories, loading, error };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user