Self-hosted fitness tracker. Log workouts, track nutrition, and monitor progress. Docker deployment, mobile-friendly.
import { Coffee, Cookie, Moon, Sun, type LucideIcon } from 'lucide-react-native'
import { i18n, uiMessage, type FoodLog, type UiMessage } from '@lyftr/shared'
// Meal + macro presentation constants, ported 1:1 from web (Food.tsx / LogFood.tsx +
// utils/macroColors.ts). Web expressed colors as Tailwind text-* classes; on native
// icon/SVG colors must be hex props, so the class names are resolved to their exact
// Tailwind hex values here.
export type Meal = FoodLog['meal']
export const MEALS: readonly Meal[] = ['breakfast', 'lunch', 'dinner', 'snacks']
// A meal outside the list renders blank, not as the raw catalog key.
export const mealLabel = (meal: Meal): string => (MEALS.includes(meal) ? i18n.t(`food.meal.${meal}`) : '')
// A toast that names a meal carries the slug in params.meal and is worded here, at render,
// so a language switch while it is on screen re-translates it.
export const mealMessage = (m: UiMessage): string =>
uiMessage(m.params?.meal ? { ...m, params: { ...m.params, meal: mealLabel(m.params.meal as Meal) } } : m)
export const MEAL_ICONS: Record<Meal, LucideIcon> = {
breakfast: Coffee,
lunch: Sun,
dinner: Moon,
snacks: Cookie,
}
// text-amber-400 / text-yellow-400 / text-indigo-400 / text-pink-400 (Tailwind hex).
export const MEAL_COLORS: Record<Meal, string> = {
breakfast: '#fbbf24',
lunch: '#facc15',
dinner: '#818cf8',
snacks: '#f472b6',
}
// The ring / chart / mini-bar palette. Re-exported so this module stays the one place
// nutrition screens import their colours from; the values live in @lyftr/shared because
// web charts with the same three.
export { MACRO_COLORS } from '@lyftr/shared'
// Per-macro accent used for the small tabular P/C/F figures on rows + the detail grid
// (web: text-emerald-400 / text-amber-400 / text-violet-400 — the -400 shades).
export const MACRO_TEXT = { protein: '#34d399', carbs: '#fbbf24', fat: '#a78bfa' } as const