Skip to content
3 changes: 3 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
allowBuilds:
'@swc/core': false
esbuild: false
16 changes: 16 additions & 0 deletions src/components/UI/Divider/SGLDivider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Box, useTheme } from '@mui/material'
import { getDividerStyles } from './styles'

interface SGLDividerProps {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you have divider changes in this pr?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

orientation?: 'horizontal' | 'vertical'
}

export const SGLDivider = ({ orientation = 'horizontal' }: SGLDividerProps = {}) => {
const theme = useTheme()
const dividerStyles = getDividerStyles(theme)

const styles =
orientation === 'vertical' ? dividerStyles.dividerVertical : dividerStyles.dividerHorizontal

return <Box style={styles} />
}
1 change: 1 addition & 0 deletions src/components/UI/Divider/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { SGLDivider } from './SGLDivider'
28 changes: 24 additions & 4 deletions src/components/UI/Divider/styles.ts

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the divider here?

Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
import { styled } from '@mui/material'
import type { Theme } from '@mui/material'
import type { CSSProperties } from 'react'

export const SGLDivider = styled('div')(() => ({
display: 'none',
}))
export interface DividerStylesInterface {
dividerHorizontal: CSSProperties
dividerVertical: CSSProperties
}

export const getDividerStyles = (theme: Theme): DividerStylesInterface => ({
dividerHorizontal: {
width: '100%',
height: '1px',
backgroundColor: theme.palette.mediumGrey?.main || '#e0e0e0',
marginTop: '1.5rem',
marginBottom: '1.5rem',
},

dividerVertical: {
width: '1px',
height: '100%',
backgroundColor: theme.palette.mediumGrey?.main || '#e0e0e0',
marginLeft: '1.5rem',
marginRight: '1.5rem',
},
})
8 changes: 7 additions & 1 deletion src/locales/ar/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,11 @@
"lifeStyle.morningStretchingTitle": "تمارين التمدد الصباحية",
"lifeStyle.morningStretchingDescription": "تحسين تدفق الدم والمرونة",
"lifeStyle.balanceTrainingTitle": "تمارين التوازن",
"lifeStyle.balanceTrainingDescription": "تقوية عضلات الجسم الأساسية وتحسين القوام"
"lifeStyle.balanceTrainingDescription": "تقوية عضلات الجسم الأساسية وتحسين القوام",
"mealRecommendation.viewFullRecipe": "عرض الوصفة الكاملة",
"mealRecommendation.close": "إغلاق",
"mealRecommendation.lunch": "غداء موصى به",
"mealRecommendation.breakfast": "إفطار موصى به",
"mealRecommendation.dinner": "عشاء موصى به",
"mealRecommendation.dailyMeals": "وجباتك اليومية"
}
8 changes: 7 additions & 1 deletion src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,11 @@
"lifeStyle.morningStretchingTitle": "Morning Stretching",
"lifeStyle.morningStretchingDescription": "Improve Blood Flow and Flexibility",
"lifeStyle.balanceTrainingTitle": "Balance Training",
"lifeStyle.balanceTrainingDescription": "Strengthen Core Muscles and Posture"
"lifeStyle.balanceTrainingDescription": "Strengthen Core Muscles and Posture",
"mealRecommendation.viewFullRecipe": "View Full Recipe",
"mealRecommendation.close": "Close",
"mealRecommendation.lunch": "Recommended Lunch",
"mealRecommendation.breakfast": "Recommended Breakfast",
"mealRecommendation.dinner": "Recommended Dinner",
"mealRecommendation.dailyMeals": "Your Daily Meals"
}
8 changes: 7 additions & 1 deletion src/locales/he/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,11 @@
"lifeStyle.morningStretchingTitle": "מתיחות בוקר",
"lifeStyle.morningStretchingDescription": "שיפור זרימת דם וגמישות",
"lifeStyle.balanceTrainingTitle": "אימון שיווי משקל",
"lifeStyle.balanceTrainingDescription": "חיזוק שרירי ליבה ויציבה"
"lifeStyle.balanceTrainingDescription": "חיזוק שרירי ליבה ויציבה",
"mealRecommendation.viewFullRecipe": "צפה במתכון המלא",
"mealRecommendation.close": "סגור",
"mealRecommendation.lunch": "ארוחת צהריים מומלצת",
"mealRecommendation.breakfast": "ארוחת בוקר מומלצת",
"mealRecommendation.dinner": "ארוחת ערב מומלצת",
"mealRecommendation.dailyMeals": "הארוחות המומלצות שלך"
}
8 changes: 7 additions & 1 deletion src/locales/ru/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,11 @@
"lifeStyle.morningStretchingTitle": "Утренняя растяжка",
"lifeStyle.morningStretchingDescription": "Улучшение кровообращения и гибкости",
"lifeStyle.balanceTrainingTitle": "Тренировка равновесия",
"lifeStyle.balanceTrainingDescription": "Укрепление мышц кора и осанки"
"lifeStyle.balanceTrainingDescription": "Укрепление мышц кора и осанки",
"mealRecommendation.viewFullRecipe": "Просмотреть полный рецепт",
"mealRecommendation.close": "Закрыть",
"mealRecommendation.lunch": "Рекомендуемый обед",
"mealRecommendation.breakfast": "Рекомендуемый завтрак",
"mealRecommendation.dinner": "Рекомендуемый ужин",
"mealRecommendation.dailyMeals": "Ваши ежедневные приемы пищи"
}
13 changes: 12 additions & 1 deletion src/pages/lifeStyle/LifeStyle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import { useTranslation } from 'react-i18next'
import { BalanceTraining } from './physioAndTrainingTab/balanceTraining/BalanceTraining'
import { DietTabExample } from './dietTab/DietTabExample'
import { RecomendationTraining } from './physioAndTrainingTab/recomendationTraining/RecomendationTraining'

export const LifeStyle = () => {
return <RecomendationTraining />
const { t } = useTranslation()
return (
<>
<div>{t('lifestyle.page')}</div>
<BalanceTraining />
<RecomendationTraining />
<DietTabExample />
</>
)
}
87 changes: 87 additions & 0 deletions src/pages/lifeStyle/dietTab/DietTabExample.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import { useTranslation } from 'react-i18next'
import { SGLMealRecommendation } from './mealRecommendation'

export const DietTabExample = () => {
const { t } = useTranslation()
const mealsData = [
{
mealType: 'ארוחת צהריים מומלצת',
name: 'סלמון אפוי',
recipe: 'סלמון טרי אפוי עם לימון וצמחי תיבול',
fullRecipe: `סלמון אפוי עם לימון וצמחי תיבול - מומלץ מאוד לבריאות הלב

חומרים:
• 200 גר סלמון טרי
• לימון אחד
• בזיליקום, כוסברה, דיל
• שמן זית

הוראות:
1. חמם תנור ל-180 מעלות
2. הנח סלמון על נייר אפייה
3. ריסה עם שמן זית, מלח ופלפל
4. פזר צמחי תיבול
5. אפה 15-20 דקות עד שהסלמון בשל
6. הגש עם לימון טרי`,
},
{
mealType: 'חטיף מומלץ',
name: 'סלט ירוקים',
recipe: 'תערובת ירוקים טרייה עם עגבניה ומלפפון',
fullRecipe: `סלט ירוקים טרי ובריא

חומרים:
• עלי סלט מעורבים 150 גר
• 2 עגבניות בינוניות
• מלפפון אחד
• בצל אדום קצוץ
• זיתים שחורים
• שמן זית וחומץ בלסמי

הוראות:
1. שטוף את הירוקים היטב
2. חתוך את הירקות לגדלים נוחים
3. מיזג את כל החומרים בקערה
4. מחבל שמן זית וחומץ בחומס בנפרד
5. מוזג את הרוטב על הסלט
6. ערבב ברכות`,
},
{
mealType: 'ארוחת ערב מומלצת',
name: 'עוף ברוטב עלים',
recipe: 'עוף צלול עם רוטב עלים טבעי וחומרים מזינים',
fullRecipe: `עוף ברוטב עלים טבעי

חומרים:
• 250 גר בקע עוף
• 100 מ"ל מרק עוף
• כוסברית, בזיליקום, כוסבר
• שום 2 שיניים
• שמן זית

הוראות:
1. חמם שמן זית בחליה
2. הוסף בקע עוף עד להשחמה
3. הוסף שום קצוץ
4. שפוך מרק עוף
5. הוסף צמחי תיבול
6. בישול על אש בינונית 15-20 דקות
7. הגש חם`,
},
]
Comment on lines +6 to +71

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Move meal data to i18n translations or a data service.

The meal data is hardcoded in Hebrew within the component, preventing internationalization and making maintenance difficult. Since the codebase uses react-i18next (and the PR adds i18n keys for other fields), these meal definitions should follow the same pattern.

Consider:

  • Option 1 (recommended): Move to translation files with structure like t('dietTab.meals.salmon.name'), t('dietTab.meals.salmon.recipe'), etc.
  • Option 2: If meals are dynamic content, fetch from an API or context provider.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/lifeStyle/dietTab/DietTabExample.tsx` around lines 4 - 66, The
mealsData array in DietTabExample is hardcoded in Hebrew; move these strings
into i18n translation keys or a data service: replace the inline mealsData with
a mapped structure that reads values via the t(...) calls (e.g.,
t('dietTab.meals.salmon.name'), t('dietTab.meals.salmon.recipe'),
t('dietTab.meals.salmon.fullRecipe')) or fetches from an API/context if meals
are dynamic, update any references to mealsData in DietTabExample to use the
translated/fetched values, and add corresponding keys to the translation files
(dietTab.meals.*) so content is localizable and maintainable.


return (
<div style={{ padding: '16px' }}>
<h2>{t('mealRecommendation.dailyMeals')}</h2>
{mealsData.map((meal, index) => (
<SGLMealRecommendation
key={index}
mealType={meal.mealType}
name={meal.name}
recipe={meal.recipe}
fullRecipe={meal.fullRecipe}
/>
))}
</div>
)
}
51 changes: 51 additions & 0 deletions src/pages/lifeStyle/dietTab/mealRecommendation/MealCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { Typography } from '@mui/material'
import { useTheme } from '@mui/material'
import { useTranslation } from 'react-i18next'
import { getMealRecommendationStyles } from './styles'
import { SGLButton } from '../../../../components/UI/Button/SGLButton'
import { SGLCard } from '../../../../components/UI/Card/SGLCard'
import { SGLLink } from '../../../../components/UI/Icons/Link/SGLLink'
import { SGLTypography } from '../../../../components/UI/Typography/SGLTypography'
import { variantMap } from '../../../../components/UI/Typography/types'

interface MealCardProps {
mealType: string
name: string
recipe: string
imageUrl?: string
onOpenDialog: () => void
}

export const MealCard = ({ mealType, name, recipe, imageUrl, onOpenDialog }: MealCardProps) => {
const theme = useTheme()
const { t } = useTranslation()
const styles = getMealRecommendationStyles(theme)

return (
<>
<Typography variant="h6" sx={{ marginBottom: 1, fontWeight: 600 }}>
{mealType}
</Typography>
<SGLCard variant="white">
<div style={styles.container}>
<div style={styles.heroImage(imageUrl)}>
<div style={styles.iconContainer}>
<SGLLink {...styles.linkIcon} />
</div>
</div>
<div style={styles.content}>
<Typography variant={variantMap.smallTitle}>{name}</Typography>
<Typography variant={variantMap.smallText}>{recipe}</Typography>
</div>
<div style={styles.buttonWrapper}>
<SGLButton onClick={onOpenDialog} variant="outlined" sx={styles.mealButton(theme)}>
<SGLTypography variant="smallTitle">
{t('mealRecommendation.viewFullRecipe')}
</SGLTypography>
</SGLButton>
</div>
</div>
</SGLCard>
</>
)
}
34 changes: 34 additions & 0 deletions src/pages/lifeStyle/dietTab/mealRecommendation/MealDialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Typography, Dialog, DialogTitle, DialogContent, DialogActions } from '@mui/material'
import { useTheme } from '@mui/material'
import { useTranslation } from 'react-i18next'
import { getMealRecommendationStyles } from './styles'
import { SGLButton } from '../../../../components/UI/Button/SGLButton'
import { variantMap } from '../../../../components/UI/Typography/types'

interface MealDialogProps {
name: string
recipe: string
fullRecipe?: string
open: boolean
onClose: () => void
}

export const MealDialog = ({ name, recipe, fullRecipe, open, onClose }: MealDialogProps) => {
const theme = useTheme()
const { t } = useTranslation()
const styles = getMealRecommendationStyles(theme)

return (
<Dialog open={open} onClose={onClose} fullWidth>
<DialogTitle sx={styles.dialogTitle}>{name}</DialogTitle>
<DialogContent>
<Typography variant={variantMap.mediumText}>{fullRecipe || recipe}</Typography>
</DialogContent>
<DialogActions>
<SGLButton onClick={onClose} fullWidth variant="contained" sx={styles.closeButton}>
{t('mealRecommendation.close')}
</SGLButton>
</DialogActions>
</Dialog>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { useState } from 'react'
import { MealCard } from './MealCard'
import { MealDialog } from './MealDialog'

interface SGLMealRecommendationProps {
mealType: string
name: string
recipe: string
fullRecipe?: string
imageUrl?: string
}

export const SGLMealRecommendation = ({
mealType,
name,
recipe,
fullRecipe,
imageUrl,
}: SGLMealRecommendationProps) => {
const [openDialog, setOpenDialog] = useState(false)

return (
<>
<MealCard
mealType={mealType}
name={name}
recipe={recipe}
imageUrl={imageUrl}
onOpenDialog={() => setOpenDialog(true)}
/>
<MealDialog
name={name}
recipe={recipe}
fullRecipe={fullRecipe}
open={openDialog}
onClose={() => setOpenDialog(false)}
/>
</>
)
}
1 change: 1 addition & 0 deletions src/pages/lifeStyle/dietTab/mealRecommendation/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { SGLMealRecommendation } from './MealRecommendation'
Loading
Loading