diff --git a/src/App.tsx b/src/App.tsx index e75d981..3b06155 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from 'react'; -import { ChevronLeft, ChevronRight, Sun, Moon, Plus, Circle, User } from 'lucide-react'; +import { Plus, Circle, User } from 'lucide-react'; import { HabitList } from './components/HabitList'; import { Calendar } from './components/Calendar'; import { Sidebar } from './components/Sidebar'; @@ -16,29 +16,28 @@ import { PreferencesProvider, usePreferences } from './contexts/PreferencesConte const DAYS_OF_WEEK = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']; function HabitTrackerContent() { - const { theme, isDark, toggleDarkMode, defaultView, habitSort } = useThemeContext(); + const { theme, habitSort } = useThemeContext(); const [newHabit, setNewHabit] = useState(''); - const [activeView, setActiveView] = useState<'habits' | 'calendar' | 'settings'>(defaultView); + const [activeView, setActiveView] = useState<'habits' | 'calendar' | 'settings'>('habits'); const [currentMonth, setCurrentMonth] = useState(new Date()); - const { user, loading, signOut } = useAuth(); + const { user, loading } = useAuth(); const [authView, setAuthView] = useState<'login' | 'signup'>('login'); const { preferences } = usePreferences(); - const { - habits, - fetchHabits, - addHabit: addHabitApi, - toggleHabit, - updateHabit, - deleteHabit, - error + const { + habits, + fetchHabits, + addHabit: addHabitApi, + toggleHabit, + updateHabit, + deleteHabit, + error } = useHabits(); - - const { - currentWeek, - setCurrentWeek, - getCurrentWeekDates, - changeWeek + + const { + currentWeek, + setCurrentWeek, + getCurrentWeekDates } = useWeek(); useEffect(() => { @@ -112,7 +111,7 @@ function HabitTrackerContent() {
setNewHabit(e.target.value)} placeholder="Add a new habit" className={` - w-full px-12 py-3 + w-full px-12 py-3 rounded-lg transition-all duration-200 ${theme.input} @@ -146,11 +145,11 @@ function HabitTrackerContent() { disabled={!newHabit.trim()} className={` w-full md:w-auto - px-6 py-3 + px-6 py-3 rounded-lg transition-all duration-200 flex items-center justify-center gap-2 - ${theme.button.primary} + ${theme.button.primary} disabled:opacity-50 ${newHabit.trim() ? 'hover:translate-x-1' : ''} `} @@ -168,24 +167,12 @@ function HabitTrackerContent() {

Track your weekly progress

- -
@@ -290,4 +277,4 @@ export default function HabitTracker() { ); -} \ No newline at end of file +}