Skip to content

Commit 8f4ea26

Browse files
MVP ready #1 - with some inactive buttons and UI
1 parent 46866a1 commit 8f4ea26

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

frontend/src/components/common/Header/Header.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import Button from "../../ui/Button/Button";
44
import HoverToggleIcon from "../../ui/Button/HoverToggleIcon";
55
import PrimaryButton from "../../ui/Button/PrimaryButton";
66
import { useEffect, useState } from "react";
7+
import { useNavigate } from "react-router-dom";
78

89
const 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>

frontend/src/pages/HomePage/TodayPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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) {

frontend/src/pages/LandingPage/LandingPage.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import { ArrowRight, ChevronRight } from "lucide-react";
22
import Button from "../../components/ui/Button/Button";
33
import HoverToggleIcon from "../../components/ui/Button/HoverToggleIcon";
44
import PrimaryButton from "../../components/ui/Button/PrimaryButton";
5+
import { useNavigate } from "react-router-dom";
56

67
const 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">

0 commit comments

Comments
 (0)