- saveSetting: add setProfile(p => ({...p, [key]: value})) so profile
stays in sync with individual setting changes — prevents auto-save
from overwriting fresh settings with stale profile object values
- Extract SettingsSidebar (4725 lines) from WeeklyView.tsx into its own
file; lazy-load with next/dynamic so the ~4500-line settings panel
is deferred until the user opens settings
- Extract shared constants/helpers to src/lib/:
fontConstants.ts (AVAILABLE_FONTS, FONT_WEIGHTS, isCustomFont)
weeklyViewTranslations.ts (translations object, ~1100 lines)
weeklyViewConstants.ts (WeatherDisplayKey, WEATHER_DISPLAY_DEFAULTS)
- WeeklyView.tsx: 16,209 → 10,364 lines (-36%)
v1.80.0
5 lines
263 B
TypeScript
5 lines
263 B
TypeScript
// Shared constants for WeeklyView and SettingsSidebar
|
|
|
|
export type WeatherDisplayKey = "icon" | "temp" | "feelsLike" | "wind" | "gusts" | "precipProb" | "precip" | "humidity" | "uv";
|
|
export const WEATHER_DISPLAY_DEFAULTS: WeatherDisplayKey[] = ["icon", "temp"];
|