Skip to content
Open
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
23 changes: 22 additions & 1 deletion src/components/Calendar/Components/Entries.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ExpandLess, ExpandMore } from '@mui/icons-material';
import {
Box, // import box to show the hint
Card,
CardContent,
CardHeader,
Expand Down Expand Up @@ -37,7 +38,7 @@ const Entries: React.FC<LogProps> = ({ selectedDay }) => {
<CardHeader
title={
<Typography variant="h5" component="div" sx={{ fontWeight: 'bold' }}>
{t("entries")} - {selectedDay.date.toLocaleDateString()}
{t("Your daily records")} - {selectedDay.date.toLocaleDateString()}
</Typography>
}
/>
Expand Down Expand Up @@ -153,6 +154,26 @@ const Entries: React.FC<LogProps> = ({ selectedDay }) => {
</Collapse>
</>}
</List>
{/* when no data loaded, show up a hint */}
{!selectedDay.weightEntry &&
selectedDay.measurements.length === 0 &&
!selectedDay.workoutSession &&
selectedDay.nutritionLogs.length ===0 && (
<Box sx={{
display:'flex',
flexDirection:'column',
alignItems:'center',
py:4,
color:'text.secondary'
}}>
<Typography variant="body1" sx={{ mb: 1 }}>
{t("You haven't logged your weight/workout/nutritions today.")}
</Typography>
<Typography variant="body2" sx={{ mb: 1 }}>
{t("Add your first record")}
</Typography>
</Box>
)}

</CardContent>
</Card>
Expand Down