feat(#7): категории напоминаний (exercise/hydration/eyes/posture)

This commit is contained in:
AnRil
2026-05-22 13:39:40 +07:00
parent 50c56fec79
commit 68998607e8
6 changed files with 117 additions and 11 deletions

View File

@@ -1,3 +1,20 @@
/**
* Категория напоминания. По умолчанию `exercise` — для совместимости со
* старыми state'ами (поле optional). Категория влияет на:
* - tint иконки в карточке (hydration синий, eyes фиолетовый и т.д.)
* - текст в окне напоминания («Время попить» вместо «Время тренировки»)
* - подсчёт повторений: для hydration/eyes/posture `reps` обычно = 1
* (это не «N раз», а просто «сделай»).
*/
export type ReminderCategory = 'exercise' | 'hydration' | 'eyes' | 'posture'
export const REMINDER_CATEGORIES: ReminderCategory[] = [
'exercise',
'hydration',
'eyes',
'posture'
]
export type Exercise = {
id: string
name: string
@@ -7,6 +24,8 @@ export type Exercise = {
enabled: boolean
nextFireAt: number
lastDoneAt?: number
/** Default 'exercise' если undefined — обратная совместимость. */
category?: ReminderCategory
}
export type NotificationMode = 'toast' | 'modal' | 'both'
@@ -253,21 +272,40 @@ export const SAMPLE_EXERCISES: Omit<Exercise, 'id' | 'nextFireAt'>[] = [
reps: 10,
icon: 'Activity',
intervalMinutes: 30,
enabled: true
enabled: true,
category: 'exercise'
},
{
name: 'Отжимания',
reps: 10,
icon: 'Dumbbell',
intervalMinutes: 45,
enabled: true
enabled: true,
category: 'exercise'
},
{
name: 'Растяжка спины',
name: 'Стакан воды',
reps: 1,
icon: 'StretchHorizontal',
icon: 'GlassWater',
intervalMinutes: 60,
enabled: false
enabled: false,
category: 'hydration'
},
{
name: 'Отдых глазам (20-20-20)',
reps: 1,
icon: 'Eye',
intervalMinutes: 20,
enabled: false,
category: 'eyes'
},
{
name: 'Проверь осанку',
reps: 1,
icon: 'PersonStanding',
intervalMinutes: 25,
enabled: false,
category: 'posture'
}
]