File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff 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
2929connectDB ( ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React from 'react'
22import { BrowserRouter as Router , Routes , Route } from 'react-router-dom'
33import PrivateRouter from './PrivateRouter' ;
44
5+ import Index from "../views/index"
56import Login from '../views/auth/Login'
67import SignUp from '../views/auth/SignUp'
78import 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
Original file line number Diff line number Diff 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 >
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments