diff --git a/UPGRADE_NEXT16.md b/UPGRADE_NEXT16.md deleted file mode 100644 index 46bf8d0..0000000 --- a/UPGRADE_NEXT16.md +++ /dev/null @@ -1,79 +0,0 @@ -# Next.js 16 Upgrade Guide - -## Current Status -- **Current Version**: Next.js 15.2.6 -- **Target Version**: Next.js 16.1.1 -- **React Version**: 19.0.0 ✅ (Compatible) - -## Upgrade Steps - -### 1. Backup First -```bash -git add . -git commit -m "Before Next.js 16 upgrade" -``` - -### 2. Update Dependencies -```bash -npm install next@16 react@19 react-dom@19 eslint-config-next@16 -``` - -### 3. Update Related Packages -```bash -npm install @next/bundle-analyzer@latest -``` - -### 4. Test Build -```bash -npm run build -``` - -### 5. Test Development Server -```bash -npm run dev -``` - -## Potential Breaking Changes - -### 1. Route Handlers -- Check all API routes in `app/api/` for compatibility -- Ensure async/await patterns are correct - -### 2. Server Components -- Verify all server components work correctly -- Check for any client component boundaries - -### 3. Image Optimization -- `next/image` may have minor API changes -- Check image imports - -### 4. Font Loading -- `next/font` should work the same, but verify - -## Performance Improvements Expected - -1. **Faster Builds**: 10-20% faster production builds -2. **Better Caching**: Improved static generation caching -3. **Smaller Bundles**: Better tree-shaking and code splitting -4. **Faster Dev Server**: Turbopack improvements - -## Rollback Plan - -If issues occur: -```bash -npm install next@15.2.6 react@19 react-dom@19 eslint-config-next@15.2.3 -``` - -## Testing Checklist - -- [ ] Build completes successfully -- [ ] Dev server starts without errors -- [ ] All pages load correctly -- [ ] API routes work -- [ ] Images load properly -- [ ] Fonts load correctly -- [ ] Admin dashboard works -- [ ] Order management works -- [ ] Analytics charts render -- [ ] Authentication works - diff --git a/components/admin/AdminAnalytics.tsx b/components/admin/AdminAnalytics.tsx index ced1333..140ea93 100644 --- a/components/admin/AdminAnalytics.tsx +++ b/components/admin/AdminAnalytics.tsx @@ -361,10 +361,14 @@ export default function AdminAnalytics() { }).format(value); }; - // Calculate best month from daily data (for YTD view) + // Calculate best month from daily data (for YTD, full year, or previous years) const calculateBestMonth = () => { + // Show best month for YTD, full year view, or when viewing previous years + const showBestMonth = + dateRange === "ytd" || dateRange === "year" || !isViewingCurrentYear; + if ( - dateRange !== "ytd" || + !showBestMonth || !analyticsData?.revenue?.dailyRevenue || analyticsData.revenue.dailyRevenue.length === 0 ) { @@ -597,7 +601,7 @@ export default function AdminAnalytics() { )} - {/* Best Month Card (only show for YTD) */} + {/* Best Month Card (show for YTD, full year, or previous years) */} {bestMonth && ( @@ -608,7 +612,12 @@ export default function AdminAnalytics() {
- Best Month (YTD) + Best Month{" "} + {!isViewingCurrentYear + ? `of ${selectedYear}` + : dateRange === "year" + ? "(Full Year)" + : "(YTD)"}
{bestMonth.month}