Skip to content

Commit c33b143

Browse files
author
Ahmad Zani Syechkar
committed
add
1 parent 04dc06b commit c33b143

5 files changed

Lines changed: 30 additions & 5 deletions

File tree

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Vite + React + TS</title>
7+
<title>Task Manager</title>
88
</head>
99
<body>
1010
<div id="root"></div>

server/server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ app.use(
2020
);
2121

2222
// Middleware JSON parser
23-
app.use(express.static("../dist"));
24-
app.get("*", (req, res) => {
25-
res.sendFile("../dist/index.html");
26-
});
23+
// app.use(express.static("../dist"));
24+
// app.get("*", (req, res) => {
25+
// res.sendFile("../dist/index.html");
26+
// });
2727

2828
// Connect database
2929
connectDB();

src/routes/Router.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react'
22
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'
33
import PrivateRouter from './PrivateRouter';
44

5+
import Index from "../views/index"
56
import Login from '../views/auth/Login'
67
import SignUp from '../views/auth/SignUp'
78
import DashboardAdmin from '../views/Admin/DashboardAdmin'
@@ -16,6 +17,7 @@ export default function AppRouter() {
1617
return (
1718
<Router>
1819
<Routes>
20+
<Route path='/' element={ <Index /> }/>
1921
<Route path='/login' element={<Login />}/>
2022
<Route path='/signup' element={<SignUp />}></Route>
2123

src/views/auth/Login.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export default function Login() {
108108
{error}
109109
</p>
110110
)}
111+
111112
<Button type='submit'>
112113
{buttonText.toLowerCase() === "login" ? buttonText.toUpperCase() : buttonText}
113114
</Button>

src/views/index.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from "react";
2+
import Button from "../components/Button";
3+
import { useNavigate } from "react-router-dom";
4+
5+
export default function Index() {
6+
const navigate = useNavigate();
7+
8+
const handleButton = () => {
9+
navigate("/login");
10+
}
11+
12+
return (
13+
<div className="flex justify-center items-center h-screen"> {/* Tambah h-screen */}
14+
<div className="w-[90%] lg:w-[70%] flex flex-col justify-center items-center space-y-4"> {/* Tambah items-center dan space-y */}
15+
<h3 className="text-xl font-semibold text-black">Welcome Back</h3>
16+
<Button onClick={handleButton}>
17+
Login
18+
</Button>
19+
</div>
20+
</div>
21+
);
22+
}

0 commit comments

Comments
 (0)