mirror of
https://github.com/ManInDark/HabitTrove.git
synced 2026-03-11 04:49:49 +01:00
fix: only show areas with content on dashboard
This commit is contained in:
@@ -18,7 +18,7 @@ import { DESKTOP_DISPLAY_ITEM_COUNT } from '@/lib/constants'
|
|||||||
import { Habit, WishlistItemType } from '@/lib/types'
|
import { Habit, WishlistItemType } from '@/lib/types'
|
||||||
import { cn, d2t, getNow, getTodayInTimezone, isHabitDue, isSameDate, isTaskOverdue, t2d } from '@/lib/utils'
|
import { cn, d2t, getNow, getTodayInTimezone, isHabitDue, isSameDate, isTaskOverdue, t2d } from '@/lib/utils'
|
||||||
import { useAtom } from 'jotai'
|
import { useAtom } from 'jotai'
|
||||||
import { AlertTriangle, ArrowRight, ChevronDown, ChevronUp, Circle, CircleCheck, Coins, Pin, Plus } from 'lucide-react';
|
import { AlertTriangle, ArrowRight, ChevronDown, ChevronUp, Circle, CircleCheck, Coins, Pin, Plus } from 'lucide-react'
|
||||||
import { useTranslations } from 'next-intl'
|
import { useTranslations } from 'next-intl'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
@@ -409,7 +409,7 @@ export default function DailyOverview({
|
|||||||
<CardContent>
|
<CardContent>
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
{/* Tasks Section */}
|
{/* Tasks Section */}
|
||||||
{habits.some(habit => habit.isTask === true) && (
|
{dailyTasks.length > 0 && (
|
||||||
<ItemSection
|
<ItemSection
|
||||||
title={t('dailyTasksTitle')}
|
title={t('dailyTasksTitle')}
|
||||||
items={dailyTasks}
|
items={dailyTasks}
|
||||||
@@ -421,16 +421,16 @@ export default function DailyOverview({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Habits Section */}
|
{/* Habits Section */}
|
||||||
<ItemSection
|
{dailyHabits.length > 0 && <ItemSection
|
||||||
title={t('dailyHabitsTitle')}
|
title={t('dailyHabitsTitle')}
|
||||||
items={dailyHabits}
|
items={dailyHabits}
|
||||||
emptyMessage={t('noHabitsDueTodayMessage')}
|
emptyMessage={t('noHabitsDueTodayMessage')}
|
||||||
isTask={false}
|
isTask={false}
|
||||||
viewLink="/habits"
|
viewLink="/habits"
|
||||||
addNewItem={() => setModalConfig({ isOpen: true, isTask: false })}
|
addNewItem={() => setModalConfig({ isOpen: true, isTask: false })}
|
||||||
/>
|
/>}
|
||||||
|
|
||||||
<div className="space-y-2">
|
{sortedWishlistItems.length > 0 && <div className="space-y-2">
|
||||||
<div className="flex items-center justify-between mb-2">
|
<div className="flex items-center justify-between mb-2">
|
||||||
<h3 className="font-semibold">{t('wishlistGoalsTitle')}</h3>
|
<h3 className="font-semibold">{t('wishlistGoalsTitle')}</h3>
|
||||||
<Badge variant="secondary">
|
<Badge variant="secondary">
|
||||||
@@ -538,6 +538,10 @@ export default function DailyOverview({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
{dailyHabits.length === 0 && dailyTasks.length === 0 && sortedWishlistItems.length === 0 && <>
|
||||||
|
{t("emptyAll")}
|
||||||
|
</>}
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -48,7 +48,8 @@
|
|||||||
"deleteHabitDialogTitle": "Elimina hàbit",
|
"deleteHabitDialogTitle": "Elimina hàbit",
|
||||||
"confirmDeleteDialogMessage": "Estàs segur que vols eliminar \"{name}\"? Aquesta acció no es pot desfer.",
|
"confirmDeleteDialogMessage": "Estàs segur que vols eliminar \"{name}\"? Aquesta acció no es pot desfer.",
|
||||||
"deleteButton": "Elimina",
|
"deleteButton": "Elimina",
|
||||||
"overdueTooltip": "Vençut"
|
"overdueTooltip": "Vençut",
|
||||||
|
"emptyAll": "Res a fer."
|
||||||
},
|
},
|
||||||
"HabitContextMenuItems": {
|
"HabitContextMenuItems": {
|
||||||
"startPomodoro": "Inicia Pomodoro",
|
"startPomodoro": "Inicia Pomodoro",
|
||||||
|
|||||||
@@ -48,7 +48,8 @@
|
|||||||
"deleteHabitDialogTitle": "Gewohnheit löschen",
|
"deleteHabitDialogTitle": "Gewohnheit löschen",
|
||||||
"confirmDeleteDialogMessage": "Sind Sie sicher, dass Sie \"{name}\" löschen möchten? Diese Aktion kann nicht rückgängig gemacht werden.",
|
"confirmDeleteDialogMessage": "Sind Sie sicher, dass Sie \"{name}\" löschen möchten? Diese Aktion kann nicht rückgängig gemacht werden.",
|
||||||
"deleteButton": "Löschen",
|
"deleteButton": "Löschen",
|
||||||
"overdueTooltip": "Überfällig"
|
"overdueTooltip": "Überfällig",
|
||||||
|
"emptyAll": "Nichts zu tun."
|
||||||
},
|
},
|
||||||
"HabitContextMenuItems": {
|
"HabitContextMenuItems": {
|
||||||
"startPomodoro": "Pomodoro starten",
|
"startPomodoro": "Pomodoro starten",
|
||||||
|
|||||||
@@ -48,7 +48,8 @@
|
|||||||
"deleteHabitDialogTitle": "Delete Habit",
|
"deleteHabitDialogTitle": "Delete Habit",
|
||||||
"confirmDeleteDialogMessage": "Are you sure you want to delete \"{name}\"? This action cannot be undone.",
|
"confirmDeleteDialogMessage": "Are you sure you want to delete \"{name}\"? This action cannot be undone.",
|
||||||
"deleteButton": "Delete",
|
"deleteButton": "Delete",
|
||||||
"overdueTooltip": "Overdue"
|
"overdueTooltip": "Overdue",
|
||||||
|
"emptyAll": "Nothing to do."
|
||||||
},
|
},
|
||||||
"HabitContextMenuItems": {
|
"HabitContextMenuItems": {
|
||||||
"startPomodoro": "Start Pomodoro",
|
"startPomodoro": "Start Pomodoro",
|
||||||
|
|||||||
@@ -48,7 +48,8 @@
|
|||||||
"deleteHabitDialogTitle": "Eliminar hábito",
|
"deleteHabitDialogTitle": "Eliminar hábito",
|
||||||
"confirmDeleteDialogMessage": "¿Estás seguro de que quieres eliminar \"{name}\"? Esta acción no se puede deshacer.",
|
"confirmDeleteDialogMessage": "¿Estás seguro de que quieres eliminar \"{name}\"? Esta acción no se puede deshacer.",
|
||||||
"deleteButton": "Eliminar",
|
"deleteButton": "Eliminar",
|
||||||
"overdueTooltip": "Vencido"
|
"overdueTooltip": "Vencido",
|
||||||
|
"emptyAll": "Nada que hacer."
|
||||||
},
|
},
|
||||||
"HabitContextMenuItems": {
|
"HabitContextMenuItems": {
|
||||||
"startPomodoro": "Iniciar Pomodoro",
|
"startPomodoro": "Iniciar Pomodoro",
|
||||||
|
|||||||
@@ -48,7 +48,8 @@
|
|||||||
"deleteHabitDialogTitle": "Supprimer l'habitude",
|
"deleteHabitDialogTitle": "Supprimer l'habitude",
|
||||||
"confirmDeleteDialogMessage": "Êtes-vous sûr de vouloir supprimer \"{name}\" ? Cette action est irréversible.",
|
"confirmDeleteDialogMessage": "Êtes-vous sûr de vouloir supprimer \"{name}\" ? Cette action est irréversible.",
|
||||||
"deleteButton": "Supprimer",
|
"deleteButton": "Supprimer",
|
||||||
"overdueTooltip": "En retard"
|
"overdueTooltip": "En retard",
|
||||||
|
"emptyAll": "Rien à faire."
|
||||||
},
|
},
|
||||||
"HabitContextMenuItems": {
|
"HabitContextMenuItems": {
|
||||||
"startPomodoro": "Démarrer Pomodoro",
|
"startPomodoro": "Démarrer Pomodoro",
|
||||||
|
|||||||
@@ -48,7 +48,8 @@
|
|||||||
"deleteHabitDialogTitle": "習慣を削除",
|
"deleteHabitDialogTitle": "習慣を削除",
|
||||||
"confirmDeleteDialogMessage": "\"{name}\"を削除してもよろしいですか?この操作は元に戻せません。",
|
"confirmDeleteDialogMessage": "\"{name}\"を削除してもよろしいですか?この操作は元に戻せません。",
|
||||||
"deleteButton": "削除",
|
"deleteButton": "削除",
|
||||||
"overdueTooltip": "期限超過"
|
"overdueTooltip": "期限超過",
|
||||||
|
"emptyAll": "何もする事はありません。"
|
||||||
},
|
},
|
||||||
"HabitContextMenuItems": {
|
"HabitContextMenuItems": {
|
||||||
"startPomodoro": "ポモドーロを開始",
|
"startPomodoro": "ポモドーロを開始",
|
||||||
|
|||||||
@@ -48,7 +48,8 @@
|
|||||||
"deleteHabitDialogTitle": "습관 삭제",
|
"deleteHabitDialogTitle": "습관 삭제",
|
||||||
"confirmDeleteDialogMessage": "정말로 \"{name}\"을(를) 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다.",
|
"confirmDeleteDialogMessage": "정말로 \"{name}\"을(를) 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다.",
|
||||||
"deleteButton": "삭제",
|
"deleteButton": "삭제",
|
||||||
"overdueTooltip": "기한이 지남"
|
"overdueTooltip": "기한이 지남",
|
||||||
|
"emptyAll": "할 일이 없어요."
|
||||||
},
|
},
|
||||||
"HabitContextMenuItems": {
|
"HabitContextMenuItems": {
|
||||||
"startPomodoro": "뽀모도로 시작",
|
"startPomodoro": "뽀모도로 시작",
|
||||||
|
|||||||
@@ -48,7 +48,8 @@
|
|||||||
"deleteHabitDialogTitle": "Удалить привычку",
|
"deleteHabitDialogTitle": "Удалить привычку",
|
||||||
"confirmDeleteDialogMessage": "Вы уверены, что хотите удалить \"{name}\"? Это действие нельзя отменить.",
|
"confirmDeleteDialogMessage": "Вы уверены, что хотите удалить \"{name}\"? Это действие нельзя отменить.",
|
||||||
"deleteButton": "Удалить",
|
"deleteButton": "Удалить",
|
||||||
"overdueTooltip": "Просрочено"
|
"overdueTooltip": "Просрочено",
|
||||||
|
"emptyAll": "Делать нечего."
|
||||||
},
|
},
|
||||||
"HabitContextMenuItems": {
|
"HabitContextMenuItems": {
|
||||||
"startPomodoro": "Начать помидорку",
|
"startPomodoro": "Начать помидорку",
|
||||||
|
|||||||
@@ -48,7 +48,8 @@
|
|||||||
"deleteHabitDialogTitle": "删除习惯",
|
"deleteHabitDialogTitle": "删除习惯",
|
||||||
"confirmDeleteDialogMessage": "确定要删除\"{name}\"吗?此操作无法撤消。",
|
"confirmDeleteDialogMessage": "确定要删除\"{name}\"吗?此操作无法撤消。",
|
||||||
"deleteButton": "删除",
|
"deleteButton": "删除",
|
||||||
"overdueTooltip": "逾期"
|
"overdueTooltip": "逾期",
|
||||||
|
"emptyAll": "无事可做。"
|
||||||
},
|
},
|
||||||
"HabitContextMenuItems": {
|
"HabitContextMenuItems": {
|
||||||
"startPomodoro": "开始番茄钟",
|
"startPomodoro": "开始番茄钟",
|
||||||
|
|||||||
Reference in New Issue
Block a user