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:
+20
-5
@@ -1,12 +1,30 @@
|
||||
import { useState, useEffect, useRef, useMemo } from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import { isLoggedIn, getTrendStats, getCategoryStats } from '../lib/api';
|
||||
import { Chart, registerables } from 'chart.js';
|
||||
import {
|
||||
Chart,
|
||||
LineController,
|
||||
LineElement,
|
||||
PointElement,
|
||||
LinearScale,
|
||||
CategoryScale,
|
||||
Filler,
|
||||
Legend,
|
||||
} from 'chart.js';
|
||||
import AppShell from '../components/AppShell';
|
||||
import { Icon } from '../components/icons';
|
||||
import { getMonthStr, formatMonth } from '../lib/utils';
|
||||
import { useToast } from '../components/ToastProvider';
|
||||
|
||||
Chart.register(...registerables);
|
||||
Chart.register(
|
||||
LineController,
|
||||
LineElement,
|
||||
PointElement,
|
||||
LinearScale,
|
||||
CategoryScale,
|
||||
Filler,
|
||||
Legend
|
||||
);
|
||||
|
||||
export default function Stats() {
|
||||
const router = useRouter();
|
||||
@@ -35,9 +53,6 @@ export default function Stats() {
|
||||
loadCategoryData();
|
||||
}, [router, currentMonth, categoryType]);
|
||||
|
||||
const getMonthStr = (date) => `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}`;
|
||||
const formatMonth = (date) => `${date.getFullYear()}年${date.getMonth() + 1}月`;
|
||||
|
||||
const loadTrendData = async () => {
|
||||
setTrendLoading(true);
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user