mirror of
https://github.com/harivansh-afk/Habit-Tracker.git
synced 2026-04-17 11:04:56 +00:00
removed week scrolling
This commit is contained in:
parent
f419197d73
commit
149b02b4da
1 changed files with 24 additions and 37 deletions
23
src/App.tsx
23
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,11 +16,11 @@ 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();
|
||||
|
||||
|
|
@ -37,8 +37,7 @@ function HabitTrackerContent() {
|
|||
const {
|
||||
currentWeek,
|
||||
setCurrentWeek,
|
||||
getCurrentWeekDates,
|
||||
changeWeek
|
||||
getCurrentWeekDates
|
||||
} = useWeek();
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -168,24 +167,12 @@ function HabitTrackerContent() {
|
|||
<p className={`text-sm ${theme.mutedText}`}>Track your weekly progress</p>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<button
|
||||
onClick={() => changeWeek('prev')}
|
||||
className={`p-2 rounded-lg ${theme.button.icon}`}
|
||||
>
|
||||
<ChevronLeft className="h-5 w-5" />
|
||||
</button>
|
||||
<button
|
||||
onClick={goToCurrentWeek}
|
||||
className={`px-4 py-2 rounded-lg ${theme.button.secondary}`}
|
||||
>
|
||||
Today
|
||||
</button>
|
||||
<button
|
||||
onClick={() => changeWeek('next')}
|
||||
className={`p-2 rounded-lg ${theme.button.icon}`}
|
||||
>
|
||||
<ChevronRight className="h-5 w-5" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue