File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,9 +4,11 @@ import Button from "../../ui/Button/Button";
44import HoverToggleIcon from "../../ui/Button/HoverToggleIcon" ;
55import PrimaryButton from "../../ui/Button/PrimaryButton" ;
66import { useEffect , useState } from "react" ;
7+ import { useNavigate } from "react-router-dom" ;
78
89const Header = ( ) => {
910 const [ scrolled , setScrolled ] = useState ( true ) ;
11+ const navigate = useNavigate ( )
1012 useEffect ( ( ) => {
1113 const handleScroll = ( ) => {
1214 setScrolled ( window . scrollY > 0 ) ;
@@ -88,7 +90,16 @@ const Header = () => {
8890 </ Button >
8991 </ div >
9092 < div className = "hidden lg:flex gap-5 justify-end items-center" >
91- < Button >
93+ < Button onClick = { ( ) => {
94+ const user = localStorage . getItem ( "user" )
95+ if ( user != null ) {
96+
97+ navigate ( "/home" )
98+ } else {
99+
100+ navigate ( "/login" )
101+ }
102+ } } >
92103 { ( ) => (
93104 < >
94105 < span > Log in</ span >
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ const TodayPage = () => {
3030 ) ;
3131
3232
33- const myPlans = response . data . data . plans ;
33+ const myPlans = response . data . data . plans ;
3434 const today = new Date ( ) ;
3535
3636 const tasks : Task [ ] = [ ] ;
@@ -47,10 +47,10 @@ const TodayPage = () => {
4747
4848 if ( isSameDay ) tasks . push ( task ) ;
4949 allTask . push ( task ) ;
50- console . log ( task ) ;
5150 } )
5251 ) ;
53-
52+
53+ console . log ( allTask . length ) ;
5454 setTodayTasks ( tasks ) ;
5555 setAllTasks ( allTask ) ;
5656 } catch ( error ) {
Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ import { ArrowRight, ChevronRight } from "lucide-react";
22import Button from "../../components/ui/Button/Button" ;
33import HoverToggleIcon from "../../components/ui/Button/HoverToggleIcon" ;
44import PrimaryButton from "../../components/ui/Button/PrimaryButton" ;
5+ import { useNavigate } from "react-router-dom" ;
56
67const LandingPage = ( ) => {
8+ const naviagte = useNavigate ( )
79 return (
810 < section className = "max-w-[1800px] flex flex-col items-center" >
911 < div className = "min-h-[600px] flex flex-col items-center justify-end p-4" >
You can’t perform that action at this time.
0 commit comments