add support for habit pinning (#105)

This commit is contained in:
Doh
2025-04-10 16:47:59 -04:00
committed by GitHub
parent f1e3ee5747
commit 685cb80321
6 changed files with 342 additions and 412 deletions

View File

@@ -22,7 +22,9 @@ export default function HabitList() {
const habits = habitsData.habits.filter(habit =>
isTasksView ? habit.isTask : !habit.isTask
)
const activeHabits = habits.filter(h => !h.archived)
const activeHabits = habits
.filter(h => !h.archived)
.sort((a, b) => (b.pinned ? 1 : 0) - (a.pinned ? 1 : 0))
const archivedHabits = habits.filter(h => h.archived)
const [settings] = useAtom(settingsAtom)
const [modalConfig, setModalConfig] = useState<{