Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SparkyFitnessFrontend/src/api/Diary/foodEntryService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { apiCall } from '../api';
import type { MealFood } from '@/types/meal';
import type { FoodEntryMeal } from '@/types/meal';
import type { FoodEntry } from '@/types/food';
import { DayData, Goals } from '@/types/diary';
import { type DayData, type Goals } from '@workspace/shared';

export interface FoodEntryUpdateData {
quantity?: number;
Expand Down
2 changes: 1 addition & 1 deletion SparkyFitnessFrontend/src/pages/Diary/DiaryTopControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import {
getNutrientMetadata,
formatNutrientValue,
} from '@/utils/nutrientUtils';
import { Goals } from '@/types/diary';
import type { UserCustomNutrient } from '@/types/customNutrient';
import EditGoalsForToday from '@/pages/Goals/EditGoalsForToday';
import { useMemo } from 'react';
import { DEFAULT_GOALS } from '@/constants/goals';
import { Goals } from '@workspace/shared';

export interface DayTotals {
calories: number; // Stored internally as kcal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
} from '@/utils/nutrientUtils';
import { getEnergyUnitString } from '@/utils/nutritionCalculations';
import { useMiniNutritionTrendData } from '@/hooks/Foods/useFoods';
import { DayData } from '@/types/diary';
import { DayData } from '@workspace/shared';

interface MiniNutritionTrendsProps {
selectedDate: string;
Expand Down
19 changes: 0 additions & 19 deletions SparkyFitnessFrontend/src/types/diary.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import { WorkoutPresetSet } from './workout';

export interface Goals {
calories: number;
protein: number;
carbs: number;
fat: number;
water_goal_ml: number;
dietary_fiber?: number;
[key: string]: number; // Allow custom nutrients
}

export interface ExerciseEntry {
id: string;
exercise_id: string;
Expand All @@ -28,15 +18,6 @@ export interface ExerciseEntry {
} | null;
}

export interface DayData {
date: string;
calories: number;
protein: number;
carbs: number;
fat: number;
dietary_fiber: number;
}

export interface MealTypeDefinition {
id: string;
name: string;
Expand Down
2 changes: 1 addition & 1 deletion SparkyFitnessFrontend/src/utils/nutritionCalculations.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { getDietTemplate } from '@/constants/dietTemplates';
import { EMPTY_MEAL_TOTALS } from '@/constants/nutrients';
import i18n from '@/i18n';
import { Goals } from '@/types/diary';
import type { FoodEntry, FoodVariant } from '@/types/food';
import { FoodEntryMeal, MealTotals } from '@/types/meal';
import { Goals } from '@workspace/shared';

// Utility functions for nutrition calculations

Expand Down
5 changes: 3 additions & 2 deletions SparkyFitnessFrontend/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
"noFallthroughCasesInSwitch": false,

"paths": {
"@/*": ["./src/*"]
"@/*": ["./src/*"],
"@workspace/shared": ["../shared/src/index.ts"]
}
},
"include": ["src", "src/types/**/*.d.ts"]
"include": ["src", "src/types/**/*.d.ts", "../shared/src"]
}
3 changes: 2 additions & 1 deletion SparkyFitnessFrontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
],
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
"@/*": ["./src/*"],
"@workspace/shared": ["../shared/src/index.ts"]
},
"noImplicitAny": false,
"noUnusedParameters": false,
Expand Down
Loading
Loading